public void Delete(int id) { VehicleItems vehicleitem = context.VehicleItems.Find(id); context.VehicleItems.Remove(vehicleitem); context.SaveChanges(); }
public void SaveVehicle(int vehicleId, int?translogId) { VehicleItems vi = new VehicleItems(); vi.VehicleId = vehicleId; vi.TransactionLogId = translogId; veItemRepo.Save(vi); }
public void Save(VehicleItems vehicleitem) { if (vehicleitem.Id == 0) { context.VehicleItems.Add(vehicleitem); } else { VehicleItems dbEntry = context.VehicleItems.Find(vehicleitem.Id); if (dbEntry != null) { dbEntry.VehicleId = vehicleitem.VehicleId; dbEntry.TransactionLogId = vehicleitem.TransactionLogId; } } context.SaveChanges(); }