Exemple #1
0
 public int Insert(Scholarships EmployeeScholarship)
 {
     try
     {
         using (var db = new HCMEntities())
         {
             db.Scholarships.Add(EmployeeScholarship);
             db.SaveChanges();
             return(EmployeeScholarship.ScholarshipID);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #2
0
 public int Delete(Scholarships EmployeeScholarship, int UserIdentity)
 {
     try
     {
         using (var db = new HCMEntities())
         {
             Scholarships EmployeeScholarshipObj = db.Scholarships.FirstOrDefault(x => x.ScholarshipID.Equals(EmployeeScholarship.ScholarshipID));
             db.Scholarships.Remove(EmployeeScholarshipObj);
             return(db.SaveChanges(UserIdentity));
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #3
0
 public int UpdateJoinScholarshipStatus(Scholarships EmployeeScholarship)
 {
     try
     {
         using (var db = new HCMEntities())
         {
             Scholarships EmployeeScholarshipObj = db.Scholarships.FirstOrDefault(x => x.ScholarshipID.Equals(EmployeeScholarship.ScholarshipID));
             EmployeeScholarshipObj.ScholarshipStartDate = EmployeeScholarship.ScholarshipStartDate;
             EmployeeScholarshipObj.ScholarshipEndDate   = EmployeeScholarship.ScholarshipEndDate;
             EmployeeScholarshipObj.ScholarshipJoinDate  = EmployeeScholarship.ScholarshipJoinDate;
             EmployeeScholarshipObj.IsPassed             = EmployeeScholarship.IsPassed;
             EmployeeScholarshipObj.LastUpdatedDate      = EmployeeScholarship.LastUpdatedDate;
             EmployeeScholarshipObj.LastUpdatedBy        = EmployeeScholarship.LastUpdatedBy;
             return(db.SaveChanges());
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }