wxw
2025-05-12 c2dc3bd2569f8398e2710aca2685bb3115c77eb0
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
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common;
using Model;
 
namespace BLL.DAL
{
    public class DAL_OperationRecord
    {
        public DataTable GetUserItems()
        {
            try
            {
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.Append("select * from UserInfo where IsDel = 0 ");
                stringBuilder.Append("order by CreatTime ;");
 
                DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(stringBuilder);
                return dt;
            }
            catch
            {
                throw new NotImplementedException();
            }
        }
 
        public IList<WCSLogOperationList> GetList(AjaxLogOperationList Json, ref PageInfo pageInfo)
        {
            try
            { 
                StringBuilder strSql = new StringBuilder();
                strSql.Append("Select WCSLogOperation.*,UserInfo.UserName as CreateUserName from WCSLogOperation left join UserInfo on WCSLogOperation.CreateUser = UserInfo.ID where WCSLogOperation.Id>0 ");
 
                if (!string.IsNullOrWhiteSpace(Json.MenuName))
                {
                    strSql.Append(" and MenuName like '%" + Json.MenuName + "%'  ");
                }
                if (!string.IsNullOrWhiteSpace(Json.UserCode))
                {
                    strSql.Append(" and CreateUser = '" + Json.UserCode + "'  ");
                }
 
                if (Json.BeginTime != DateTime.MinValue && Json.BeginTime != null && Json.BeginTime != DateTime.MaxValue)
                {
                    strSql.Append($"and CreateTime >= '{Convert.ToDateTime(Json.BeginTime).ToShortDateString()}' ");
                }
                if (Json.EndTime != DateTime.MinValue && Json.EndTime != null && Json.EndTime != DateTime.MaxValue)
                {
                    strSql.Append($"and CreateTime <= '{Convert.ToDateTime(Json.EndTime).ToShortDateString() + " 23:59:59.999"}' ");
                    
                }
 
                DataTable dt = DataFactory.SqlDataBase().GetPageList(strSql.ToString(), null, "CreateTime", "Desc", ref pageInfo);
                return ModelConvertHelper<WCSLogOperationList>.DataTableToModel(dt);
            }
            catch
            {
                throw new NotImplementedException();
            }
        }
    }
}