public void AddDgView(DataTable aBillDataTable) { try { foreach (DataRow r in aBillDataTable.Rows) { RowNum = TeldgView.Rows.Add(); TeldgView.Rows[RowNum].Cells["Barcode"].Value = ItemsMgmt.SelectItemBarcodeByID(int.Parse(aBillDataTable.Rows[RowNum]["ItemID"].ToString())); TeldgView.Rows[RowNum].Cells["Description"].Value = aBillDataTable.Rows[RowNum]["ItemDescription"].ToString(); TeldgView.Rows[RowNum].Cells["Qty"].Value = aBillDataTable.Rows[RowNum]["Qty"].ToString(); TeldgView.Rows[RowNum].Cells["PricePerUnit"].Value = aBillDataTable.Rows[RowNum]["SellPrice"].ToString(); TeldgView.Rows[RowNum].Cells["PriceTotal"].Value = double.Parse(aBillDataTable.Rows[RowNum]["TotalPerUnit"].ToString()); TeldgView.Rows[RowNum].Cells["Tax"].Value = ItemTaxLevelMgmt.SelectItemTaxByID(int.Parse(ItemsMgmt.SelectTaxLevelIDByID(int.Parse(aBillDataTable.Rows[RowNum]["ItemID"].ToString())))).ToString(); TeldgView.Rows[RowNum].Cells["AvalQty"].Value = aBillDataTable.Rows[RowNum]["OldAvaQty"].ToString(); } } catch (Exception ex) { MessageBox.Show(MsgTxt.UnexpectedError + "\n IN [EditBill-AddDgView] \n Exception: \n" + ex.ToString() + "\n" + MsgTxt.FormWillCloseNowTxt, MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); this.Close(); } }