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 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.DataTableToModel(dt); } catch { throw new NotImplementedException(); } } } }