public FlInversionFieldCureRecordTDS.InversionFieldCureRecordDataTable GetFieldCureRecordNew() { flInversionFieldCureRecord = (FlInversionFieldCureRecordTDS.InversionFieldCureRecordDataTable)Session["flInversionFieldCureRecordDummy"]; if (flInversionFieldCureRecord == null) { flInversionFieldCureRecord = ((FlInversionFieldCureRecordTDS.InversionFieldCureRecordDataTable)Session["flInversionFieldCureRecord"]); } return flInversionFieldCureRecord; }
protected void AddFieldCureRecordNewEmptyFix(GridView grdFieldCureRecord) { if (grdFieldCureRecord.Rows.Count == 0) { int companyId = Int32.Parse(hdfCompanyId.Value); FlInversionFieldCureRecordTDS.InversionFieldCureRecordDataTable dt = new FlInversionFieldCureRecordTDS.InversionFieldCureRecordDataTable(); dt.AddInversionFieldCureRecordRow(-1, -1, DateTime.Now, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "", false, companyId, false); Session["flInversionFieldCureRecordDummy"] = dt; grdFieldCureRecord.DataBind(); } // Normally executes at all postbacks if (grdFieldCureRecord.Rows.Count == 1) { FlInversionFieldCureRecordTDS.InversionFieldCureRecordDataTable dt = (FlInversionFieldCureRecordTDS.InversionFieldCureRecordDataTable)Session["flInversionFieldCureRecordDummy"]; if (dt != null) { grdFieldCureRecord.Rows[0].Visible = false; grdFieldCureRecord.Rows[0].Controls.Clear(); } } }