예제 #1
0
 public FineOffice.Modules.HR_Personnel Update(FineOffice.Modules.HR_Personnel model)
 {
     dal.Initialization();
     FineOffice.Entity.HR_Personnel entity = new Entity.HR_Personnel
     {
         ID             = model.ID,
         Remark         = model.Remark,
         Address        = model.Address,
         BankingAccount = model.BankingAccount,
         DateOfBirth    = model.DateOfBirth,
         DepartmentID   = model.DepartmentID,
         EducationID    = model.EducationID,
         Email          = model.Email,
         EntryDate      = model.EntryDate,
         ExitDate       = model.ExitDate,
         HomeTelephone  = model.HomeTelephone,
         JobID          = model.JobID,
         Linkman        = model.Linkman,
         Mobile         = model.Mobile,
         Name           = model.Name,
         Post           = model.Post,
         NativePlace    = model.NativePlace,
         PersonnelNO    = model.PersonnelNO,
         Sex            = model.Sex,
         PinyinCode     = model.PinyinCode,
         Stop           = model.Stop,
     };
     dal.Update(entity);
     dal.Dispose();
     return(null);
 }
예제 #2
0
 /// <summary>
 /// 返回一个model
 /// </summary>
 /// <returns></returns>
 public FineOffice.Modules.HR_Personnel GetModel(System.Linq.Expressions.Expression <Func <FineOffice.Modules.HR_Personnel, bool> > expression)
 {
     dal.Initialization();
     FineOffice.Modules.HR_Personnel model =
         (from entity in dal.GetListAll()
          select new FineOffice.Modules.HR_Personnel
     {
         ID = entity.ID,
         Remark = entity.Remark,
         Address = entity.Address,
         BankingAccount = entity.BankingAccount,
         DateOfBirth = entity.DateOfBirth,
         DepartmentID = entity.DepartmentID,
         EducationID = entity.EducationID,
         Email = entity.Email,
         EntryDate = entity.EntryDate,
         ExitDate = entity.ExitDate,
         TypeID = entity.EducationID,
         Education = entity.AM_Kind.Name,
         HomeTelephone = entity.HomeTelephone,
         JobID = entity.JobID,
         Linkman = entity.Linkman,
         Mobile = entity.Mobile,
         Name = entity.Name,
         Post = entity.Post,
         NativePlace = entity.NativePlace,
         PersonnelNO = entity.PersonnelNO,
         Sex = entity.Sex,
         PinyinCode = entity.PinyinCode,
         Stop = entity.Stop,
         DepartmentName = entity.HR_Department.DepartmentName,
     }).Where(expression).FirstOrDefault();
     dal.Dispose();
     return(model);
 }