Add download links
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user