Beispiel #1
0
        public void checkDelTour()
        {
            countries contr = new countries();

            countries.dataCountries.Rows.Add("1", "Америка");
            Countries_Col obj = new Countries_Col();

            hotels hot = new hotels();

            hotels.dataHotels.Rows.Add("1", "hotel", "****", "12000");
            HotelFactory hotelfac = new HotelFactory();

            tours formTour = new tours();

            tours.dataTours.Rows.Add("1", "tour", "VIP туры", "Россия", "True", "hotel", "Автобус", "BB", "12000", "Рубль");
            tours.dataTours.Rows.Add("2", "tour", "VIP туры", "Россия", "True", "hotel", "Автобус", "BB", "12000", "Рубль");
            tours.dataTours.Rows.Add("3", "tour", "VIP туры", "Россия", "True", "hotel", "Автобус", "BB", "12000", "Рубль");

            FoodCol      food     = new FoodCol();
            TransportCol tr       = new TransportCol();
            TourTypeCol  tourtype = new TourTypeCol();

            TourFactory factTour = new TourFactory();
            int         a        = TourFactory.count();

            TourFactory.DeleteTour(1);
            Assert.AreEqual(a - 1, TourFactory.count());
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            int num_fields = 10;

            values    = new string[num_fields];
            values[0] = textBox1.Text;
            values[1] = textBox2.Text;
            values[2] = comboBox1.Text;
            values[3] = (checkBox1.Enabled).ToString();
            values[4] = comboBox2.Text;
            values[5] = comboBox3.Text;
            values[6] = comboBox4.Text;
            values[7] = textBox3.Text;
            values[8] = textBox4.Text;
            values[9] = comboBox5.Text;

            if (check(values) == 1)
            {
                TourFactory.Add_Tour(values);
                textBox1.Text     = (Convert.ToInt32(textBox1.Text) + 1).ToString();
                textBox2.Text     = "";
                comboBox1.Text    = "";
                checkBox1.Enabled = false;
                comboBox2.Text    = "";
                comboBox3.Text    = "";
                comboBox4.Text    = "";
                textBox3.Text     = "";
                textBox4.Text     = "";
            }
        }
Beispiel #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         int code = Convert.ToInt32(textBox1.Text);
         TourFactory.DeleteTour(code);
     }
     catch
     {
         MessageBox.Show("Enter the number!");
     }
 }
Beispiel #4
0
        public void checkAddOrder()
        {
            string[] order = new string[7];
            order[0] = "225";
            order[1] = "Petr";
            order[2] = "Vasya";
            order[3] = "12 may 2013";
            order[4] = "tour";

            clients formCL = new clients();

            clients.dataClients.Rows.Add("1", "Pet", "*****@*****.**", "88-88", "12 may 1990", "true", "VIP");
            ClientTypeCol col    = new ClientTypeCol();
            ClientFactory factCl = new ClientFactory();

            managers formMan = new managers();

            managers.dataManagers.Rows.Add("1", "Petya", "8888", "Менеджер", "petya");
            ManagerTypeCol coll    = new ManagerTypeCol();
            ManagerFactory factMan = new ManagerFactory();

            orders formOrd = new orders();

            orders.dataOrders.Rows.Add("Pet", "Petya", "12 may 2015", "1", "tour1");
            orders.dataOrders.Rows.Add("Pet", "Petya", "13 may 2014", "2", "tou2");
            orders.dataOrders.Rows.Add("Pet", "Petya", "14 may 2014", "3", "tou3");

            countries contr = new countries();

            countries.dataCountries.Rows.Add("1", "Россия");
            Countries_Col obj = new Countries_Col();

            hotels hot = new hotels();

            hotels.dataHotels.Rows.Add("1", "hotel", "****", "12000");
            HotelFactory hotelfac = new HotelFactory();

            FoodCol      food     = new FoodCol();
            TransportCol tr       = new TransportCol();
            TourTypeCol  tourtype = new TourTypeCol();

            tours formTour = new tours();

            tours.dataTours.Rows.Add("1", "tour", "VIP туры", "Россия", "true", "hotel", "Автобус", "BB", "12000", "Рубль");
            TourFactory  factTour = new TourFactory();
            OrderFactory fact     = new OrderFactory();
            int          a        = OrderFactory.count();

            OrderFactory.AddOrder(order);
            Assert.AreEqual(a + 1, OrderFactory.count());
        }
Beispiel #5
0
        public void checkAddTour()
        {
            string[] tour = new string[10];
            tour[0] = "2";
            tour[1] = "tour1";
            tour[2] = "VIP туры";
            tour[3] = "true";
            tour[4] = "hotel";
            tour[5] = "Авиа";
            tour[6] = "HB";
            tour[7] = "35500";
            tour[8] = "Доллар";
            tour[9] = "Америка";

            countries contr = new countries();

            countries.dataCountries.Rows.Add("1", "Америка");
            Countries_Col obj = new Countries_Col();

            hotels hot = new hotels();

            hotels.dataHotels.Rows.Add("1", "hotel", "****", "12000");
            HotelFactory hotelfac = new HotelFactory();

            tours formTour = new tours();

            tours.dataTours.Rows.Add("1", "tour", "VIP туры", "Россия", "True", "hotel", "Автобус", "BB", "12000", "Рубль");

            FoodCol      food     = new FoodCol();
            TransportCol tr       = new TransportCol();
            TourTypeCol  tourtype = new TourTypeCol();

            TourFactory factTour = new TourFactory();
            int         a        = TourFactory.count();

            TourFactory.Add_Tour(tour);
            Assert.AreEqual(a + 1, TourFactory.count());
        }
Beispiel #6
0
 public AddTour()
 {
     InitializeComponent();
     textBox1.Text = (TourFactory.count() + 1).ToString();
 }