protected void OnTruckSelected(Truck item) { if (TruckSelected != null) { TruckSelected(this, item); } }
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(); }
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(); }