public static void refresh_display_addproduct_and_totalamount(cls_product prod, decimal total) { string productname = prod.getProductName(); if (productname.Length > displayLength) { productname = productname.Substring(0, displayLength); } string productprice = "P" + prod.getPrice().ToString("N2"); string totalamt = "P" + total.ToString("N2"); int temp = displayLength / 2; if (productprice.Length > temp) { productprice = productprice.Substring(0, temp); } if (totalamt.Length > displayLength - temp) { totalamt = totalamt.Substring(0, displayLength - temp); } string line2 = String.Format("{0, -" + temp + "}{1, " + (displayLength - temp) + "}", productprice, totalamt); display(productname, line2); }
public frmSearchProductButton(cls_POSTransaction transaction, cls_product lastprod) { InitializeComponent(); fncFilter.set_theme_color(this); amountBefore = transaction.get_productlist().get_totalamount(); lastaddedproduct = lastprod; }
public frmWholesale() { InitializeComponent(); mySQLFunc.initialize_global_variables(); fncFilter.set_theme_color(this); cls_globalfunc.formaddkbkpevent(this); cproduct = new cls_product(); }
private void DGVTempProd_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 2 && e.RowIndex >= 0) { cls_product prod = tempProductlist.get_productlist()[e.RowIndex]; prod.setQty(prod.getQty() - 1); if (prod.getQty() <= 0) { tempProductlist.get_productlist().Remove(prod); } Refresh_TempProduct_DGV(); } }
public void proceed() { string memo = txtMemo.Text.Trim(); decimal price = txtPrice.Text.ToRoundedDecimal(); decimal qty = txtQty.Text.ToRoundedDecimal(); qty = (qty == 0) ? 1 : qty; if (memo.Length <= 0 && price <= 0) { fncFilter.alert(cls_globalvariables.warning_input_invalid); this.txtMemo.Focus(); this.txtMemo.SelectAll(); return; } openitem = new cls_product(price, 0, qty); openitem.setMemo(memo); openitem.setProductName("[OPENITEM]: " + memo); this.Close(); return; }