/// <summary> /// Renders the page. /// </summary> /// <param name="writer">The writer.</param> private void RenderPage(HtmlTextWriter writer) { base.ResponseType = TABULAR; hidQuickSearch.Value = "QuickSearch"; objRequestInfo = new RequestInfo(); object objSessionUserPreference = CommonUtility.GetSessionVariable(Page, enumSessionVariable.UserPreferences.ToString()); if(objSessionUserPreference != null) objUserPreferences = (UserPreferences)objSessionUserPreference; //Checks whether user has done a QuickSearch or advanced search. #region QuickSearchResultXML if(strSearchType.Length == 0) { //creates the SearchRequestXML for Quick Search CreateQuickSearchRequestXML(); hidSearchType.Value = strAsset; } #endregion #region SearchResultResultXML else { //creates the SearchRequestXML for Advanced Search CreateAdvancedSearchRequestXML(); hidSearchType.Value = strSearchType; } if(Page.Request.QueryString["asset"] != null)//used in reorder column { hidAssetName.Value = Page.Request.QueryString["asset"].Trim(); } #endregion if(xmlDocSearchResult != null) { //Dream 4.0 code start objReorder = new Reorder(); //** ReorderColumn if((ReorderColumn) && (!strSearchType.Equals("Query Search"))) { //function for reordering of column objReorder.ManageReorder(strAsset, strAsset, xmlDocSearchResult, hidReorderColValue, hidReorderSourceId); hidReorderColValue.RenderControl(writer); hidReorderSourceId.RenderControl(writer); xmlNdLstReorderColumn = objReorder.GetColumnNodeList(strAsset, strAsset, xmlDocSearchResult); strReorderDivHTML = objReorder.GetReorderDivHTML(xmlNdLstReorderColumn); objReorder.SetColNameDisplayStatus(out strColNames, out strColDisplayStatus, xmlNdLstReorderColumn); } //Dream 4.0 SetColumnNamesHiddenField(); //** End hidMaxRecord.Value = intMaxRecords.ToString(); GetRequestIDFromResults(); //sets the MapZoomidentifiedColumn. SetMapUseColumnName(xmlDocSearchResult); hidMapUseColumnName.RenderControl(writer); SetHiddenFieldValues(); //sets the user preferences. SetUserPreference(); DisplaySearchResults(writer); } else { RenderParentTable(writer, strWindowTitleName); writer.Write("<tr><td><br/>"); lblMessage.Visible = true; lblMessage.Text = ((MOSSServiceManager)objMossController).GetCustomExceptionMessage(strCurrSiteUrl, "1"); //this will render the custom error messege. lblMessage.RenderControl(writer); writer.Write("</td></tr></table>"); } }
/// <summary> /// Renders the results. /// </summary> /// <param name="writer">The writer.</param> private void RenderResults(HtmlTextWriter writer) { //Dream 4.0 code start objReorder = new Reorder(); ///* reorder column if(ReorderColumn) { /// function for reordering of column //Dream 4.0 Pagination changes on reorder #region Dream 4.0 objReorder.ManageReorder(SearchName.ToString(), hidAssetName.Value, xmlDocSearchResult, hidReorderColValue, hidReorderSourceId); hidReorderColValue.RenderControl(writer); hidReorderSourceId.RenderControl(writer); xmlNdLstReorderColumn = objReorder.GetColumnNodeList(SearchName.ToString(), hidAssetName.Value, xmlDocSearchResult); strReorderDivHTML = objReorder.GetReorderDivHTML(xmlNdLstReorderColumn); objReorder.SetColNameDisplayStatus(out strColNames, out strColDisplayStatus, xmlNdLstReorderColumn); #endregion } //Added in DREAM 4.0 for Checkbox state management //this case is for wellbore header report when you switch from datasheet to tabular if(string.Equals(ViewMode.ToString(), TABULARDATASHEET)) { if(!strDisplayType.ToUpperInvariant().Equals(DATASHEET) && string.IsNullOrEmpty(hidColSelectedCheckBoxes.Value)) { objReorder.SetColNameDisplayStatus(out strChkbxColNames, out strChkbxColDisplayStatus, xmlDocSearchResult.SelectNodes(ATTRIBUTEXPATHWITHDISPLAYTRUE)); hidColSelectedCheckBoxes.Value = strChkbxColNames; } } else if(!SearchName.ToString().ToLowerInvariant().Equals(EPCATALOG) && !SearchName.ToString().ToLowerInvariant().Equals(PVTREPORT)) { SetColumnNamesHiddenField(); } hidColSelectedCheckBoxes.RenderControl(writer); //end //** End int intTotalRecordCount = 0; GetRequestIDFromResult(); hidRequestID.RenderControl(writer); //DREAM4.0 RenderParentTable(writer, GetEnumDescription(SearchName)); /// Added new condition, If there is no result then the print option will not show intTotalRecordCount = GetRecordCountFromResult(xmlDocSearchResult, SearchName.ToString()); /// in case of well history render print export since its reponse does not contain record count if((intTotalRecordCount > 0) || (SearchName.ToString().ToLowerInvariant().Equals(WELLHISTORY))) { RenderPrintExport(writer); } RenderResultTable(writer); //Added ni DREAM 4.0 for checkbox state management across postback objCommonUtility.RegisterOnLoadClientScript(this.Page, "SelectSelectAllCheckBox('chkbxRowSelectAll','tblSearchResults','tbody','chkbxRow');SelectSelectAllCheckBox('chkbxColumnSelectAll','tblSearchResults','thead','chkbxColumn');"); }