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(); } } }
private void txtCash_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if (e.KeyChar == ControlChars.Cr) { if (userPhonrNo.Text == "" || userPhonrNo.Text.Length >= 12) { Interaction.MsgBox("Enter User Mobile No./ Renter Mobile No.", MsgBoxStyle.Information, "Mobile No"); userPhonrNo.Text = ""; userPhonrNo.Focus(); return; } else if (txtCash.Text == "") { Interaction.MsgBox("Enter Cash", MsgBoxStyle.Information, "Cash"); return; } else 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.AddTransaction(userPhonrNo.Text); p.AddTransactionDetails(p.InvoiceNo); 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(); Usphone = userPhonrNo.Text; ViewReceipt v = new ViewReceipt(); v.Show(); this.Close(); } } }