private void button1_Click(object sender, EventArgs e)
        {
            tmp = new List <Usluga>();
            foreach (Usluga x in checkedListBox1.CheckedItems)
            {
                tmp.Add(x);
            }
            try
            {
                HotelContinental.EmptyBox(comboBox1);
                RoomBooked(comboBox1.SelectedItem as Pokoj);
                Klient k = new Klient(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text);
                frm1.hotel.lista_klientow.Add(k);
                k.Rezerwuj((Pokoj)comboBox1.SelectedItem, numericUpDown1.Value);
                k.DodajUslugi(tmp);
                MessageBox.Show(k.Paragon());
            }
            catch (ExceptionEmptyBox)
            {
                MessageBox.Show("Proszę wybrać pokój");
            }

            catch (ExceptionRoomBooked)
            {
                MessageBox.Show("Pokój zajęty. Proszę wybrać inny.");
            }
        }
示例#2
0
 public Form1()
 {
     InitializeComponent();
     hotel = new HotelContinental();
     hotel.lista_pracownikow.Add(new Pracownik("Charon", "Reddick", "9995553333", "*****@*****.**", Pracownik.Stanowisko.Recepcjonista));
     hotel.lista_pracownikow.Add(new Pracownik("John", "Wick", "9995553333", "*****@*****.**", Pracownik.Stanowisko.Sprzątaczka));
     hotel.lista_uslug.Add(new Usluga("Open Bar", 66.12));
     hotel.lista_uslug.Add(new Usluga("Basen", 10.50));
     hotel.lista_uslug.Add(new Usluga("Siłownia", 30.55));
     hotel.lista_uslug.Add(new Usluga("Sejf", 60.01));
     hotel.lista_uslug.Add(new Usluga("Budzenie", 6.77));
     hotel.lista_pokoi.Add(new Pokoj("1", 50.01));
     hotel.lista_pokoi.Add(new Pokoj("2", 1140.99));
     hotel.lista_pokoi.Add(new Pokoj("3", 32.99));
     hotel.lista_pokoi.Add(new Pokoj("4", 41.99));
     hotel.lista_pokoi.Add(new Pokoj("5", 31.99));
     hotel.lista_pokoi.Add(new Pokoj("6", 30.99));
     hotel.lista_klientow.Add(new Klient("Arnold", "Hochland", "333-441-343", "*****@*****.**"));
     hotel.lista_klientow[0].Rezerwuj(hotel.lista_pokoi[1], 5);
 }
示例#3
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         HotelContinental.EmptyBox(comboBox1);
         frm1.hotel.lista_pracownikow.Add(new Pracownik(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, (Pracownik.Stanowisko)comboBox1.SelectedItem));
         listView1.Items.Clear();
         foreach (var x in frm1.hotel.lista_pracownikow)
         {
             var row = new string[] { x.imie + " " + x.nazwisko, x.numer_telefonu, x.email, (x.stanowisko).ToString() };
             var a   = new ListViewItem(row);
             a.Tag = x;
             listView1.Items.Add(a);
         }
     }
     catch (ExceptionEmptyBox)
     {
         MessageBox.Show("Proszę wybrać stanowisko");
     }
 }