/// <summary> /// Total amount calculation /// </summary> public void TotalBillTaxCalculation() { try { TaxSP spTax = new TaxSP(); DataTable dtbl = new DataTable(); dtbl = spTax.TotalBillTaxCalculationBtapplicableOn(); foreach (DataRow drowItem in dtbl.Rows) { if (drowItem != null) { foreach (DataGridViewRow dgvrItem in dgvSalesReturn2.Rows) { if (dgvrItem.Cells["dgvTextTaxId"].Value != null) { if (dgvrItem.Cells["dgvTextTaxId"].Value.ToString() == drowItem["taxId"].ToString()) { if (txtTotalAmount.Text != string.Empty) { dgvrItem.Cells["dgvTextAmount"].Value = Math.Round((Convert.ToDecimal(drowItem["rate"].ToString()) * Convert.ToDecimal(txtTotalAmount.Text)) / 100, PublicVariables._inNoOfDecimalPlaces); decTotalBillTaxAmount = Math.Round(Convert.ToDecimal(dgvrItem.Cells["dgvTextAmount"].Value.ToString()), PublicVariables._inNoOfDecimalPlaces); } } } } } } } catch (Exception ex) { MessageBox.Show("SR19:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }