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