Exemple #1
0
 private void RequestBtn_Click(object sender, EventArgs e)
 {
     if (listService.SelectedIndex == -1)
     {
         MessageBox.Show("Select a services");
     }
     else
     {
         if (listService.SelectedIndex == 0)
         {
             _testingStation.AddService(new ServiceWrap("WoF inspection", 50.00M));
             TestingStation.AddToTotal(_testingStation.TopOfServicesList().GetServicePrice());
             UpdateDetailsList(_testingStation.TopOfServicesList());
         }
         if (listService.SelectedIndex == 1)
         {
             _testingStation.AddService(new ServiceWrap("Modified vehicle check-up:", 200.00M));
             TestingStation.AddToTotal(_testingStation.TopOfServicesList().GetServicePrice());
             UpdateDetailsList(_testingStation.TopOfServicesList());
         }
         if (listService.SelectedIndex == 2)
         {
             _testingStation.AddService(new ServiceWrap("Pre-purchase inspection", 150.00M));
             TestingStation.AddToTotal(_testingStation.TopOfServicesList().GetServicePrice());
             UpdateDetailsList(_testingStation.TopOfServicesList());
         }
         if (listService.SelectedIndex == 3)
         {
             _testingStation.AddService(new ServiceWrap("Certificate of Fitness", 210.00M));
             TestingStation.AddToTotal(_testingStation.TopOfServicesList().GetServicePrice());
             UpdateDetailsList(_testingStation.TopOfServicesList());
         }
         UpdateTotalCount();
         UpdateTotalCost();
     }
 }
Exemple #2
0
 void UpdateTotalCount()
 {
     lblCount.Text = TestingStation.TotalNumberOfServices().ToString();
 }
Exemple #3
0
 void UpdateTotalCost()
 {
     lblTotalPrice.Text = TestingStation.GetTotalPrice().ToString();
 }
Exemple #4
0
 void DisplayTestingStationDetails()
 {
     _testingStation = new TestingStation("1/20 Te West Road, Albany", "026 475 21823", "VTNZ Testing Station");
     lblHeader.Text  = _testingStation.GetStationDetails();
 }