コード例 #1
0
ファイル: FrmMain.cs プロジェクト: nhanph16/QLKhachSan
        private void menuKhachHang_Click(object sender, EventArgs e)
        {
            FrmCustomer FCus = new FrmCustomer();

            FCus.btChonPhong.Visible = false;
            FCus.ShowDialog();
        }
コード例 #2
0
ファイル: FrmMain.cs プロジェクト: nhanph16/QLKhachSan
        private void menuThuePhong_Click(object sender, EventArgs e)
        {
            FrmCustomer FCus = new FrmCustomer();

            FCus.MaNV = MaNV;
            FCus.btChonPhong.Visible = true;
            FCus.ShowDialog();
        }
コード例 #3
0
        private void Bt_Click(object sender, EventArgs e)
        {
            Button bt      = (Button)sender;
            int    MaPhong = int.Parse(bt.Text[0].ToString());

            if (bt.BackColor == Color.LightBlue)
            {
                bool available           = false;
                List <ChiTietPhong> list = db.ChiTietPhongs.Where(c => c.MaPhong == MaPhong).ToList();
                foreach (ChiTietPhong item in list)
                {
                    if (item.TrangThaiPhong == true)
                    {
                        available = true;
                    }
                }
                if (available == true)
                {
                    MessageBox.Show("Phòng đang bận");
                }
                else
                {
                    FrmCustomer FCus = new FrmCustomer();
                    FCus.MaNV                = MaNV;
                    FCus.MaPhong             = int.Parse(bt.Text[0].ToString());
                    FCus.btChonPhong.Visible = true;
                    FCus.ShowDialog();
                    db = new LINQDataContext();
                }
            }
            if (bt.BackColor == Color.LightGreen)
            {
                List <ChiTietPhong> list = db.ChiTietPhongs.Where(c => c.MaPhong == MaPhong).ToList();
                foreach (ChiTietPhong item in list)
                {
                    if (item.TrangThaiPhong == true)
                    {
                        FrmThanhToan frm = new FrmThanhToan();
                        frm.ChiTiet = item;
                        frm.MaNV    = MaNV;
                        frm.ShowDialog();
                        db = new LINQDataContext();
                    }
                }
            }
        }