public MaterialsInformationTDS.CostHistoryInformationDataTable GetCostsNew() { materialsInformationCosts = (MaterialsInformationTDS.CostHistoryInformationDataTable)Session["materialsCostsDummy"]; if (materialsInformationCosts == null) { materialsInformationCosts = ((MaterialsInformationTDS)Session["materialsInformationTDS"]).CostHistoryInformation; } return materialsInformationCosts; }
protected void AddCostsNewEmptyFix(GridView grdView) { if (grdCosts.Rows.Count == 0) { int companyId = Int32.Parse(hdfCompanyId.Value); MaterialsInformationTDS.CostHistoryInformationDataTable dt = new MaterialsInformationTDS.CostHistoryInformationDataTable(); dt.AddCostHistoryInformationRow(-1, -1, DateTime.Now, "", 0, 0, false, companyId, false); Session["materialsCostsDummy"] = dt; grdCosts.DataBind(); } // Normally executes at all postbacks if (grdCosts.Rows.Count == 1) { MaterialsInformationTDS.CostHistoryInformationDataTable dt = (MaterialsInformationTDS.CostHistoryInformationDataTable)Session["materialsCostsDummy"]; if (dt != null) { grdCosts.Rows[0].Visible = false; grdCosts.Rows[0].Controls.Clear(); } } }