private void listViewEx1_MouseClick(object sender, MouseEventArgs e)
        {
            dataPhong dtp     = new dataPhong();
            string    maphong = listViewEx1.SelectedItems[0].Text;

            if (dtp.Kiemtraphong(maphong) == 1)
            {
                ChiTietPhong.Maphong = maphong;
                ChiTietPhong phong = new ChiTietPhong();

                phong.ShowDialog();
            }
            if (dtp.Kiemtraphong(maphong) == 0)
            {
                DatPhong.MaPhong = maphong;
                DatPhong datPhong = new DatPhong();
                datPhong.ShowDialog();
            }
            TrangThaiPhong ttp = new TrangThaiPhong();

            if (dtp.Kiemtraphong(maphong) == 2)
            {
                TrangThaiPhong.trangthai = "đang dọn dẹp";
                TrangThaiPhong.maphong   = maphong;
                ttp.ShowDialog();
            }
            if (dtp.Kiemtraphong(maphong) == 3)
            {
                TrangThaiPhong.trangthai = "đang sửa chữa";
                TrangThaiPhong.maphong   = maphong;
                ttp.ShowDialog();
            }
        }
示例#2
0
        private void listViewEx1_MouseClick(object sender, MouseEventArgs e)
        {
            ChiTietPhong.Maphong = listViewEx1.SelectedItems[0].Text;
            ChiTietPhong phong = new ChiTietPhong();

            phong.ShowDialog();
            //string maphong= listViewEx1.SelectedItems[0].Text;
            //MessageBox.Show(maphong);
        }
示例#3
0
        private void listViewEx1_MouseClick(object sender, MouseEventArgs e)
        {
            dataPhong dtp     = new dataPhong();
            string    maphong = listViewEx1.SelectedItems[0].Name.ToString();
            //MessageBox.Show(maphong);
            int check = client.ktraPhong(Convert.ToInt32(maphong));

            switch (check)
            {
            case 2:
                ChiTietPhong.idP = Convert.ToInt32(maphong);
                ChiTietPhong phong = new ChiTietPhong();
                phong.ShowDialog();
                listPhong(-1);
                break;

            case 1:
                DatPhong.MaPhong = listViewEx1.SelectedItems[0].Text.ToString();;
                DatPhong.idp     = Convert.ToInt32(maphong);
                DatPhong datPhong = new DatPhong();
                datPhong.ShowDialog();
                listPhong(-1);
                break;

            case 3:
                MessageBox.Show("Phòng đang dọn dẹp");
                break;

            case 4:
                MessageBox.Show("Phòng đang sửa chữa");
                break;

            default:
                MessageBox.Show("Xảy ra lỗi xin mời thử lại");
                break;
            }

            //if(dtp.Kiemtraphong(maphong)==1)
            //{
            //    ChiTietPhong.Maphong = maphong;
            //    ChiTietPhong phong = new ChiTietPhong();

            //    phong.ShowDialog();
            //}
            //if (dtp.Kiemtraphong(maphong) == 0)
            //{
            //    DatPhong.MaPhong = maphong;
            //    DatPhong datPhong = new DatPhong();
            //    datPhong.ShowDialog();
            //}
            //TrangThaiPhong ttp = new TrangThaiPhong();
            //if (dtp.Kiemtraphong(maphong) == 2)
            //{
            //    TrangThaiPhong.trangthai = "đang dọn dẹp";
            //    TrangThaiPhong.maphong = maphong;
            //    ttp.ShowDialog();
            //}
            //if (dtp.Kiemtraphong(maphong) == 3)
            //{
            //    TrangThaiPhong.trangthai = "đang sửa chữa";
            //    TrangThaiPhong.maphong = maphong;
            //    ttp.ShowDialog();
            //}
        }