Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            DateTime date = DateTime.Now;

            Class.cTable table = new Class.cTable();
            table.book(Convert.ToInt32(id));
            Class.insert_invoice inv = new Class.insert_invoice();

            string s = date.ToString("yyyy-MM-dd");

            inv.Insert(s, user, "0", "0", "0", "0", "0", "0", "0", table_order);
            msg = "1";
            this.Close();
        }
Ejemplo n.º 2
0
        protected void Payment_print()
        {
            if (dataGridView2.RowCount > 1)
            {
                if (txtPay.Text != "" && txtTotal.Text != "")
                {
                    double pp = Convert.ToDouble(txtPay.Text);
                    double tt = Convert.ToDouble(txtAmount.Text);
                    if (tt > pp)
                    {
                        // MessageBox.Show(" Enter payment ");
                        pic_alert.Show();
                    }
                    else
                    {
                        Class.cOrder_detial order = new Class.cOrder_detial();

                        messange.voidInvoice msg = new messange.voidInvoice();
                        msg.txtMSG.Text = " Do you want to print invoice";
                        msg.ShowDialog();
                        if (msg.vale == "1")
                        {
                            DateTime             date__ = DateTime.Now; // Or whatever
                            string               s      = date__.ToString("yyyy-MM-dd");
                            Class.insert_invoice inv    = new Class.insert_invoice();
                            inv.Update(Convert.ToInt16(txtInvo.Text), s, ID_USER, txtTotal.Text, txtDiscount.Text, txtPay.Text, txtBack.Text, txtAmount.Text, txtReal.Text, txt_cash_discount.Text);
                            fThankyou thx = new fThankyou();
                            thx.ShowDialog();

                            report.printInvoice print = new report.printInvoice();
                            print.invID   = txtInvo.Text;
                            print.Cashier = txtcashier.Text;
                            print.ShowDialog();
                            Class.cTable table = new Class.cTable();
                            table.Checkout(Convert.ToInt32(txtTable.Text));
                            getTopId();
                            dataGridView1.Rows.Clear();
                            txtAmount.Text   = "0";
                            txtDiscount.Text = "0";
                            txtPay.Text      = "0";
                            txtTotal.Text    = "0";
                            txtTotal.Text    = "0";
                            txtTable.Text    = "0";
                            txtUSD.Text      = "0";
                            txtReal.Text     = "0";
                            txtBack.Text     = "0";
                            ListTable();
                            txtTable.Text = "0";
                            txtInvo.Text  = "0";
                            get_order_hold(txtInvo.Text);
                            flowLayoutPanel1.Enabled = true;
                            flowLayoutPanel2.Hide();
                            flowLayoutPanel1.Show();
                            getTopId();
                        }
                        else
                        {
                        }
                    }
                }
            }
        }