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 bool CheckFields() { decimal amt = FncFilter.GetDecimalValue(tbPrice.Text); if (amt == 0) { FncFilter.Alert(globalvariables.warning_invalid_amount); tbPrice.Focus(); tbPrice.SelectAll(); return(false); } tbProductName.Text.Trim(); if (tbProductName.Text == "") { FncFilter.Alert(globalvariables.warning_invalid_product); tbProductName.Focus(); tbProductName.SelectAll(); return(false); } tbStockNo.Text.Trim(); if (tbStockNo.Text == "") { FncFilter.Alert(globalvariables.warning_invalid_stockno); tbStockNo.Focus(); tbStockNo.SelectAll(); return(false); } return(true); }
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; } }
private void btnXRead_Click(object sender, EventArgs e) { if (GenerateReport.XRead(DateTime.Now)) { FncFilter.Alert("X-Read Generation Success"); } }
private void AddProduct() { if (globalvariables.LockedPOS) { FncFilter.Alert("POS is Locked, Z-Read already generated"); return; } if (dgvProduct.SelectedRows.Count <= 0) { return; } Product product = products[dgvProduct.SelectedRows[0].Index]; try { bool alreadyExists = transaction.productlist.Any(x => x.ID == product.ID); if (alreadyExists) { int index = transaction.productlist.FindIndex(a => a.ID == product.ID); transaction.productlist[index].Qty = transaction.productlist[index].Qty + 1; } else { product.Qty = 1; transaction.productlist.Add(product); } dgvTransactionProduct.RowCount = transaction.productlist.Count; dgvTransactionProduct.Refresh(); RefreshTransactionDetails(); } catch { } }
private void btnAddProduct_Click(object sender, EventArgs e) { if (!CheckFields()) { return; } if (!forUpdate) { decimal price = FncFilter.GetDecimalValue(tbPrice.Text); string name = tbProductName.Text; string stockno = tbStockNo.Text; Product newproduct = new Product() { Name = name, StockNo = stockno, Price = price }; if (!DataHandler.SaveProduct(newproduct)) { FncFilter.Alert(globalvariables.saving_failed); return; } else { FncFilter.Alert(globalvariables.saving_success); newProduct = true; this.Close(); } } else { decimal price = FncFilter.GetDecimalValue(tbPrice.Text); string name = tbProductName.Text; string stockno = tbStockNo.Text; product.Name = name; product.Price = price; product.StockNo = stockno; product.Show = cbProductStatus.Checked ? 1 : 0; if (!DataHandler.UpdateProduct(product)) { FncFilter.Alert(globalvariables.saving_failed); return; } else { FncFilter.Alert(globalvariables.saving_success); newProduct = true; this.Close(); } } }
private void btnVoid_Click(object sender, EventArgs e) { if (globalvariables.LockedPOS) { FncFilter.Alert("POS is Locked, Z-Read already generated"); return; } ReprintVoidForm reprintVoidForm = new ReprintVoidForm(); reprintVoidForm.IsReprint = false; reprintVoidForm.ShowDialog(); }
private void btnSave_Click(object sender, EventArgs e) { if (DataHandler.SaveAdjustments(adjustments)) { FncFilter.Alert(globalvariables.saving_success); this.Close(); } else { FncFilter.Alert(globalvariables.saving_failed); return; } }
private void bwRecompute_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { pbLoad.Visible = false; FncFilter.Alert("Recompute Complete!"); }