コード例 #1
0
ファイル: EmployeesCodesDAL.cs プロジェクト: hanyweal/HCM
 public int Insert(EmployeesCodes EmployeesCode)
 {
     try
     {
         using (var db = new HCMEntities())
         {
             db.EmployeesCodes.Add(EmployeesCode);
             db.SaveChanges();
             return(EmployeesCode.EmployeeCodeID);
         }
     }
     catch
     {
         throw;
     }
 }
コード例 #2
0
ファイル: EmployeesCodesDAL.cs プロジェクト: hanyweal/HCM
 public EmployeesCodes GetByEmployeeCodeNo(EmployeesCodes EmployeeCode)
 {
     try
     {
         var db = new HCMEntities();
         return(db.EmployeesCodes.Include("Employees")
                //.Include("EmployeesCareersHistory.OrganizationsJobs")
                .Include("EmployeesCareersHistory.OrganizationsJobs.Jobs")
                .Include("EmployeesCareersHistory.OrganizationsJobs.Ranks")
                .Include("EmployeesCareersHistory.OrganizationsJobs.OrganizationsStructures")
                .FirstOrDefault(x => x.EmployeeCodeNo.Equals(EmployeeCode.EmployeeCodeNo)));
     }
     catch
     {
         throw;
     }
 }
コード例 #3
0
ファイル: EmployeesCodesDAL.cs プロジェクト: hanyweal/HCM
 public int UpdateIsActive(EmployeesCodes EmployeesCode)
 {
     try
     {
         using (var db = new HCMEntities())
         {
             EmployeesCodes EmployeesCodeObj = db.EmployeesCodes.FirstOrDefault(x => x.EmployeeCodeID.Equals(EmployeesCode.EmployeeCodeID));
             EmployeesCodeObj.IsActive        = EmployeesCode.IsActive;
             EmployeesCodeObj.LastUpdatedDate = EmployeesCode.LastUpdatedDate;
             EmployeesCodeObj.LastUpdatedBy   = EmployeesCode.LastUpdatedBy;
             return(db.SaveChanges());
         }
     }
     catch
     {
         throw;
     }
 }