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 { } } } } }
private void pictureBox1_Click(object sender, EventArgs e) { messange.voidInvoice smg = new messange.voidInvoice(); smg.txtMSG.Text = " Do you want to exit ?"; smg.ShowDialog(); if (smg.vale == "1") { Close(); } }
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(); }
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 { } } } } }