public static T_LeaveSetting ToModel(this T_LeaveSettingModel node) { return(new T_LeaveSetting() { Id = node.Id, Name = node.Name, Days = node.Days, IsCarryOver = node.IsCarryOver, IsLimit = node.IsLimit, IsUnpaid = node.IsUnpaid, Months = node.Months, Enable = node.Enable, }); }
/// <summary> /// 复杂查询 /// </summary> /// <param name="model">查询对象</param> /// <param name="Orders">排序字典key:排序的字段,value:asc升序/desc降序</param> /// <param name="PageSize">每页行数,默认15</param> /// <param name="PageIndex">当前页码,默认100</param> /// <returns></returns> public DataGrid <T_LeaveSettingModel> Search(T_LeaveSettingModel model, Dictionary <string, string> Orders = null, int PageSize = 15, int PageIndex = 100) { Expression <Func <T_LeaveSetting, bool> > where = null; //最终查询条件 var lambdaList = new List <Expression <Func <T_LeaveSetting, bool> > >(); //lambda查询条件集合 int total = 0; //总行数 #region 查询条件 #endregion //将集合表达式树转换成Expression表达式树 MyVisitor <T_LeaveSetting, T_LeaveSetting> visitor = new MyVisitor <T_LeaveSetting, T_LeaveSetting>(); where = visitor.Modify(lambdaList); var list = dal.Search(out total, where, Orders, PageSize, PageIndex).DTOList().ToList(); var result = new DataGrid <T_LeaveSettingModel>() { rows = list, total = total }; return(result); }
public static T_LeaveSettingModel DTO(this T_LeaveSetting node) { if (node == null) { return(null); } var model = new T_LeaveSettingModel() { Id = node.Id, Name = node.Name, Days = node.Days, IsCarryOver = node.IsCarryOver, IsLimit = node.IsLimit, IsUnpaid = node.IsUnpaid, Months = node.Months, Enable = node.Enable, }; return(model); }
public int DeleteData(T_LeaveSettingModel model) { return(this.Delete(model.Id)); }
public int EditData(T_LeaveSettingModel model) { return(this.Edit(model.ToModel())); }
public int AddData(T_LeaveSettingModel model) { return(this.Add(model.ToModel())); }