public void showhoadon(string maban, string tinhtrang)
        {
            hoadonBUS hd = new hoadonBUS();
            DataTable dt = new DataTable();

            dt = hd.getallhoadon(maban, tinhtrang);
            dataGridView2.DataSource = null;
            dataGridView2.DataSource = dt;
        }
        private void myListView_Click(object sender, EventArgs e)
        {
            a = myListView.SelectedItems[0].Text;
            b = myListView.SelectedItems[0].SubItems[1].Text;

            if (a.Length > 13)
            {
                labelTable.Text = a.ToString().Substring(0, 12) + "...";
            }
            else
            {
                labelTable.Text = a.ToString();
            }
            if (bban.check_ban(b.ToString()) == 0)
            {
                dataGridView2.DataSource   = null;
                buttonUpdate.Text          = "phục vụ";
                buttonUpdate.Enabled       = true;
                buttonCancel.Enabled       = false;
                buttonPay.Enabled          = false;
                buttonPrintBill.Enabled    = false;
                buttonChangerTable.Enabled = false;
                labeltbhoadon.Visible      = true;
                labelIDBill.Text           = "-----";
                butt_update = 0;
            }
            else if (bban.check_ban(b.ToString()) == 1)
            {
                buttonUpdate.Text       = "Đang phục vụ";
                buttonUpdate.Enabled    = false;
                buttonCancel.Enabled    = true;
                buttonPay.Enabled       = true;
                buttonPrintBill.Enabled = true;
                labeltbhoadon.Visible   = false;
                butt_update             = 1;
                showhoadon(b.ToString(), bban.check_ban(b.ToString()).ToString());
                hoadonBUS hd = new hoadonBUS();
                labelIDBill.Text = hd.getsmahoadon(b.ToString(), "1");
            }
            else
            {
                buttonUpdate.Text       = "Được Đặt trước";
                buttonUpdate.Enabled    = false;
                buttonCancel.Enabled    = true;
                buttonPay.Enabled       = true;
                buttonPrintBill.Enabled = true;
                labeltbhoadon.Visible   = false;
                butt_update             = -1;
            }
        }
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            if (butt_update == 0)
            {
                hoadonBUS hd = new hoadonBUS();
                hd.laphoadon(DateTime.Now.ToString("yyyyMMddThhmmss").Trim(), myListView.SelectedItems[0].SubItems[1].Text);
                labelIDBill.Text      = DateTime.Now.ToString("yyyyMMddThhmmss").Trim();
                labeltbhoadon.Visible = false;
                buttonUpdate.Text     = b.ToString();
                bban.capnhattinhtrangban("1", b.ToString());

                showhoadon(b.ToString(), bban.check_ban(b.ToString()).ToString());
                showlistview();
            }
        }