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
+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();