protected void OnTruckSelected(Truck item)
 {
     if (TruckSelected != null)
     {
         TruckSelected(this, item);
     }
 }
示例#2
0
        public void Edit(Truck truck)
        {
            var currentTruck = this.GetById(truck.Id);

            currentTruck.Description = truck.Description;
            currentTruck.NumberPlate = truck.NumberPlate;

            Uow.Trucks.Edit(currentTruck);
            Uow.Commit();
        }
示例#3
0
        public void Create(Truck truck)
        {
            if (!IsNumberPlateAvailable(truck.NumberPlate, truck.Id))
            {
                throw new ApplicationException("Un camion con la misma patente ya ha sido creado");
            }

            Uow.Trucks.Add(truck);
            Uow.Commit();
        }