public EmployeeInformationTDS.CostExceptionsInformationDataTable GetCostsExceptionsNew() { employeeInformationCostsExceptions = (EmployeeInformationTDS.CostExceptionsInformationDataTable)Session["employeesCostsExceptionsDummy"]; if (employeeInformationCostsExceptions == null) { employeeInformationCostsExceptions = ((EmployeeInformationTDS)Session["employeeInformationTDS"]).CostExceptionsInformation; } return employeeInformationCostsExceptions; }
protected void AddCostsExceptionsNewEmptyFix(GridView grdView) { if (grdCostsExceptions.Rows.Count == 0) { int companyId = Int32.Parse(hdfCompanyId.Value); EmployeeInformationTDS.CostExceptionsInformationDataTable dt = new EmployeeInformationTDS.CostExceptionsInformationDataTable(); dt.AddCostExceptionsInformationRow(Convert.ToInt32(Session["costIdSelected"]), -1, -1, "", "", 0, 0, 0, 0, 0, 0, false, companyId, false, 0, 0, 0); Session["employeesCostsExceptionsDummy"] = dt; grdCostsExceptions.DataBind(); } // Normally executes at all postbacks if (grdCostsExceptions.Rows.Count == 1) { EmployeeInformationTDS.CostExceptionsInformationDataTable dt = (EmployeeInformationTDS.CostExceptionsInformationDataTable)Session["employeesCostsExceptionsDummy"]; if (dt != null) { grdCostsExceptions.Rows[0].Visible = false; grdCostsExceptions.Rows[0].Controls.Clear(); } } }