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);
 }
예제 #2
0
 static void CreateDataServices()
 {
     vehicleData = new VehicleData();
     vehicleData.ConnectionStringSettings = connectionStringSettings;
     modelData = new ModelData();
     modelData.ConnectionStringSettings = connectionStringSettings;
     categoryData = new CategoryData();
     categoryData.ConnectionStringSettings = connectionStringSettings;
     branchData = new BranchData();
     branchData.ConnectionStringSettings = connectionStringSettings;
 }
예제 #3
0
        private void display_Click(object sender, EventArgs e)
        {
            this.fleetViewGrid.Rows.Clear();
            this.vehicles = VehicleData.GetByCriteria(
                this.cboOperational.Text.Equals("All") ? null : (Nullable <Operational>) this.cboOperational.SelectedItem,
                this.cboAvailable.Text.Equals("All") ? null : (Nullable <RentalState>) this.cboAvailable.SelectedItem,
                (this.cboBranch.Text.Equals("All") ? null : (Nullable <Int32>)(this.cboBranch.SelectedValue)),
                (this.cboCategory.Text.Equals("All") ? null : (Nullable <Int32>)(this.cboCategory.SelectedValue)));

            this.fleetViewGrid.Rows.Clear();
            FillGrid();
        }
 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);
         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);
     }
 }
예제 #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);
 }
 private void RentVehicle()
 {
     SetExisitngCustomerProperties();
     Vehicle.Rent();
     VehicleData.Update(this.Vehicle);
 }
예제 #9
0
 private void ChangeBranch()
 {
     vehicle.Branch = (Branch)branch.SelectedItem;
     VehicleData.Update(vehicle);
 }
 protected override void CreateData()
 {
     this.data = new VehicleData();
 }
 protected override void DeleteMaintained()
 {
     VehicleData.Delete(Current());
 }