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