public FineOffice.Modules.CRM_Industry Update(FineOffice.Modules.CRM_Industry model) { dal.Initialization(); FineOffice.Entity.CRM_Industry entity = new Entity.CRM_Industry { ID = model.ID, Industry = model.Industry, Ordering = model.Ordering, Remark = model.Remark, }; dal.Update(entity); dal.Dispose(); return(this.GetModel(d => d.ID == entity.ID)); }
/// <summary> /// 返回一个model /// </summary> /// <returns></returns> public FineOffice.Modules.CRM_Industry GetModel(System.Linq.Expressions.Expression <Func <FineOffice.Modules.CRM_Industry, bool> > expression) { dal.Initialization(); FineOffice.Modules.CRM_Industry model = (from entity in dal.GetListAll() select new FineOffice.Modules.CRM_Industry { ID = entity.ID, Industry = entity.Industry, Ordering = entity.Ordering, Remark = entity.Remark, }).Where(expression).FirstOrDefault(); dal.Dispose(); return(model); }