public int Insert(DelegationsDetails DelegationDetail) { try { using (var db = new HCMEntities()) { db.DelegationsDetails.Add(DelegationDetail); db.SaveChanges(); return(DelegationDetail.DelegationDetailID); } } catch { throw; } }
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; } }