//[/BARCODE FUNCTIONS] private void UpdateCash() { SubtotalTemp = 0; TaxTemp = 0; Subtotal = 0; TotalTax = 0; if (!semaphore && !OnExit) { semaphore = true; foreach (DataGridViewRow r in TeldgView.Rows) { if (!r.IsNewRow && !OnExit) { try { //PriceLevelSelection DataRow aItemRow = ItemsMgmt.SelectItemRowByBarcode(TeldgView.Rows[r.Index].Cells["Barcode"].Value.ToString()); SubtotalTemp = Math.Round(double.Parse(TeldgView.Rows[r.Index].Cells["PriceTotal"].Value.ToString()), 3); Subtotal += SubtotalTemp; TaxTemp = double.Parse(TeldgView.Rows[r.Index].Cells["Tax"].Value.ToString()); TotalTax += (TaxTemp / 100) * SubtotalTemp; //Net amount = (Selling Price - Sales Price)*Tax //updates } catch (Exception ex) { MessageBox.Show("UPDATE CASH ERROR IN [DISPOSE ITEMS] Exception:" + ex.ToString()); return; } } } TotalTxtBox.Text = Math.Round(Subtotal + TotalTax, 2).ToString(); Subtotal = Math.Round(Subtotal, 2); SubtotalTxtBox.Text = Subtotal.ToString(); TotalTax = Math.Round(TotalTax, 3); TaxTxtBox.Text = TotalTax.ToString(); semaphore = false; } }
private void ListItemsDgView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { DataRow aItemrow = ItemsMgmt.SelectItemRowByBarcode(ListItemsDgView.Rows[e.RowIndex].Cells["Barcode"].Value.ToString()); if (aItemrow == null) { return; } EditItems aEditItems = new EditItems(); aEditItems.Show(); aEditItems.TopLevel = true; aEditItems.UpdateVariables(aItemrow); } catch (Exception ex) { MessageBox.Show(MsgTxt.UnexpectedError + "\n IN [ListItems:ListItemsDgView_CellDoubleClick()] \n Exception: \n" + ex.ToString(), MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); throw; } }