private void button2_Click(object sender, EventArgs e)
        {
            string Brand = ""; string Model = ""; string RegistrationNumber = ""; short NumberOfSeats = 1;

            try
            {
                Brand = txtBrand.Text;
                Model = txtModel.Text;
                RegistrationNumber = txtRegistrationNumber.Text;
                NumberOfSeats      = Convert.ToInt16(txtNumberOfSeats.Text);
                SuperVisorCar superV = new SuperVisorCar();
                superV.AddCar(Brand, Model, RegistrationNumber, NumberOfSeats);
                refreshCarList();
            }
            catch (FormatException ee)

            {
                //    ee.ToString();

                //  MessageBox.Show("błędne dane");


                /*
                 * var boxes = gbAddCar.Controls.OfType<TextBox>();
                 * foreach (var box in boxes)
                 * {
                 * errorProvAdm.SetError(box, "błąd danych");
                 * }
                 */
                MessageBox.Show(ee.Message);
            }
            catch
            {
            }
        }
Exemplo n.º 2
0
        public void checkNumberOfSeatsValueTest4()
        {
            superVisorCar = new SuperVisorCar();
            numberOfSeats = 4;
            bool actual;

            actual = superVisorCar.checkNumberOfSeatsValue(numberOfSeats);

            expected = true;

            Assert.AreEqual(actual, expected);
            //Assert.Fail();
        }
 private void button1_Click_2(object sender, EventArgs e)
 {
     if (dataGridViewCars.SelectedRows.Count > 0)
     {
         Cars          cars   = (Cars)dataGridViewCars.SelectedRows[0].DataBoundItem;
         SuperVisorCar sVisor = new SuperVisorCar();
         sVisor.deleteCar(cars);
     }
     else
     {
         MessageBox.Show("Zaznacz wiersz na liście poniżej w celu usunięcia samochodu");
     }
     refreshCarList();
 }
Exemplo n.º 4
0
 public void TestInitialize()
 {
     superVisorCar = new SuperVisorCar();
 }