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