schangxiang@126.com
2025-09-10 3d43ffa3152110b7823f9fa6320c08a6ae02358a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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;
            }
        }
 
        
    }
}