public ServicesAddRequestTDS.CostInformationDataTable GetCostsNew() { costInformation = (ServicesAddRequestTDS.CostInformationDataTable)Session["serviceCostsDummyAddRequest"]; if (costInformation == null) { costInformation = (ServicesAddRequestTDS.CostInformationDataTable)Session["costInformationAddRequest"]; } return costInformation; }
protected void AddCostsNewEmptyFix(GridView grdView) { if (grdCosts.Rows.Count == 0) { int companyId = Int32.Parse(hdfCompanyId.Value); ServicesAddRequestTDS.CostInformationDataTable dt = new ServicesAddRequestTDS.CostInformationDataTable(); dt.AddCostInformationRow(-1, -1, "", "", "", -1, false, companyId); Session["serviceCostsDummyAddRequest"] = dt; grdCosts.DataBind(); } // Normally executes at all postbacks if (grdCosts.Rows.Count == 1) { ServicesAddRequestTDS.CostInformationDataTable dt = (ServicesAddRequestTDS.CostInformationDataTable)Session["serviceCostsDummyAddRequest"]; if (dt != null) { grdCosts.Rows[0].Visible = false; grdCosts.Rows[0].Controls.Clear(); } } }