public MaterialsInformationTDS.CostHistoryExceptionsInformationDataTable GetCostsExceptionsNew() { materialsInformationCostsExceptions = (MaterialsInformationTDS.CostHistoryExceptionsInformationDataTable)Session["materialsCostsExceptionsDummy"]; if (materialsInformationCostsExceptions == null) { materialsInformationCostsExceptions = ((MaterialsInformationTDS)Session["materialsInformationTDS"]).CostHistoryExceptionsInformation; } return materialsInformationCostsExceptions; }
protected void AddCostsExceptionsNewEmptyFix(GridView grdView) { if (grdCostsExceptions.Rows.Count == 0) { int companyId = Int32.Parse(hdfCompanyId.Value); MaterialsInformationTDS.CostHistoryExceptionsInformationDataTable dt = new MaterialsInformationTDS.CostHistoryExceptionsInformationDataTable(); dt.AddCostHistoryExceptionsInformationRow(Convert.ToInt32(Session["costIdSelected"]), -1, -1, "", "", "", 0, 0, false, companyId, false, ""); Session["materialsCostsExceptionsDummy"] = dt; grdCostsExceptions.DataBind(); } // Normally executes at all postbacks if (grdCostsExceptions.Rows.Count == 1) { MaterialsInformationTDS.CostHistoryExceptionsInformationDataTable dt = (MaterialsInformationTDS.CostHistoryExceptionsInformationDataTable)Session["materialsCostsExceptionsDummy"]; if (dt != null) { grdCostsExceptions.Rows[0].Visible = false; grdCostsExceptions.Rows[0].Controls.Clear(); } } }