public void Update(Staff staff) { if (staff.StaffId == 0) { smartDrivingContext.Staff.Add(staff); smartDrivingContext.SaveChanges(); } else { smartDrivingContext.Entry(staff).State = EntityState.Modified; smartDrivingContext.SaveChanges(); } }
public void Update(Vehicle vehicle) { if (vehicle.VehicleId == 0) { smartDrivingContext.Vehicle.Add(vehicle); smartDrivingContext.SaveChanges(); } else { smartDrivingContext.Entry(vehicle).State = EntityState.Modified; smartDrivingContext.SaveChanges(); } }
public void Update(ActivityType activityType) { if (activityType.ActivityTypeId == 0) { smartDrivingContext.ActivityType.Add(activityType); smartDrivingContext.SaveChanges(); } else { smartDrivingContext.Entry(activityType).State = EntityState.Modified; smartDrivingContext.SaveChanges(); } }
public void Update(Customer customer) { if (customer.CustomerId == 0) { smartDrivingContext.Customer.Add(customer); smartDrivingContext.SaveChanges(); } else { smartDrivingContext.Entry(customer).State = EntityState.Modified; smartDrivingContext.SaveChanges(); } }
public void Update(BookingLog bookingLog) { if (bookingLog.BookingLogId == 0) { smartDrivingContext.BookingLog.Add(bookingLog); smartDrivingContext.SaveChanges(); } else { smartDrivingContext.Entry(bookingLog).State = EntityState.Modified; smartDrivingContext.SaveChanges(); } }
public void Update(PostalDistrict postalDistrict) { if (postalDistrict.PostalDistrictId == 0) { smartDrivingContext.PostalDistrict.Add(postalDistrict); smartDrivingContext.SaveChanges(); } else { smartDrivingContext.Entry(postalDistrict).State = EntityState.Modified; smartDrivingContext.SaveChanges(); } }