public int DeleteUserById(int Id) { masterEntities1 tstDb = new masterEntities1(); Employee usrdtl = new Employee(); usrdtl.empId = Id; tstDb.Entry(usrdtl).State = System.Data.Entity.EntityState.Deleted; int Retval = tstDb.SaveChanges(); return(Retval); }
public int UpdateUser(int Id, string FName, string LName, string Email, string Designation) { masterEntities1 tstDb = new masterEntities1(); Employee usrdtl = new Employee(); usrdtl.empId = Id; usrdtl.FName = FName; usrdtl.LName = LName; usrdtl.Email = Email; usrdtl.Designation = Designation; tstDb.Entry(usrdtl).State = System.Data.Entity.EntityState.Modified; int Retval = tstDb.SaveChanges(); return(Retval); }