Ejemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (lblStatus.ForeColor == Color.Red && lbltable.Text != "" && lbltable.Text != null)
     {
         con = new Connect();
         DataTable dt = new DataTable();
         dt = con.ExecStoreTable("RES_Select_BillID", new string[] { "@idtable" }, new object[] { Idtable(lbltable.Text) });
         int        billid     = Convert.ToInt32(dt.Rows[0].ItemArray[0].ToString());
         int        kq         = con.xulydulieu("Update R_Bill set DateEnd=getdate() where ID='" + billid + "'");
         BillDetail billdetail = new BillDetail(billid, userid);
         billdetail.passControl = new BillDetail.PassControl(GetNewControl);
         DialogResult dr = billdetail.ShowDialog(this);
         if (dr == DialogResult.Cancel)
         {
             billdetail.Close();
         }
         else if (dr == DialogResult.OK)
         {
             billdetail.Close();
         }
     }
     else
     {
         MessageBox.Show("Bạn chưa chọn bàn thanh toán!");
     }
 }
Ejemplo n.º 2
0
 private void MenuOpenPO_Click(object sender, EventArgs e)
 {
     try
     {
         ToolStripMenuItem idd10 = sender as ToolStripMenuItem;
         int          id         = Convert.ToInt32(idd10.Name);
         BillDetail   billdetail = new BillDetail(id, userid);
         DialogResult dr         = billdetail.ShowDialog(this);
         if (dr == DialogResult.Cancel)
         {
             billdetail.Close();
         }
         else if (dr == DialogResult.OK)
         {
             billdetail.Close();
         }
     }
     catch (Exception ex)
     { throw ex; }
 }
 private void button2_Click(object sender, EventArgs e)
 {
     if (lblBillID.Text == "" || lblBillID.Text == null)
     {
         MessageBox.Show("Bạn chưa chọn hóa đơn", "Notice!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     else
     {
         con = new Connect();
         con.Ghilog("Xem chi tiết hóa đơn xuất số:'" + lblBillID.Text.Trim() + "'", userid1);
         BillDetail billdetail = new BillDetail(Convert.ToInt32(lblBillID.Text), userid1);
         //PrintPreview printbill = new PrintPreview(Convert.ToInt32(lblBillID.Text));
         DialogResult dr = billdetail.ShowDialog(this);
         if (dr == DialogResult.Cancel)
         {
             billdetail.Close();
         }
         else if (dr == DialogResult.OK)
         {
             billdetail.Close();
         }
     }
 }