コード例 #1
0
 private void ReceiveVehicle()
 {
     this.Vehicle.Mileage   = Convert.ToInt32(this.mileage);
     this.Vehicle.TankLevel = (TankLevel)this.tank.SelectedItem;
     this.Vehicle.Receive();
     data.Update(this.Vehicle);
 }
コード例 #2
0
 protected override void SaveMaintained()
 {
     if (isNewVehicle)
     {
         Vehicle vehicle = new Vehicle(
             Form.licensePlate.Text,
             (Model)Form.model.SelectedItem,
             (Branch)Form.branch.SelectedItem,
             (TankLevel)Form.tankLevel.SelectedItem,
             Convert.ToInt32(Form.mileage.Text),
             null)
         {
             BranchId = ((Branch)Form.branch.SelectedItem).Id,
             ModelId  = ((Model)Form.model.SelectedItem).Id
         };
         VehicleData.Insert(vehicle);
     }
     else
     {
         Vehicle vehicle = Current();
         vehicle.Model     = (Model)Form.model.SelectedItem;
         vehicle.Branch    = (Branch)Form.branch.SelectedItem;
         vehicle.TankLevel = (TankLevel)Form.tankLevel.SelectedItem;
         vehicle.Mileage   = Convert.ToInt32(Form.mileage.Text);
         VehicleData.Update(vehicle);
     }
 }
コード例 #3
0
 private void RentVehicle()
 {
     this.Vehicle.Customer           = new Customer();
     this.Vehicle.Customer.FirstName = this.firstName.Text;
     this.Vehicle.Customer.LastName  = this.lastName.Text;
     this.Vehicle.Customer.DocNumber = this.documentNumber.Text;
     this.Vehicle.Customer.DocType   = this.documentType.Text;
     this.Vehicle.Rent();
     VehicleData.Update(this.Vehicle);
 }
コード例 #4
0
        private void UpdateVehicle()
        {
            Vehicle vehicle = vehicles[current];

            vehicle.Model     = (Model)this.model.SelectedItem;
            vehicle.Branch    = (Branch)this.branch.SelectedItem;
            vehicle.TankLevel = (TankLevel)this.tankLevel.SelectedItem;
            vehicle.Mileage   = Convert.ToInt32(this.mileage.Text);
            data.Update(vehicle);
        }
コード例 #5
0
 private void VehicleFromMaintenance()
 {
     Selected.FromMaintenence();
     VehicleData.Update(Selected);
 }
コード例 #6
0
 private void ChargeVehicle()
 {
     Selected.Charge();
     VehicleData.Update(Selected);
 }
コード例 #7
0
 private void HandOverVehicle()
 {
     Selected.HandOver();
     VehicleData.Update(Selected);
 }
コード例 #8
0
 private void RentVehicle()
 {
     SetExisitngCustomerProperties();
     Vehicle.Rent();
     VehicleData.Update(this.Vehicle);
 }
コード例 #9
0
 private void ChangeBranch()
 {
     vehicle.Branch = (Branch)branch.SelectedItem;
     VehicleData.Update(vehicle);
 }