예제 #1
0
 private void BtnSeenBill_Click(object sender, EventArgs e)
 {
     if (comboboxID.Text != string.Empty)
     {
         if (!txbStatusRoom.Text.Contains("Ch"))
         {
             fPrintBill.SetPrintBill(int.Parse(comboboxID.Text), txbDateCreate.Text);
             fPrintBill.ShowDialog();
         }
         else
         {
             MessageBox.Show("Hoá đơn chưa thanh toán\nBạn không có quyền truy cập", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
 }
        private void btnPayAlll_Click(object sender, EventArgs e)
        {
            Room room = flowLayoutRooms.Tag as Room;

            if (MessageBox.Show("Bạn có chắc chắn thanh toán cho " + room.Name + " không?", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                int idBill = BillDAO.Instance.GetIdBillFromIdRoom(room.Id);
                Pay(idBill, int.Parse(numericUpDown1.Value.ToString()));
                // ReportDAO.Instance.InsertReport(idBill);
                MessageBox.Show("Thanh toán thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Hide();
                fPrintBill fPrintBill = new fPrintBill(room.Id, idBill);
                fPrintBill.ShowDialog();
                this.Show();
                LoadListFullRoom();
                listViewBillRoom.Items.Clear();
                listViewUseService.Items.Clear();
            }
        }