private void btnOkay_Click(object sender, EventArgs e) { txtInvoice.Text.Trim(); if (txtInvoice.Text.Length == 0) { return; } string invoicenumber = txtInvoice.Text; Transaction trans = DataHandler.GetTransactionByInvoice(invoicenumber); if (trans == null) { FncFilter.Alert("Invalid Invoice Number."); } else { if (IsReprint) { HardwareHelper.Print(trans, true, false); this.Close(); } else { DataHandler.VoidTransaction(trans); HardwareHelper.Print(trans, false, true); this.Close(); } } }
private void SaveTransaction(decimal amt, decimal tnd) { if (tnd < amt) { return; } try { transaction.TenderAmount = tnd; if (!DataHandler.SaveTransaction(transaction)) { FncFilter.Alert(globalvariables.saving_failed); return; } else { HardwareHelper.Print(transaction, false, false); FncFilter.Alert(globalvariables.saving_success); transComplete = true; this.Close(); } } catch { FncFilter.Alert(globalvariables.saving_failed); return; } }