Ejemplo n.º 1
0
 public FineOffice.Modules.HD_Folder Update(FineOffice.Modules.HD_Folder model)
 {
     dal.Initialization();
     FineOffice.Entity.HD_Folder entity = new Entity.HD_Folder
     {
         ID          = model.ID,
         FolderName  = model.FolderName,
         ParentID    = model.ParentID,
         IsPublic    = model.IsPublic,
         PersonnelID = model.PersonnelID,
         Remark      = model.Remark,
     };
     dal.Update(entity);
     dal.Dispose();
     return(null);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 增加部门
 /// </summary>
 public FineOffice.Modules.HD_Folder Add(FineOffice.Modules.HD_Folder model)
 {
     dal.Initialization();
     FineOffice.Entity.HD_Folder entity = new Entity.HD_Folder
     {
         ID          = model.ID,
         FolderName  = model.FolderName,
         ParentID    = model.ParentID,
         IsPublic    = model.IsPublic,
         PersonnelID = model.PersonnelID,
         Remark      = model.Remark,
     };
     dal.Add(entity);
     dal.Dispose();
     return(this.GetModel(d => d.ID == entity.ID));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 返回一个model
 /// </summary>
 /// <returns></returns>
 public FineOffice.Modules.HD_Folder GetModel(System.Linq.Expressions.Expression <Func <FineOffice.Modules.HD_Folder, bool> > expression)
 {
     dal.Initialization();
     FineOffice.Modules.HD_Folder model =
         (from entity in dal.GetListAll()
          select new FineOffice.Modules.HD_Folder
     {
         ID = entity.ID,
         FolderName = entity.FolderName,
         ParentID = entity.ParentID,
         Remark = entity.Remark,
         PersonnelID = entity.PersonnelID,
         IsPublic = entity.IsPublic,
     }).Where(expression).FirstOrDefault();
     dal.Dispose();
     return(model);
 }