Пример #1
0
        public void LoadCarInspections()
        {
            CarInspection _WoF   = new CarInspection("WoF Inspection", 50);
            CarInspection _MVC   = new CarInspection("Modified Vehicle Checkup", 200);
            CarInspection _PPI   = new CarInspection("Pre-purchase Inspection", 150);
            CarInspection _VRego = new CarInspection("Vehicle Registration", 210);

            _VTNZ.addService(_WoF);
            _VTNZ.addService(_MVC);
            _VTNZ.addService(_PPI);
            _VTNZ.addService(_VRego);
        }
Пример #2
0
        private void buttonRequestInspection_Click(object sender, EventArgs e)
        {
            List <CarInspection> _displayServices = _VTNZ.GetService();
            CarInspection        _carInspection   = new CarInspection();

            if (listBoxInspections.SelectedIndex == -1)
            {
                MessageBox.Show("Select a service", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                _count++;
                labelMessage.Show();
                labelDetails.Show();
                labelTotalPrice.Show();
                labelInspectionCount.Show();
                labelMessage.Text = "Select the inspection type";

                if (listBoxInspections.SelectedIndex == 0)
                {
                    _carInspection = _displayServices[3];
                }

                if (listBoxInspections.SelectedIndex == 1)
                {
                    _carInspection = _displayServices[2];
                }

                if (listBoxInspections.SelectedIndex == 2)
                {
                    _carInspection = _displayServices[1];
                }

                if (listBoxInspections.SelectedIndex == 3)
                {
                    _carInspection = _displayServices[0];
                }

                _price += _carInspection.CarInspectionPrice;
                labelTotalPrice.Text      = _price.ToString("C");
                labelInspectionCount.Text = _count.ToString();
                labelDetails.Text        += _VTNZ.ShowServiceDetails(_carInspection) + Environment.NewLine;
            }
        }
Пример #3
0
 public ServiceWrapper(string name, decimal price)
 {
     _carInspection = new CarInspection();
     _carInspection.CarInspectionName  = name;
     _carInspection.CarInspectionPrice = price;
 }