public static void editServiceEvent(ServiceEvent serviceEvent) { BasicVehicleDbContext db = new BasicVehicleDbContext(); db.Entry(serviceEvent).State = EntityState.Modified; db.SaveChanges(); }
public static void editVehicle(Vehicle vehicle) { BasicVehicleDbContext db = new BasicVehicleDbContext(); db.Entry(vehicle).State = EntityState.Modified; db.SaveChanges(); }
public static void createServiceEvent(ServiceEvent serviceEvent) { BasicVehicleDbContext db = new BasicVehicleDbContext(); db.Entry(serviceEvent).State = EntityState.Added; db.ServiceEvents.Add(serviceEvent); db.SaveChanges(); }
public static void deleteServiceEvent(ServiceEvent serviceEvent) { BasicVehicleDbContext db = new BasicVehicleDbContext(); db.Entry(serviceEvent).State = EntityState.Deleted; db.ServiceEvents.Remove(serviceEvent); db.SaveChanges(); }
public static void createVehicle(Vehicle vehicle) { BasicVehicleDbContext db = new BasicVehicleDbContext(); db.Entry(vehicle).State = EntityState.Added; db.Vehicles.Add(vehicle); db.SaveChanges(); }
public static void deleteVehicle(Vehicle vehicle) { BasicVehicleDbContext db = new BasicVehicleDbContext(); db.Entry(vehicle).State = EntityState.Deleted; db.Vehicles.Remove(vehicle); db.SaveChanges(); }