private void ReceiveVehicle() { this.Vehicle.Mileage = Convert.ToInt32(this.mileage); this.Vehicle.TankLevel = (TankLevel)this.tank.SelectedItem; this.Vehicle.Receive(); data.Update(this.Vehicle); }
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); } }
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); }
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); }
private void VehicleFromMaintenance() { Selected.FromMaintenence(); VehicleData.Update(Selected); }
private void ChargeVehicle() { Selected.Charge(); VehicleData.Update(Selected); }
private void HandOverVehicle() { Selected.HandOver(); VehicleData.Update(Selected); }
private void RentVehicle() { SetExisitngCustomerProperties(); Vehicle.Rent(); VehicleData.Update(this.Vehicle); }
private void ChangeBranch() { vehicle.Branch = (Branch)branch.SelectedItem; VehicleData.Update(vehicle); }