using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using wcftest.EnumDefine;
|
using wcftest.Model;
|
using wcftest.orm;
|
|
namespace wcftest.BussinessExtension.Handle
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public class UpdateStoreWarningDaysHandler
|
{
|
|
|
/// <summary>
|
/// 执行
|
/// </summary>
|
/// <param name="mod"></param>
|
/// <param name="input"></param>
|
public static FunRetEntity Excute(UpdateStoreWarningDaysInput input)
|
{
|
try
|
{
|
if (input.Days <= 0)
|
{
|
return FunRetEntity.Fail("天数不能小于等于0");
|
}
|
using (dbModel mod = new dbModel())
|
{
|
Base_BasicDataSet task = mod.Base_BasicDataSet.Where(x => x.BasicDataType == "1").FirstOrDefault();
|
if (task == null)
|
{
|
return FunRetEntity.Fail("没有找到管理数据");
|
}
|
|
task.BasicDataValue = input.Days.ToString();
|
task.LastModifier = input.UserName;
|
task.LastModifyTime = DateTime.Now;
|
task.Remark = "更新";
|
|
|
int i = mod.SaveChanges();
|
if (i == 1)
|
{
|
return FunRetEntity.Success("更改成功");
|
}
|
return FunRetEntity.Fail("更改失败");
|
}
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 执行
|
/// </summary>
|
/// <param name="mod"></param>
|
/// <param name="input"></param>
|
public static FunRetEntity Get()
|
{
|
try
|
{
|
|
using (dbModel mod = new dbModel())
|
{
|
Base_BasicDataSet task = mod.Base_BasicDataSet.Where(x => x.BasicDataType == "1").FirstOrDefault();
|
if (task == null)
|
{
|
return FunRetEntity.Fail("没有找到管理数据");
|
}
|
return FunRetEntity.Success("更成功", task.BasicDataValue);
|
|
}
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
|
}
|
}
|