예제 #1
0
 public int Insert(DelegationsDetails DelegationDetail)
 {
     try
     {
         using (var db = new HCMEntities())
         {
             db.DelegationsDetails.Add(DelegationDetail);
             db.SaveChanges();
             return(DelegationDetail.DelegationDetailID);
         }
     }
     catch
     {
         throw;
     }
 }
예제 #2
0
 public int Delete(int DelegationDetailID, int UserIdentity)
 {
     try
     {
         using (var db = new HCMEntities())
         {
             DelegationsDetails DelegationDetailObj = db.DelegationsDetails.SingleOrDefault(x => x.DelegationDetailID.Equals(DelegationDetailID));
             db.DelegationsDetails.Remove(DelegationDetailObj);
             return(db.SaveChanges(UserIdentity));
         }
     }
     catch
     {
         throw;
     }
 }