private void btnCheckout_Click(object sender, EventArgs e) { int check = checkRoomState(); if (check == 1)//Đang sử dụng -> checkout { HomeForm hf = HomeForm.Instance(); CheckOutForm cof = CheckOutForm.Instance(); if (!hf.panel3.Controls.Contains(cof)) { hf.panel3.Controls.Add(cof); cof.Dock = DockStyle.Fill; cof.BringToFront(); cof.Visible = true; cof.lblRoom.Text = lblRoom.Text.ToString(); cof.lblRoomType.Text = lblRoomType.Text.ToString(); cof.lblOccupancy.Text = lblPCount.Text.ToString(); cof.lblCurrentPeopleCount.Text = lblCurrentP.Text.ToString(); CheckOutForm._instance.getCheckinDay(); CheckOutForm._instance.getTransID(); CheckOutForm._instance.load_All(); CheckOutForm._instance.txtCASH.Clear(); CheckOutForm._instance.txtChanges.Clear(); this.Hide(); } else { cof.BringToFront(); cof.Visible = true; cof.lblRoom.Text = lblRoom.Text.ToString(); cof.lblRoomType.Text = lblRoomType.Text.ToString(); cof.lblOccupancy.Text = lblPCount.Text.ToString(); cof.lblCurrentPeopleCount.Text = lblCurrentP.Text.ToString(); CheckOutForm._instance.getCheckinDay(); CheckOutForm._instance.getTransID(); CheckOutForm._instance.load_All(); CheckOutForm._instance.txtCASH.Clear(); CheckOutForm._instance.txtChanges.Clear(); this.Hide(); } } else if (check == 2) //đã đặt trước ->không được checkout { MessageBox.Show("Phòng đã đặt trước!!!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { MessageBox.Show("Phòng trống!!!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } }
private void btnCheckOut_Click(object sender, EventArgs e) { if (!panel3.Controls.Contains(CheckOutForm.Instance())) { panel3.Controls.Add(CheckOutForm._instance); CheckOutForm._instance.Dock = DockStyle.Fill; CheckOutForm._instance.BringToFront(); CheckOutForm._instance.Visible = true; } CheckOutForm._instance.BringToFront(); CheckOutForm._instance.Visible = true; }
private void btnUpdate_Click(object sender, EventArgs e) { update_Guest(); GuestListForm.Instance().load_GuestList(); CheckOutForm.Instance().load_All(); }