Example #1
0
 public static T_ProjectFee ToModel(this  T_ProjectFeeModel node)
 {
     return(new T_ProjectFee()
     {
         Id = node.Id,
         ProjectId = node.ProjectId,
         Status = node.Status,
         PayDate = node.PayDate,
         PayNo = node.PayNo,
         PlanPayDate = node.PlanPayDate,
         PlayFee = node.PlayFee,
         Remark = node.Remark,
     });
 }
Example #2
0
        public static T_ProjectFeeModel DTO(this T_ProjectFee node)
        {
            if (node == null)
            {
                return(null);
            }
            var model = new T_ProjectFeeModel()
            {
                Id          = node.Id,
                ProjectId   = node.ProjectId,
                Status      = node.Status,
                PayDate     = node.PayDate,
                PayNo       = node.PayNo,
                PlanPayDate = node.PlanPayDate,
                PlayFee     = node.PlayFee,
                Remark      = node.Remark,
            };

            return(model);
        }
Example #3
0
        /// <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_ProjectFeeModel> Search(T_ProjectFeeModel model, Dictionary <string, string> Orders = null, int PageSize = 15, int PageIndex = 100)
        {
            Expression <Func <T_ProjectFee, bool> > where = null;                   //最终查询条件
            var lambdaList = new List <Expression <Func <T_ProjectFee, bool> > >(); //lambda查询条件集合
            int total      = 0;                                                     //总行数

            if (model.ProjectId != null && model.ProjectId > 0)
            {
                lambdaList.Add(c => c.ProjectId == model.ProjectId);
            }
            //将集合表达式树转换成Expression表达式树
            MyVisitor <T_ProjectFee, T_ProjectFee> visitor = new MyVisitor <T_ProjectFee, T_ProjectFee>();

            where = visitor.Modify(lambdaList);
            var list   = dal.Search(out total, where, Orders, PageSize, PageIndex).DTOList().ToList();
            var result = new DataGrid <T_ProjectFeeModel>()
            {
                rows  = list,
                total = total
            };

            return(result);
        }
Example #4
0
 public int DeleteData(T_ProjectFeeModel model)
 {
     return(this.Delete(model.Id));
 }
Example #5
0
 public int EditData(T_ProjectFeeModel model)
 {
     return(this.Edit(model.ToModel()));
 }
Example #6
0
 public int AddData(T_ProjectFeeModel model)
 {
     return(this.Add(model.ToModel()));
 }