Пример #1
0
        private void txtCash_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
        {
            if (e.KeyChar == ControlChars.Cr)
            {
                if (Convert.ToDouble(txtTA.Text.Replace(",", "")) > Convert.ToDouble(txtCash.Text.Replace(",", "")))
                {
                    Interaction.MsgBox("Insuficient cash to paid the total amount", MsgBoxStyle.Exclamation, "payment");
                    txtCash.Focus();
                }
                else
                {
                    AddPayment();
                    if (System.Windows.Forms.Application.OpenForms["frmPOS"] != null)
                    {
                        frmPOS p = (System.Windows.Forms.Application.OpenForms["frmPOS"] as frmPOS);
                        p.GetInvoiceNo();
                        p.AddTransaction();
                        p.AddTransactionDetails();
                        p.UpdateProductQuantity();

                        frmPrintReceipt pr = new frmPrintReceipt(InvoiceNo);
                        pr.Show();

                        Interaction.MsgBox("Transaction completed. Press OK for a new transaction.", MsgBoxStyle.Information, "Transaction");
                        p.NewTransaction();
                    }

                    //My.MyProject.Forms.frmPrintReceipt.Show();

                    this.Close();
                }
            }
        }
Пример #2
0
        private void dgwInvoice_DoubleClick(object sender, EventArgs e)
        {
            string          InvoiceNo = dgwInvoice.CurrentRow.Cells[1].Value.ToString();
            frmPrintReceipt rp        = new frmPrintReceipt(InvoiceNo);

            rp.Show();

            dgwInvoice.Visible = false;
        }