// // UpdateRecord2 // // Updates the database from a typed dataset containing a row for LFS_MASTER_AREA, // and zero or more rows for LFS_M2_TABLES. // public void UpdateRecord2(TDSLFSRecord dataSet, int companyId, AddRecordTDS addRecordTDS, ViewFullLengthLiningTDS viewFullLengthLiningTDS, ViewJLinersheetTDS viewJLinersheetTDS, string tdsToWork) { //--- Prepare transaction //--- ... Open connection and start transaction dcConnection.Open(); SqlTransaction transaction2 = dcConnection.BeginTransaction(); //... Assign transaction to data adapters this.daLFSMasterArea.InsertCommand.Transaction = transaction2; this.daLFSMasterArea.UpdateCommand.Transaction = transaction2; this.daLFSMasterArea.DeleteCommand.Transaction = transaction2; this.daLFSJunctionLiner2.InsertCommand.Transaction = transaction2; this.daLFSJunctionLiner2.UpdateCommand.Transaction = transaction2; this.daLFSJunctionLiner2.DeleteCommand.Transaction = transaction2; this.daLfsMasterAreaRct.InsertCommand.Transaction = transaction2; this.daLfsMasterAreaRct.UpdateCommand.Transaction = transaction2; this.daLfsMasterAreaRct.DeleteCommand.Transaction = transaction2; this.daLfsJunctionLinerRct.InsertCommand.Transaction = transaction2; this.daLfsJunctionLinerRct.UpdateCommand.Transaction = transaction2; this.daLfsJunctionLinerRct.DeleteCommand.Transaction = transaction2; try { //Update database //... deletes daLFSJunctionLiner2.Update(dataSet.LFS_JUNCTION_LINER2.Select("", "", DataViewRowState.Deleted)); daLFSMasterArea.Update(dataSet.LFS_MASTER_AREA.Select("", "", DataViewRowState.Deleted)); //... updates daLFSJunctionLiner2.Update(dataSet.LFS_JUNCTION_LINER2.Select("", "", DataViewRowState.ModifiedCurrent)); daLFSMasterArea.Update(dataSet.LFS_MASTER_AREA.Select("", "", DataViewRowState.ModifiedCurrent)); //... inserts // Point Repairs daLFSMasterArea.Update(dataSet.LFS_MASTER_AREA.Select("", "", DataViewRowState.Added)); daLFSJunctionLiner2.Update(dataSet.LFS_JUNCTION_LINER2.Select("", "", DataViewRowState.Added)); //... record change tracking records daLfsMasterAreaRct.Update(dataSet); //--- Commit transaction transaction2.Commit(); } catch (DBConcurrencyException dBConcurrencyException) { //--- Rollback transaction transaction2.Rollback(); //--- Throw exception throw new Exception("Concurrency error: Another user already updated the data you are working on. Your operation has been cancelled.", dBConcurrencyException); } catch (SqlException sqlException) { //--- Rollback transaction transaction2.Rollback(); //--- Throw exception byte severityLevel = sqlException.Class; if (severityLevel <= 16) { throw new Exception("Low severity error. Your operation has been cancelled. SQL Error " + severityLevel + "."); } if ((severityLevel >= 17) && (severityLevel <= 19)) { throw new Exception("Mid severity error. Your operation has been cancelled. SQL Error " + severityLevel + "."); } if (severityLevel >= 20) { throw new Exception("High severity error. Your operation has been cancelled. SQL Error " + severityLevel + "."); } } catch (Exception e) { //--- Rollback transaction transaction2.Rollback(); //--- Throw exception throw new Exception("Unknow error. Your operation has been cancelled.", e); } finally { //--- Close connection if (dcConnection.State == System.Data.ConnectionState.Open) { dcConnection.Close(); } object[] array = dataSet.LFS_MASTER_AREA.Rows[0].ItemArray; Guid newId = (Guid)array.GetValue(0); if (tdsToWork == "addRecord") { AddRecordPointRepairs addRecordPointRepairs = new AddRecordPointRepairs(addRecordTDS); addRecordPointRepairs.Save(companyId, newId); } if (tdsToWork == "viewFullLengthLining") { ViewFullLengthLiningLfsM2Tables viewFullLengthLiningLfsM2Tables = new ViewFullLengthLiningLfsM2Tables(viewFullLengthLiningTDS); viewFullLengthLiningLfsM2Tables.Save(companyId, newId); } if (tdsToWork == "viewJLinersheet") { ViewJLinersheetJunctionLiner viewJLinersheetJunctionLiner = new ViewJLinersheetJunctionLiner(viewJLinersheetTDS); viewJLinersheetJunctionLiner.Save(companyId, newId); } } }
private void GrdJlinerSheetAdd() { if (ValidateFooter()) { Page.Validate("dataFooter"); if (Page.IsValid) { Guid id = new Guid(tbxID.Text); int companyId = Convert.ToInt32(Session["companyID"]); ViewJLinersheetJunctionLiner viewJLinersheetJunctionLinerForDetailId = new ViewJLinersheetJunctionLiner(viewJLinersheetTDS); string detailId = viewJLinersheetJunctionLinerForDetailId.GetNewDetailId(viewJLinersheetTDS); string mn = ""; if (((TextBox)grdJlinerSheet.FooterRow.FindControl("tbxMnFooter")).Text.Trim() != "") mn = ((TextBox)grdJlinerSheet.FooterRow.FindControl("tbxMnFooter")).Text.Trim(); double? distanceFromUsmh = null; if (((TextBox)grdJlinerSheet.FooterRow.FindControl("tbxDistanceFromUsmhFooter")).Text.Trim() != "") distanceFromUsmh = double.Parse(((TextBox)grdJlinerSheet.FooterRow.FindControl("tbxDistanceFromUsmhFooter")).Text.Trim()); string confirmedLatSize = ""; if (((TextBox)grdJlinerSheet.FooterRow.FindControl("tbxConfirmedLatSizeFooter")).Text.Trim() != "") confirmedLatSize = ((TextBox)grdJlinerSheet.FooterRow.FindControl("tbxConfirmedLatSizeFooter")).Text.Trim(); string lateralMaterial = ""; if (((TextBox)grdJlinerSheet.FooterRow.FindControl("tbxLateralMaterialFooter")).Text.Trim() != "") lateralMaterial = ((TextBox)grdJlinerSheet.FooterRow.FindControl("tbxLateralMaterialFooter")).Text.Trim(); string sharedLateral = ""; if (((DropDownList)grdJlinerSheet.FooterRow.FindControl("ddlSharedLateralFooter")).Text.Trim() != "") sharedLateral = ((DropDownList)grdJlinerSheet.FooterRow.FindControl("ddlSharedLateralFooter")).SelectedValue; bool cleanoutRequired = ((CheckBox)grdJlinerSheet.FooterRow.FindControl("ckbxCleanoutRequiredFooter")).Checked; bool pitRequired = ((CheckBox)grdJlinerSheet.FooterRow.FindControl("ckbxPitRequiredFooter")).Checked; bool mHShot = ((CheckBox)grdJlinerSheet.FooterRow.FindControl("ckbxMhShotFooter")).Checked; string mainConnection = ""; if (((DropDownList)grdJlinerSheet.FooterRow.FindControl("ddlMainConnectionFooter")).Text.Trim() != "") mainConnection = ((DropDownList)grdJlinerSheet.FooterRow.FindControl("ddlMainConnectionFooter")).SelectedValue; string transition = ""; if (((DropDownList)grdJlinerSheet.FooterRow.FindControl("ddlTransitionFooter")).Text.Trim() != "") transition = ((DropDownList)grdJlinerSheet.FooterRow.FindControl("ddlTransitionFooter")).SelectedValue; bool cleanoutInstalled = ((CheckBox)grdJlinerSheet.FooterRow.FindControl("ckbxCleanoutInstalledFooter")).Checked; bool pitInstalled = ((CheckBox)grdJlinerSheet.FooterRow.FindControl("ckbxPitInstalledFooter")).Checked; bool cleanoutGrouted = ((CheckBox)grdJlinerSheet.FooterRow.FindControl("ckbxCleanoutGroutedFooter")).Checked; bool cleanoutCored = ((CheckBox)grdJlinerSheet.FooterRow.FindControl("ckbxCleanoutCoredFooter")).Checked; DateTime? prepCompleted = null; if (((RadDatePicker)grdJlinerSheet.FooterRow.FindControl("tkrdpPrepCompletedFooter")).SelectedDate.HasValue) prepCompleted = ((RadDatePicker)grdJlinerSheet.FooterRow.FindControl("tkrdpPrepCompletedFooter")).SelectedDate.Value; string measuredLatLength = ""; if (((TextBox)grdJlinerSheet.FooterRow.FindControl("tbxMeasuredLatLengthFooter")).Text.Trim() != "") measuredLatLength = ((TextBox)grdJlinerSheet.FooterRow.FindControl("tbxMeasuredLatLengthFooter")).Text.Trim(); string measurementsTakenBy = ""; if (((TextBox)grdJlinerSheet.FooterRow.FindControl("tbxMeasurementsTakenByFooter")).Text.Trim() != "") measurementsTakenBy = ((TextBox)grdJlinerSheet.FooterRow.FindControl("tbxMeasurementsTakenByFooter")).Text.Trim(); DateTime? linerInstalled = null; if (((RadDatePicker)grdJlinerSheet.FooterRow.FindControl("tkrdpLinerInstalledFooter")).SelectedDate.HasValue) linerInstalled = ((RadDatePicker)grdJlinerSheet.FooterRow.FindControl("tkrdpLinerInstalledFooter")).SelectedDate.Value; DateTime? finalVideo = null; if (((RadDatePicker)grdJlinerSheet.FooterRow.FindControl("tkrdpFinalVideoFooter")).SelectedDate.HasValue) finalVideo = ((RadDatePicker)grdJlinerSheet.FooterRow.FindControl("tkrdpFinalVideoFooter")).SelectedDate.Value; bool restorationComplete = ((CheckBox)grdJlinerSheet.FooterRow.FindControl("ckbxRestorationCompleteFooter")).Checked; bool linerOrdered = ((CheckBox)grdJlinerSheet.FooterRow.FindControl("ckbxLinerOrderedFooter")).Checked; bool linerInStock = ((CheckBox)grdJlinerSheet.FooterRow.FindControl("ckbxLinerInStockFooter")).Checked; decimal? linerPrice = null; if (((TextBox)grdJlinerSheet.FooterRow.FindControl("tbxLinerPriceFooter")).Text.Trim() != "") linerPrice = decimal.Parse(((TextBox)grdJlinerSheet.FooterRow.FindControl("tbxLinerPriceFooter")).Text.Trim()); string comments = ""; if (((TextBox)grdJlinerSheet.FooterRow.FindControl("tbxCommentFooter")).Text.Trim() != "") comments = ((TextBox)grdJlinerSheet.FooterRow.FindControl("tbxCommentFooter")).Text.Trim(); bool archived = false; bool deleted = false; bool inDatabase = false; ViewJLinersheetJunctionLiner model = new ViewJLinersheetJunctionLiner(viewJLinersheetTDS); model.Insert(id, companyId, detailId, mn, distanceFromUsmh, confirmedLatSize, lateralMaterial, sharedLateral, cleanoutRequired, pitRequired, mHShot, mainConnection, transition, cleanoutInstalled, pitInstalled, cleanoutGrouted, cleanoutCored, prepCompleted, measuredLatLength, measurementsTakenBy, linerInstalled, finalVideo, restorationComplete, linerOrdered, linerInStock, linerPrice, comments, deleted, archived, inDatabase); Session.Remove("jlinerDummy"); Session["viewJLinersheetTDS"] = viewJLinersheetTDS; jliner = viewJLinersheetTDS.JunctionLiner; Session["jliner"] = jliner; grdJlinerSheet.DataBind(); grdJlinerSheet.PageIndex = grdJlinerSheet.PageCount - 1; } } }
protected void grdJlinerSheet_RowDeleting(object sender, GridViewDeleteEventArgs e) { Guid id = new Guid(((Label)grdJlinerSheet.Rows[e.RowIndex].Cells[0].FindControl("lblId")).Text); int refId = Int32.Parse(((Label)grdJlinerSheet.Rows[e.RowIndex].Cells[1].FindControl("lblRefId")).Text); int companyId = Int32.Parse(((Label)grdJlinerSheet.Rows[e.RowIndex].Cells[2].FindControl("lblCOMPANY_ID")).Text); ViewJLinersheetJunctionLiner model = new ViewJLinersheetJunctionLiner(viewJLinersheetTDS); model.Delete(id, refId, companyId); Session["viewJLinersheetTDS"] = viewJLinersheetTDS; }
protected void grdJlinerSheet_RowUpdating(object sender, GridViewUpdateEventArgs e) { Page.Validate("dataEdit"); if (Page.IsValid) { Guid id = new Guid(((Label)grdJlinerSheet.Rows[e.RowIndex].Cells[0].FindControl("lblId")).Text); int refId = Int32.Parse(((Label)grdJlinerSheet.Rows[e.RowIndex].Cells[1].FindControl("lblRefId")).Text); int companyId = Int32.Parse(((Label)grdJlinerSheet.Rows[e.RowIndex].Cells[2].FindControl("lblCOMPANY_ID")).Text); string mn = ""; if (((TextBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tbxMnEdit")).Text.Trim() != "") mn = ((TextBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tbxMnEdit")).Text.Trim(); double? distanceFromUsmh = null; if (((TextBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tbxDistanceFromUsmhEdit")).Text.Trim() != "") distanceFromUsmh = double.Parse(((TextBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tbxDistanceFromUsmhEdit")).Text.Trim()); string confirmedLatSize = ""; if (((TextBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tbxConfirmedLatSizeEdit")).Text.Trim() != "") confirmedLatSize = ((TextBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tbxConfirmedLatSizeEdit")).Text.Trim(); string lateralMaterial = ""; if (((TextBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tbxLateralMaterialEdit")).Text.Trim() != "") lateralMaterial = ((TextBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tbxLateralMaterialEdit")).Text.Trim(); string sharedLateral = ""; if (((DropDownList)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("ddlSharedLateralEdit")).Text.Trim() != "") sharedLateral = ((DropDownList)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("ddlSharedLateralEdit")).SelectedValue; bool cleanoutRequired = ((CheckBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("ckbxCleanoutRequiredEdit")).Checked; bool pitRequired = ((CheckBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("ckbxPitRequiredEdit")).Checked; bool mHShot = ((CheckBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("ckbxMhShotEdit")).Checked; string mainConnection = ""; if (((DropDownList)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("ddlMainConnectionEdit")).Text.Trim() != "") mainConnection = ((DropDownList)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("ddlMainConnectionEdit")).SelectedValue; string transition = ""; if (((DropDownList)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("ddlTransitionEdit")).Text.Trim() != "") transition = ((DropDownList)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("ddlTransitionEdit")).SelectedValue; bool cleanoutInstalled = ((CheckBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("ckbxCleanoutInstalledEdit")).Checked; bool pitInstalled = ((CheckBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("ckbxPitInstalledEdit")).Checked; bool cleanoutGrouted = ((CheckBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("ckbxCleanoutGroutedEdit")).Checked; bool cleanoutCored = ((CheckBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("ckbxCleanoutCoredEdit")).Checked; DateTime? prepCompleted = null; if (((RadDatePicker)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tkrdpPrepCompletedEdit")).SelectedDate.HasValue) prepCompleted = ((RadDatePicker)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tkrdpPrepCompletedEdit")).SelectedDate.Value; string measuredLatLength = ""; if (((TextBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tbxMeasuredLatLengthEdit")).Text.Trim() != "") measuredLatLength = ((TextBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tbxMeasuredLatLengthEdit")).Text.Trim(); string measurementsTakenBy = ""; if (((TextBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tbxMeasurementsTakenByEdit")).Text.Trim() != "") measurementsTakenBy = ((TextBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tbxMeasurementsTakenByEdit")).Text.Trim(); DateTime? linerInstalled = null; if (((RadDatePicker)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tkrdpLinerInstalledEdit")).SelectedDate.HasValue) linerInstalled = ((RadDatePicker)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tkrdpLinerInstalledEdit")).SelectedDate.Value; DateTime? finalVideo = null; if (((RadDatePicker)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tkrdpFinalVideoEdit")).SelectedDate.HasValue) finalVideo = ((RadDatePicker)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tkrdpFinalVideoEdit")).SelectedDate.Value; bool restorationComplete = ((CheckBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("ckbxRestorationCompleteEdit")).Checked; bool linerOrdered = ((CheckBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("ckbxLinerOrderedEdit")).Checked; bool linerInStock = ((CheckBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("ckbxLinerInStockEdit")).Checked; decimal? linerPrice = null; if (((TextBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tbxLinerPriceEdit")).Text.Trim() != "") linerPrice = decimal.Parse(((TextBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tbxLinerPriceEdit")).Text.Trim()); string comments = ""; if (((TextBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tbxCommentEdit")).Text.Trim() != "") comments = ((TextBox)grdJlinerSheet.Rows[e.RowIndex].Cells[3].FindControl("tbxCommentEdit")).Text.Trim(); ViewJLinersheetJunctionLiner model = new ViewJLinersheetJunctionLiner(viewJLinersheetTDS); model.Update(id, refId, companyId, mn, distanceFromUsmh, confirmedLatSize, lateralMaterial, sharedLateral, cleanoutRequired, pitRequired, mHShot, mainConnection, transition, cleanoutInstalled, pitInstalled, cleanoutGrouted, cleanoutCored, prepCompleted, measuredLatLength, measurementsTakenBy, linerInstalled, finalVideo, restorationComplete, linerOrdered, linerInStock, linerPrice, comments); Session["viewJLinersheetTDS"] = viewJLinersheetTDS; } else { e.Cancel = true; } }
protected void grdJlinerSheet_RowDataBound(object sender, GridViewRowEventArgs e) { if ((e.Row.RowType == DataControlRowType.DataRow) && ((e.Row.RowState == DataControlRowState.Edit) || (e.Row.RowState == (DataControlRowState.Edit | DataControlRowState.Alternate)))) { Guid id = new Guid(((Label)e.Row.FindControl("lblId")).Text); int refId = Int32.Parse(((Label)e.Row.FindControl("lblRefId")).Text); int companyId = Int32.Parse(((Label)e.Row.FindControl("lblCOMPANY_ID")).Text); ViewJLinersheetJunctionLinerGateway viewJLinersheetJunctionLinerGateway = new ViewJLinersheetJunctionLinerGateway(viewJLinersheetTDS); // For Prep Completed if (viewJLinersheetJunctionLinerGateway.Table.Rows.Count > 0) { if (viewJLinersheetJunctionLinerGateway.GetPrepCompleted(id, refId, companyId).HasValue) { ((RadDatePicker)e.Row.FindControl("tkrdpPrepCompletedEdit")).SelectedDate = viewJLinersheetJunctionLinerGateway.GetPrepCompleted(id, refId, companyId); } } // For Liner Installed if (viewJLinersheetJunctionLinerGateway.Table.Rows.Count > 0) { if (viewJLinersheetJunctionLinerGateway.GetLinerInstalled(id, refId, companyId).HasValue) { ((RadDatePicker)e.Row.FindControl("tkrdpLinerInstalledEdit")).SelectedDate = viewJLinersheetJunctionLinerGateway.GetLinerInstalled(id, refId, companyId); } } // For Final Video if (viewJLinersheetJunctionLinerGateway.Table.Rows.Count > 0) { if (viewJLinersheetJunctionLinerGateway.GetFinalVideo(id, refId, companyId).HasValue) { ((RadDatePicker)e.Row.FindControl("tkrdpFinalVideoEdit")).SelectedDate = viewJLinersheetJunctionLinerGateway.GetFinalVideo(id, refId, companyId); } } // For Transition if (viewJLinersheetJunctionLinerGateway.Table.Rows.Count > 0) { ((DropDownList)e.Row.FindControl("ddlTransitionEdit")).SelectedValue = viewJLinersheetJunctionLinerGateway.GetTransition(id, refId, companyId); } // For Main connection if (viewJLinersheetJunctionLinerGateway.Table.Rows.Count > 0) { ((DropDownList)e.Row.FindControl("ddlMainConnectionEdit")).SelectedValue = viewJLinersheetJunctionLinerGateway.GetMainConnection(id, refId, companyId); } // For Shared Lateral if (viewJLinersheetJunctionLinerGateway.Table.Rows.Count > 0) { ((DropDownList)e.Row.FindControl("ddlSharedLateralEdit")).SelectedValue = viewJLinersheetJunctionLinerGateway.GetSharedLateral(id, refId, companyId); } } if ((e.Row.RowType == DataControlRowType.DataRow) && ((e.Row.RowState == DataControlRowState.Normal) || (e.Row.RowState == (DataControlRowState.Normal | DataControlRowState.Alternate)))) { if (Convert.ToBoolean(Session["sgLFS_APP_EDIT"])) { // Button Validation e.Row.FindControl("ibtnEdit").Visible = true; e.Row.FindControl("ibtnDelete").Visible = true; } else { // Button validation e.Row.FindControl("ibtnEdit").Visible = false; e.Row.FindControl("ibtnDelete").Visible = false; } } if (e.Row.RowType == DataControlRowType.Footer) { // If the limit is reached ViewJLinersheetJunctionLiner viewJLinersheetJunctionLinerForDetailId = new ViewJLinersheetJunctionLiner(viewJLinersheetTDS); string newDetailId = viewJLinersheetJunctionLinerForDetailId.GetNewDetailId(viewJLinersheetTDS); if (newDetailId != "-1") { ((Label)e.Row.FindControl("lblMnFooter")).Visible = true; ((Label)e.Row.FindControl("lblDistanceFromUsmhFooter")).Visible = true; ((Label)e.Row.FindControl("lblConfirmedLatSizeFooter")).Visible = true; ((Label)e.Row.FindControl("lblLateralMaterialFooter")).Visible = true; ((Label)e.Row.FindControl("lblSharedLateralFooter")).Visible = true; ((Label)e.Row.FindControl("lblCleanoutRequiredFooter")).Visible = true; ((Label)e.Row.FindControl("lblPitRequiredFooter")).Visible = true; ((Label)e.Row.FindControl("lblMhShotFooter")).Visible = true; ((Label)e.Row.FindControl("lblMainConnectionFooter")).Visible = true; ((Label)e.Row.FindControl("lblTransitionFooter")).Visible = true; ((Label)e.Row.FindControl("lblCleanoutInstalledFooter")).Visible = true; ((Label)e.Row.FindControl("lblCleanoutGroutedFooter")).Visible = true; ((Label)e.Row.FindControl("lblClenoutCoredFooter")).Visible = true; ((Label)e.Row.FindControl("lblPitInstalledFooter")).Visible = true; ((Label)e.Row.FindControl("lblPrepCompletedFooter")).Visible = true; ((Label)e.Row.FindControl("lblMeasuredLatLengthFooter")).Visible = true; ((Label)e.Row.FindControl("lblMeasurementsTakenByFooter")).Visible = true; ((Label)e.Row.FindControl("lblLinerInstalledFooter")).Visible = true; ((Label)e.Row.FindControl("lblFinalVideoFooter")).Visible = true; ((Label)e.Row.FindControl("lblRestorationCompleteFooter")).Visible = true; ((Label)e.Row.FindControl("lblLinerOrdered")).Visible = true; ((Label)e.Row.FindControl("lblLinerInStockFooter")).Visible = true; ((Label)e.Row.FindControl("lblLinerPriceFooter")).Visible = true; ((Label)e.Row.FindControl("lblCommentsFooter")).Visible = true; ((TextBox)e.Row.FindControl("tbxMnFooter")).Visible = true; ((TextBox)e.Row.FindControl("tbxDistanceFromUsmhFooter")).Visible = true; ((TextBox)e.Row.FindControl("tbxConfirmedLatSizeFooter")).Visible = true; ((TextBox)e.Row.FindControl("tbxLateralMaterialFooter")).Visible = true; ((DropDownList)e.Row.FindControl("ddlSharedLateralFooter")).Visible = true; ((CheckBox)e.Row.FindControl("ckbxCleanoutRequiredFooter")).Visible = true; ((CheckBox)e.Row.FindControl("ckbxPitRequiredFooter")).Visible = true; ((CheckBox)e.Row.FindControl("ckbxMhShotFooter")).Visible = true; ((DropDownList)e.Row.FindControl("ddlMainConnectionFooter")).Visible = true; ((DropDownList)e.Row.FindControl("ddlTransitionFooter")).Visible = true; ((CheckBox)e.Row.FindControl("ckbxCleanoutInstalledFooter")).Visible = true; ((CheckBox)e.Row.FindControl("ckbxPitInstalledFooter")).Visible = true; ((CheckBox)e.Row.FindControl("ckbxCleanoutGroutedFooter")).Visible = true; ((CheckBox)e.Row.FindControl("ckbxCleanoutCoredFooter")).Visible = true; ((RadDatePicker)e.Row.FindControl("tkrdpPrepCompletedFooter")).Visible = true; ((TextBox)e.Row.FindControl("tbxMeasuredLatLengthFooter")).Visible = true; ((TextBox)e.Row.FindControl("tbxMeasurementsTakenByFooter")).Visible = true; ((RadDatePicker)e.Row.FindControl("tkrdpLinerInstalledFooter")).Visible = true; ((RadDatePicker)e.Row.FindControl("tkrdpFinalVideoFooter")).Visible = true; ((CheckBox)e.Row.FindControl("ckbxRestorationCompleteFooter")).Visible = true; ((CheckBox)e.Row.FindControl("ckbxLinerOrderedFooter")).Visible = true; ((CheckBox)e.Row.FindControl("ckbxLinerInStockFooter")).Visible = true; ((TextBox)e.Row.FindControl("tbxLinerPriceFooter")).Visible = true; ((TextBox)e.Row.FindControl("tbxCommentFooter")).Visible = true; e.Row.FindControl("ibtnAdd").Visible = true; lblMaxNumber.Visible = false; if (!Convert.ToBoolean(Session["sgLFS_APP_EDIT"])) { ((Label)e.Row.FindControl("lblMnFooter")).Visible = false; ((Label)e.Row.FindControl("lblDistanceFromUsmhFooter")).Visible = false; ((Label)e.Row.FindControl("lblConfirmedLatSizeFooter")).Visible = false; ((Label)e.Row.FindControl("lblLateralMaterialFooter")).Visible = false; ((Label)e.Row.FindControl("lblSharedLateralFooter")).Visible = false; ((Label)e.Row.FindControl("lblCleanoutRequiredFooter")).Visible = false; ((Label)e.Row.FindControl("lblPitRequiredFooter")).Visible = false; ((Label)e.Row.FindControl("lblMhShotFooter")).Visible = false; ((Label)e.Row.FindControl("lblMainConnectionFooter")).Visible = false; ((Label)e.Row.FindControl("lblTransitionFooter")).Visible = false; ((Label)e.Row.FindControl("lblCleanoutInstalledFooter")).Visible = false; ((Label)e.Row.FindControl("lblCleanoutGroutedFooter")).Visible = false; ((Label)e.Row.FindControl("lblClenoutCoredFooter")).Visible = false; ((Label)e.Row.FindControl("lblPitInstalledFooter")).Visible = false; ((Label)e.Row.FindControl("lblPrepCompletedFooter")).Visible = false; ((Label)e.Row.FindControl("lblMeasuredLatLengthFooter")).Visible = false; ((Label)e.Row.FindControl("lblMeasurementsTakenByFooter")).Visible = false; ((Label)e.Row.FindControl("lblLinerInstalledFooter")).Visible = false; ((Label)e.Row.FindControl("lblFinalVideoFooter")).Visible = false; ((Label)e.Row.FindControl("lblRestorationCompleteFooter")).Visible = false; ((Label)e.Row.FindControl("lblLinerOrdered")).Visible = false; ((Label)e.Row.FindControl("lblLinerInStockFooter")).Visible = false; ((Label)e.Row.FindControl("lblLinerPriceFooter")).Visible = false; ((Label)e.Row.FindControl("lblCommentsFooter")).Visible = false; ((TextBox)e.Row.FindControl("tbxMnFooter")).Visible = false; ((TextBox)e.Row.FindControl("tbxDistanceFromUsmhFooter")).Visible = false; ((TextBox)e.Row.FindControl("tbxConfirmedLatSizeFooter")).Visible = false; ((TextBox)e.Row.FindControl("tbxLateralMaterialFooter")).Visible = false; ((DropDownList)e.Row.FindControl("ddlSharedLateralFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxCleanoutRequiredFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxPitRequiredFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxMhShotFooter")).Visible = false; ((DropDownList)e.Row.FindControl("ddlMainConnectionFooter")).Visible = false; ((DropDownList)e.Row.FindControl("ddlTransitionFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxCleanoutInstalledFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxPitInstalledFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxCleanoutGroutedFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxCleanoutCoredFooter")).Visible = false; ((RadDatePicker)e.Row.FindControl("tkrdpPrepCompletedFooter")).Visible = false; ((TextBox)e.Row.FindControl("tbxMeasuredLatLengthFooter")).Visible = false; ((TextBox)e.Row.FindControl("tbxMeasurementsTakenByFooter")).Visible = false; ((RadDatePicker)e.Row.FindControl("tkrdpLinerInstalledFooter")).Visible = false; ((RadDatePicker)e.Row.FindControl("tkrdpFinalVideoFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxRestorationCompleteFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxLinerOrderedFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxLinerInStockFooter")).Visible = false; ((TextBox)e.Row.FindControl("tbxLinerPriceFooter")).Visible = false; ((TextBox)e.Row.FindControl("tbxCommentFooter")).Visible = false; e.Row.FindControl("ibtnAdd").Visible = false; } } else { ((Label)e.Row.FindControl("lblMnFooter")).Visible = false; ((Label)e.Row.FindControl("lblDistanceFromUsmhFooter")).Visible = false; ((Label)e.Row.FindControl("lblConfirmedLatSizeFooter")).Visible = false; ((Label)e.Row.FindControl("lblLateralMaterialFooter")).Visible = false; ((Label)e.Row.FindControl("lblSharedLateralFooter")).Visible = false; ((Label)e.Row.FindControl("lblCleanoutRequiredFooter")).Visible = false; ((Label)e.Row.FindControl("lblPitRequiredFooter")).Visible = false; ((Label)e.Row.FindControl("lblMhShotFooter")).Visible = false; ((Label)e.Row.FindControl("lblMainConnectionFooter")).Visible = false; ((Label)e.Row.FindControl("lblTransitionFooter")).Visible = false; ((Label)e.Row.FindControl("lblCleanoutInstalledFooter")).Visible = false; ((Label)e.Row.FindControl("lblCleanoutGroutedFooter")).Visible = false; ((Label)e.Row.FindControl("lblClenoutCoredFooter")).Visible = false; ((Label)e.Row.FindControl("lblPitInstalledFooter")).Visible = false; ((Label)e.Row.FindControl("lblPrepCompletedFooter")).Visible = false; ((Label)e.Row.FindControl("lblMeasuredLatLengthFooter")).Visible = false; ((Label)e.Row.FindControl("lblMeasurementsTakenByFooter")).Visible = false; ((Label)e.Row.FindControl("lblLinerInstalledFooter")).Visible = false; ((Label)e.Row.FindControl("lblFinalVideoFooter")).Visible = false; ((Label)e.Row.FindControl("lblRestorationCompleteFooter")).Visible = false; ((Label)e.Row.FindControl("lblLinerOrdered")).Visible = false; ((Label)e.Row.FindControl("lblLinerInStockFooter")).Visible = false; ((Label)e.Row.FindControl("lblLinerPriceFooter")).Visible = false; ((Label)e.Row.FindControl("lblCommentsFooter")).Visible = false; ((TextBox)e.Row.FindControl("tbxMnFooter")).Visible = false; ((TextBox)e.Row.FindControl("tbxDistanceFromUsmhFooter")).Visible = false; ((TextBox)e.Row.FindControl("tbxConfirmedLatSizeFooter")).Visible = false; ((TextBox)e.Row.FindControl("tbxLateralMaterialFooter")).Visible = false; ((DropDownList)e.Row.FindControl("ddlSharedLateralFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxCleanoutRequiredFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxPitRequiredFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxMhShotFooter")).Visible = false; ((DropDownList)e.Row.FindControl("ddlMainConnectionFooter")).Visible = false; ((DropDownList)e.Row.FindControl("ddlTransitionFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxCleanoutInstalledFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxPitInstalledFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxCleanoutGroutedFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxCleanoutCoredFooter")).Visible = false; ((RadDatePicker)e.Row.FindControl("tkrdpPrepCompletedFooter")).Visible = false; ((TextBox)e.Row.FindControl("tbxMeasuredLatLengthFooter")).Visible = false; ((TextBox)e.Row.FindControl("tbxMeasurementsTakenByFooter")).Visible = false; ((RadDatePicker)e.Row.FindControl("tkrdpLinerInstalledFooter")).Visible = false; ((RadDatePicker)e.Row.FindControl("tkrdpFinalVideoFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxRestorationCompleteFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxLinerOrderedFooter")).Visible = false; ((CheckBox)e.Row.FindControl("ckbxLinerInStockFooter")).Visible = false; ((TextBox)e.Row.FindControl("tbxLinerPriceFooter")).Visible = false; ((TextBox)e.Row.FindControl("tbxCommentFooter")).Visible = false; e.Row.FindControl("ibtnAdd").Visible = false; lblMaxNumber.Visible = false; } } }