Add download links

This commit is contained in:
2016-05-06 11:19:01 -04:00
parent 972bb04291
commit f4ebeefad1
12 changed files with 109 additions and 29 deletions
+4
View File
@@ -50,6 +50,10 @@
<HintPath>..\packages\fasterflect.2.1.3\lib\net40\Fasterflect.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MlkPwgen, Version=0.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MlkPwgen.0.2.0.0\lib\net45\MlkPwgen.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.2.3\lib\net45\NLog.dll</HintPath>
<Private>True</Private>
+7
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using LeafWeb.Core.Entities;
using MlkPwgen;
namespace LeafWeb.Core.DAL
{
@@ -50,6 +51,11 @@ namespace LeafWeb.Core.DAL
return _db.LeafInputs.FirstOrDefault(li => li.Id == id);
}
public LeafInput GetLeafInput(string uniqueToken)
{
return _db.LeafInputs.FirstOrDefault(li => li.UniqueToken == uniqueToken);
}
public IQueryable<LeafInput> GetLeafInputs(params LeafInputStatusType[] statuses)
{
return
@@ -61,6 +67,7 @@ namespace LeafWeb.Core.DAL
public void AddLeafInput(LeafInput leafInput)
{
leafInput.Added = DateTime.Now;
leafInput.UniqueToken = PasswordGenerator.Generate(12);
_db.LeafInputs.Add(leafInput);
SetLeafInputStatusNoUpdate(leafInput, LeafInputStatusType.Pending);
_db.SaveChanges();
+5
View File
@@ -70,5 +70,10 @@ namespace LeafWeb.Core.Entities
return compressedFileStream.ToArray();
}
}
public int GetOutputFileSizeSum()
{
return OutputFiles.Sum(o => o.Contents.Length);
}
}
}
+1
View File
@@ -4,6 +4,7 @@
<package id="CsvHelper" version="2.13.2.0" targetFramework="net45" />
<package id="EntityFramework" version="6.1.3" targetFramework="net45" />
<package id="fasterflect" version="2.1.3" targetFramework="net45" />
<package id="MlkPwgen" version="0.2.0.0" targetFramework="net45" />
<package id="NLog" version="4.2.3" targetFramework="net45" />
<package id="SSH.NET" version="2013.4.7" targetFramework="net45" />
</packages>