예제 #1
0
        private void label3_Click(object sender, EventArgs e)
        {
            Label    pb = (Label)sender;
            RoomForm rf = new RoomForm(HotelName, pb.Text);

            rf.Show();
        }
예제 #2
0
        private void pictureBox7_Click(object sender, EventArgs e)
        {
            PictureBox pb = (PictureBox)sender;
            RoomForm   rf = new RoomForm(HotelName, pb.Tag.ToString());

            rf.Show();
        }
예제 #3
0
        private void pictureBox7_Click(object sender, EventArgs e)
        {
            PictureBox pb = (PictureBox)sender;
            RoomForm   rf = new RoomForm(pb.Tag.ToString());

            Controls.Clear();
            Controls.Add(rf);
            rf.Dock = DockStyle.Fill;
        }
예제 #4
0
        private void label3_Click(object sender, EventArgs e)
        {
            Label    pb = (Label)sender;
            RoomForm rf = new RoomForm(pb.Tag.ToString());

            Controls.Clear();
            Controls.Add(rf);
            rf.Dock = DockStyle.Fill;
        }
예제 #5
0
        /// <summary>
        /// Выбор узла дерева
        /// </summary>
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            #region Выбран город
            if (e.Node.Level == 0 && e.Node.Text == "Города" ||
                e.Node.Level == 1 && e.Node.Parent.Text == "Города")
            {
                HotelList listUC = new HotelList();
                listUC.Dock = DockStyle.Fill;
                panel1.Controls.Clear();
                panel1.Controls.Add(listUC);
            }
            #endregion

            #region Выбрана гостиница
            else if (e.Node.Level == 2 &&
                     e.Node.Parent.Parent.Text == "Города")
            {
                HotelForm listUC = new HotelForm(e.Node.Tag.ToString());
                listUC.Dock = DockStyle.Fill;
                panel1.Controls.Clear();
                panel1.Controls.Add(listUC);
            }
            #endregion

            #region Выбрана комната
            else if (e.Node.Level == 3 &&
                     e.Node.Parent.Parent.Parent.Text == "Города")
            {
                RoomForm listUC = new RoomForm(e.Node.Tag.ToString());
                listUC.Dock = DockStyle.Fill;
                panel1.Controls.Clear();
                panel1.Controls.Add(listUC);
            }
            #endregion

            #region Выбрана админка
            else if (e.Node.Level == 0 && e.Node.Text == "Админка")
            {
                AdminForm listUC = new AdminForm();
                listUC.Dock = DockStyle.Fill;
                panel1.Controls.Clear();
                panel1.Controls.Add(listUC);
            }
            else if (e.Node.Level == 1 &&
                     e.Node.Parent.Text == "Админка" &&
                     e.Node.Text == "Гостиницы")
            {
                AdminHotelsForm listUC = new AdminHotelsForm();
                listUC.Dock = DockStyle.Fill;
                panel1.Controls.Clear();
                panel1.Controls.Add(listUC);
            }
            else if (e.Node.Level == 1 &&
                     e.Node.Parent.Text == "Админка" &&
                     e.Node.Text == "Комнаты")
            {
                AdminRoomsForm listUC = new AdminRoomsForm();
                listUC.Dock = DockStyle.Fill;
                panel1.Controls.Clear();
                panel1.Controls.Add(listUC);
            }
            else if (e.Node.Level == 1 &&
                     e.Node.Parent.Text == "Админка" &&
                     e.Node.Text == "Бронирования")
            {
                Admin.AdminBookingForm listUC = new Admin.AdminBookingForm();
                listUC.Dock = DockStyle.Fill;
                panel1.Controls.Clear();
                panel1.Controls.Add(listUC);
            }
            else if (e.Node.Level == 1 &&
                     e.Node.Parent.Text == "Админка" &&
                     e.Node.Text == "Ошибки")
            {
                Admin.AdminLogForm listUC = new Admin.AdminLogForm();
                listUC.Dock = DockStyle.Fill;
                panel1.Controls.Clear();
                panel1.Controls.Add(listUC);
            }
            else if (e.Node.Level == 1 &&
                     e.Node.Parent.Text == "Админка" &&
                     e.Node.Text == "Пользователи")
            {
                AdminUsersForm listUC = new AdminUsersForm();
                listUC.Dock = DockStyle.Fill;
                panel1.Controls.Clear();
                panel1.Controls.Add(listUC);
            }
            #endregion
        }