Example #1
0
        private void button4_Click_1(object sender, EventArgs e)
        {
            if (dataGridView2.Rows.Count > 1)
            {
                foreach (DataGridViewRow row in dataGridView2.SelectedRows)
                {
                    if (this.dataGridView2.SelectedRows.Count > 0)
                    {
                        int             selectedrowindex = dataGridView2.SelectedCells[0].RowIndex;
                        DataGridViewRow selectedRow      = dataGridView2.Rows[selectedrowindex];
                        int             id__             = Convert.ToInt32(selectedRow.Cells[0].Value);

                        messange.voidInvoice msg = new messange.voidInvoice();
                        msg.txtMSG.Text = "Do you want to remove Items code =>" + id__;
                        msg.ShowDialog();
                        if (msg.vale == "1")
                        {
                            Class.cOrder_detial order = new Class.cOrder_detial();
                            order.Remove(Convert.ToInt32(txtInvo.Text), id__);
                            gethold_inv(txtTable.Text);
                            get_order_hold(txtInvo.Text);
                            getTotal();
                        }
                        else
                        {
                        }
                    }
                }
            }
        }
Example #2
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (dataGridView2.Rows.Count > 1)
     {
         addDiscount fm = new addDiscount();
         fm.ShowDialog();
         if (fm.rate_dis != "")
         {
             foreach (DataGridViewRow row in dataGridView2.SelectedRows)
             {
                 if (this.dataGridView2.SelectedRows.Count > 0)
                 {
                     if (this.dataGridView2.SelectedRows.Count > 0)
                     {
                         Class.cOrder_detial order        = new Class.cOrder_detial();
                         int             selectedrowindex = dataGridView2.SelectedCells[0].RowIndex;
                         DataGridViewRow selectedRow      = dataGridView2.Rows[selectedrowindex];
                         int             id__             = Convert.ToInt32(selectedRow.Cells[0].Value);
                         order.add_discount(Convert.ToInt32(txtInvo.Text), Convert.ToInt32(id__), Convert.ToInt32(fm.rate_dis));
                         gethold_inv(txtTable.Text);
                         get_order_hold(txtInvo.Text);
                     }
                 }
             }
         }
     }
 }
Example #3
0
        protected void LoadItem(object sender, EventArgs e, String name)
        {
            DataTable    tb  = new DataTable();
            SqlParameter par = new SqlParameter();

            par.ParameterName = "@Id";
            par.Value         = name;
            tb = cM.getAllData("select_product_byID", par, null, null, null);
            Class.cOrder_detial order = new Class.cOrder_detial();

            order.Insert(Convert.ToInt32(txtInvo.Text), Convert.ToInt32(tb.Rows[0][0].ToString()), 1, tb.Rows[0][2].ToString(), "00", tb.Rows[0][2].ToString());
            get_order_hold(txtInvo.Text);
            getTotal();
        }
Example #4
0
 private void button3_Click(object sender, EventArgs e)
 {
     if (dataGridView2.Rows.Count > 1)
     {
         foreach (DataGridViewRow row in dataGridView2.SelectedRows)
         {
             if (this.dataGridView2.SelectedRows.Count > 0)
             {
                 int                 selectedrowindex = dataGridView2.SelectedCells[0].RowIndex;
                 DataGridViewRow     selectedRow      = dataGridView2.Rows[selectedrowindex];
                 int                 id__             = Convert.ToInt32(selectedRow.Cells[0].Value);
                 Class.cOrder_detial order            = new Class.cOrder_detial();
                 order.Adjust(Convert.ToInt32(txtInvo.Text), id__);
                 gethold_inv(txtTable.Text);
                 get_order_hold(txtInvo.Text);
                 getTotal();
             }
         }
     }
 }
Example #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            messange.voidInvoice move_inv = new messange.voidInvoice();
            move_inv.txtMSG.Text = "Do you want to remove invoice => " + txtInvo.Text;
            move_inv.ShowDialog();
            if (move_inv.vale == "1")
            {
                Class.cOrder_detial order = new Class.cOrder_detial();
                order.Void_Invoice(Convert.ToInt32(txtInvo.Text));
                Class.cTable table = new Class.cTable();
                table.Checkout(Convert.ToInt32(txtTable.Text));
                getTopId();
                txtTable.Text = "0";
                get_order_hold(txtInvo.Text);
            }
            else
            {
                MessageBox.Show("OK");
            }

            ListTable();
        }
Example #6
0
        private void button7_Click(object sender, EventArgs e)
        {
            try
            {
                //cM.ClearTextBoxes(this);
                Class.cOrder_detial order = new Class.cOrder_detial();

                dataGridView1.Rows.Clear();
                exUSD.Text       = "0";
                exReal.Text      = "0";
                txtReal.Text     = "0";
                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";
                txtInvo.Text     = "0";
                fPayment pay = new fPayment();
                pay.txtGetReal = "0";
                pay.txtGetUsd  = "0";

                get_order_hold(txtInvo.Text);
                ListTable();
                flowLayoutPanel1.Enabled = true;
                flowLayoutPanel2.Hide();
                flowLayoutPanel1.Show();
                getTopId();
                getExchage();
            }
            catch
            {
            }
        }
Example #7
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
                        {
                        }
                    }
                }
            }
        }
Example #8
0
 private void button2_Click(object sender, EventArgs e)
 {
     Class.cOrder_detial order = new Class.cOrder_detial();
     order.Insert(1, 1, 2, "100", "200", "0");
     MessageBox.Show("Inserted ");
 }