Ejemplo n.º 1
0
        private void button13_Click(object sender, EventArgs e)
        {
            try
            {
                if ((Convert.ToDouble(change.Text) < 0) || (string.IsNullOrEmpty(cash.Text)))
                {
                    MessageBox.Show("insuffecient amount please enter the right amount", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    for (int i = 0; i < pointOfSale.dataGridTransaction.Rows.Count; i++)
                    {
                        pos.updQty(pointOfSale.dataGridTransaction.Rows[i].Cells[4].Value.ToString(),
                                   pointOfSale.dataGridTransaction.Rows[i].Cells[1].Value.ToString());

                        pos.outOfOrder(pointOfSale.dataGridTransaction.Rows[i].Cells[1].Value.ToString());
                    }
                    this.Hide();
                    frmReceipt receipt = new frmReceipt(pointOfSale);
                    receipt.loadData(cash.Text, change.Text);
                    receipt.Show();
                    pos.updTransactionStat(pointOfSale.Transactionlbl.Text);
                    pointOfSale.transactionNo();
                    pointOfSale.clearData();
                    pointOfSale.settlePayment.Enabled = false;
                    pointOfSale.addDiscount.Enabled   = false;
                    MessageBox.Show("Payment Successfully Saved", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }