private DataTable saveTaxAppPercentge() { DataTable dtTax = new DataTable(); DataRow dr; dtTax.Columns.Add("hiddenid"); dtTax.Columns.Add("taxid"); dtTax.Columns.Add("Fromdate"); dtTax.Columns.Add("Todate"); dtTax.Columns.Add("TaxPercentage"); for (int i = 0; i < grd_TaxApplicable.Rows.Count; i++) { if (((TextBox)grd_TaxApplicable.Rows[i].Cells[0].FindControl("txt_from_dt")).Text != "") { dr = dtTax.NewRow(); dr["hiddenid"] = ((Label)grd_TaxApplicable.Rows[i].Cells[1].FindControl("lbl_hidden_id")).Text.ToString(); dr["taxid"] = (((Label)grd_TaxApplicable.Rows[i].Cells[2].FindControl("lbl_tax_id")).Text.ToString() == "" ? "0" : ((Label)grd_TaxApplicable.Rows[i].Cells[2].FindControl("lbl_tax_id")).Text.ToString()); dr["Fromdate"] = ((TextBox)grd_TaxApplicable.Rows[i].Cells[3].FindControl("txt_from_dt")).Text.ToString(); dr["Todate"] = ((TextBox)grd_TaxApplicable.Rows[i].Cells[4].FindControl("txt_to_dt")).Text.ToString(); dr["TaxPercentage"] = ((TextBox)grd_TaxApplicable.Rows[i].Cells[5].FindControl("txt_tax_pertg")).Text.ToString(); dtTax.Rows.Add(dr); } } return dtTax; }
pre
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)