private void ButtonChangeState_Click(object sender, EventArgs e) { FormExistCustomer formExistCustomer = new FormExistCustomer(r_GarageManager); formExistCustomer.ShowDialog(); if (formExistCustomer.DialogResult == DialogResult.OK) { FormVehicleStates formVehicleStates = new FormVehicleStates("Change", formExistCustomer.CustomerToTreat, r_GarageManager); formVehicleStates.ShowDialog(); } }
private void ButtonAirBlowing_Click(object sender, EventArgs e) { FormExistCustomer formExistCustomer = new FormExistCustomer(r_GarageManager); formExistCustomer.ShowDialog(); if (formExistCustomer.DialogResult == DialogResult.OK) { r_GarageManager.BlowVehicleWheels(formExistCustomer.CustomerToTreat); StringBuilder message = new StringBuilder(); message.AppendLine($"{formExistCustomer.CustomerToTreat.Name} Wheels blowed succesfully!"); string title = "Blowing Wheels"; MessageBox.Show(message.ToString(), title); } }
private void ButtonChargeVehicle_Click(object sender, EventArgs e) { FormExistCustomer formExistCustomer = new FormExistCustomer(r_GarageManager); formExistCustomer.ShowDialog(); if (formExistCustomer.DialogResult == DialogResult.OK) { if (r_GarageManager.IsElectricEngine(formExistCustomer.CustomerToTreat) == true) { FormAddEnergy formAddEnergy = new FormAddEnergy(eEnergyType.Electric, formExistCustomer.CustomerToTreat, r_GarageManager); formAddEnergy.ShowDialog(); } else { string message = "Vehicle engine is not support this action."; string title = "Garage notification"; MessageBox.Show(message, title); } } }
private void ButtonShowCutomerCard_Click(object sender, EventArgs e) { FormExistCustomer formExistCustomer = new FormExistCustomer(r_GarageManager); formExistCustomer.ShowDialog(); if (formExistCustomer.DialogResult == DialogResult.OK) { string title = "Customer details"; CustomerCard CustomerToTreat = formExistCustomer.CustomerToTreat; List <string> vehicleDetails = CustomerToTreat.Vehicle.GetDetails(); StringBuilder cusotmerDetails = new StringBuilder(); cusotmerDetails.AppendLine($"Customer name: {CustomerToTreat.Name}\n"); cusotmerDetails.AppendLine($"Vehicle state: {CustomerToTreat.VehicleState.ToString()}\n"); foreach (string detail in vehicleDetails) { cusotmerDetails.AppendLine(detail + "\n"); } MessageBox.Show(cusotmerDetails.ToString(), title); } }