Ejemplo n.º 1
0
 public int Insert(EndOfServices EndOfService)
 {
     try
     {
         using (var db = new HCMEntities())
         {
             db.EndOfServices.Add(EndOfService);
             db.SaveChanges();
             return(EndOfService.EndOfServiceID);
         }
     }
     catch (DbEntityValidationException e)
     {
         foreach (var eve in e.EntityValidationErrors)
         {
             Console.WriteLine("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:", eve.Entry.Entity.GetType().Name, eve.Entry.State);
             foreach (var ve in eve.ValidationErrors)
             {
                 Console.WriteLine("- Property: \"{0}\", Error: \"{1}\"", ve.PropertyName, ve.ErrorMessage);
             }
         }
         throw;
     }
     catch
     {
         throw;
     }
 }
Ejemplo n.º 2
0
 public int Delete(int EndOfServiceID, int UserIdentity)
 {
     try
     {
         using (var db = new HCMEntities())
         {
             EndOfServices EndOfServiceObj = db.EndOfServices.SingleOrDefault(x => x.EndOfServiceID.Equals(EndOfServiceID));
             db.EndOfServices.Remove(EndOfServiceObj);
             return(db.SaveChanges(UserIdentity));
         }
     }
     catch
     {
         throw;
     }
 }
Ejemplo n.º 3
0
 public int UpdateIsProcess(EndOfServices EOS)
 {
     try
     {
         using (var db = new HCMEntities())
         {
             EndOfServices Obj = db.EndOfServices.FirstOrDefault(x => x.EndOfServiceID.Equals(EOS.EndOfServiceID));
             Obj.isProcessed     = EOS.isProcessed;
             Obj.LastUpdatedDate = EOS.LastUpdatedDate;
             Obj.LastUpdatedBy   = EOS.LastUpdatedBy;
             return(db.SaveChanges());
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 4
0
 public int Update(EndOfServices EndOfService)
 {
     try
     {
         using (var db = new HCMEntities())
         {
             EndOfServices EndOfServiceObj = db.EndOfServices.SingleOrDefault(x => x.EndOfServiceID.Equals(EndOfService.EndOfServiceID));
             EndOfServiceObj.EmployeeCareerHistoryID  = EndOfService.EmployeeCareerHistoryID;
             EndOfServiceObj.EndOfServiceDate         = EndOfService.EndOfServiceDate;
             EndOfServiceObj.EndOfServiceDecisionNo   = EndOfService.EndOfServiceDecisionNo;
             EndOfServiceObj.EndOfServiceDecisionDate = EndOfService.EndOfServiceDecisionDate;
             EndOfServiceObj.EndOfServiceReasonID     = EndOfService.EndOfServiceReasonID;
             EndOfServiceObj.LastUpdatedDate          = DateTime.Now;
             EndOfServiceObj.LastUpdatedBy            = EndOfService.LastUpdatedBy;
             return(db.SaveChanges());
         }
     }
     catch
     {
         throw;
     }
 }