Exemple #1
0
 public FineOffice.Modules.OA_Form Update(FineOffice.Modules.OA_Form model)
 {
     dal.Initialization();
     FineOffice.Entity.OA_Form entity = new Entity.OA_Form
     {
         ID         = model.ID,
         TypeID     = model.TypeID,
         FormNO     = model.FormNO,
         Creator    = model.Creator,
         Stop       = model.Stop,
         FormName   = model.FormName,
         PinyinCode = model.PinyinCode,
         FormData   = model.FormData == null ? null : model.FormData.ToArray(),
         XType      = model.XType,
         Remark     = model.Remark
     };
     dal.Update(entity);
     dal.Dispose();
     return(GetModel(d => d.ID == model.ID));
 }
Exemple #2
0
 /// <summary>
 /// 返回一个model
 /// </summary>
 /// <returns></returns>
 public FineOffice.Modules.OA_Form GetModel(System.Linq.Expressions.Expression <Func <FineOffice.Modules.OA_Form, bool> > expression)
 {
     dal.Initialization();
     FineOffice.Modules.OA_Form model =
         (from entity in dal.GetListAll()
          select new FineOffice.Modules.OA_Form
     {
         ID = entity.ID,
         TypeID = entity.TypeID,
         FormNO = entity.FormNO,
         Creator = entity.Creator,
         Stop = entity.Stop,
         FormName = entity.FormName,
         PinyinCode = entity.PinyinCode,
         Remark = entity.Remark,
         FormData = entity.FormData == null ? null : entity.FormData.ToArray(),
         XType = entity.XType,
     }).Where(expression).FirstOrDefault();
     dal.Dispose();
     return(model);
 }