public void SaveBranch(Branch branch) { using (var dbContext = new HRDbContext()) { if (branch.ID > 0) { dbContext.Update <Branch>(branch); } else { dbContext.Insert <Branch>(branch); } } }
public void SaveStaff(Staff staff) { using (var dbContext = new HRDbContext()) { if (staff.ID > 0) { dbContext.Update <Staff>(staff); } else { dbContext.Insert <Staff>(staff); } } }