コード例 #1
0
        public void Delete(int id)
        {
            VehicleItems vehicleitem = context.VehicleItems.Find(id);

            context.VehicleItems.Remove(vehicleitem);

            context.SaveChanges();
        }
コード例 #2
0
        public void SaveVehicle(int vehicleId, int?translogId)
        {
            VehicleItems vi = new VehicleItems();

            vi.VehicleId        = vehicleId;
            vi.TransactionLogId = translogId;

            veItemRepo.Save(vi);
        }
コード例 #3
0
        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();
        }