/// <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> /// Saves the column order. /// </summary> private void SaveColumnOrder() { string strColOrderStatus = string.Empty; strColOrderStatus = objRolesProfilesHelper.GetColumnOrder(radLstBxSource, radLstBxDestination, "column"); objReorder = new Reorder(); objReorder.SaveReorderXml(strColOrderStatus, ddlSearchNames.SelectedValue, ddlAssetType.SelectedValue, ddlRole.SelectedValue); }
/// <summary> /// Saves the context search. /// </summary> private void SaveContextSearch() { string strColOrderStatus = string.Empty; strColOrderStatus = objRolesProfilesHelper.GetColumnOrder(radLstBxSource, radLstBxDestination, CONTEXTSEARCH.ToLowerInvariant()); objReorder = new Reorder(); objReorder.SaveGroupHeaderOrder(strColOrderStatus, radLstBxCategory.SelectedValue, GetItemAsStringArray(radLstBxCategory.Items), ddlAssetType.SelectedValue, ddlRole.SelectedValue); }
/// <summary> /// Loads the list box. /// </summary> /// <param name="objRadLstBxSource">The obj RAD LST bx source.</param> /// <param name="objRadLstBxDestination">The obj RAD LST bx destination.</param> private void LoadListOfContextSearch(RadListBox objRadLstBxSource, RadListBox objRadLstBxDestination) { Reorder objReorder = new Reorder(); XmlNodeList xmlNdLstSourceCol = null; XmlNodeList xmlNdLstDestinationCol = null; objReorder.SetSrcNDestNdLstForContextSearch(ddlRole.SelectedValue, radLstBxCategory.SelectedValue, ddlAssetType.SelectedValue, out xmlNdLstSourceCol, out xmlNdLstDestinationCol); objRadLstBxSource.Items.Clear(); if(xmlNdLstSourceCol != null && xmlNdLstSourceCol.Count > 0) { objRadLstBxSource.DataSource = xmlNdLstSourceCol; objRadLstBxSource.DataTextField = "value"; objRadLstBxSource.DataValueField = "value"; objRadLstBxSource.DataBind(); } objRadLstBxDestination.Items.Clear(); if(xmlNdLstDestinationCol != null && xmlNdLstDestinationCol.Count > 0) { objRadLstBxDestination.DataSource = xmlNdLstDestinationCol; objRadLstBxDestination.DataTextField = "value"; objRadLstBxDestination.DataValueField = "value"; objRadLstBxDestination.DataBind(); } }
/// <summary> /// Loads the list box. /// </summary> /// <param name="objRadLstBxSource">The obj RAD LST bx source.</param> /// <param name="objRadLstBxDestination">The obj RAD LST bx destination.</param> /// <param name="reponseXml">The reponse XML.</param> private void LoadListOfColumn(RadListBox objRadLstBxSource, RadListBox objRadLstBxDestination, XmlDocument reponseXml) { if(reponseXml != null) { Reorder objReorder = new Reorder(); XmlNodeList xmlNdLstSourceCol = null; XmlNodeList xmlNdLstDestinationCol = null; RadListBoxItem radLstBxItem = null; objReorder.SetSourceNDestinationItemList(ddlRole.SelectedValue, ddlSearchNames.SelectedValue, ddlAssetType.SelectedValue, reponseXml, out xmlNdLstSourceCol, out xmlNdLstDestinationCol); objRadLstBxSource.Items.Clear(); if(xmlNdLstSourceCol != null && xmlNdLstSourceCol.Count > 0) { objRadLstBxSource.DataSource = xmlNdLstSourceCol; objRadLstBxSource.DataTextField = "value"; objRadLstBxSource.DataValueField = "value"; objRadLstBxSource.DataBind(); } objRadLstBxDestination.Items.Clear(); if(xmlNdLstDestinationCol != null && xmlNdLstDestinationCol.Count > 0) { foreach(XmlNode xmlNodeCol in xmlNdLstDestinationCol) { radLstBxItem = new RadListBoxItem(xmlNodeCol.Attributes["name"].Value); objRadLstBxDestination.Items.Add(radLstBxItem); if(xmlNodeCol.Attributes["mandatory"].Value.ToLowerInvariant().Equals("true")) { radLstBxItem.Enabled = false; } } } } }
/// <summary> /// Loads the category. /// </summary> /// <param name="radListBx">The RAD list bx.</param> /// <param name="assetType">Type of the asset.</param> private void LoadCategory(RadListBox radListBx, string assetType) { Reorder objReorder = new Reorder(); XmlNodeList xmlNdLstSourceCol = null; xmlNdLstSourceCol = objReorder.GetNdLstForCategory(ddlRole.SelectedValue, assetType); radListBx.Items.Clear(); if(xmlNdLstSourceCol != null && xmlNdLstSourceCol.Count > 0) { radListBx.DataSource = xmlNdLstSourceCol; radListBx.DataTextField = "value"; radListBx.DataValueField = "value"; radListBx.DataBind(); } }
/// <summary> /// Displays the My Asset details /// </summary> /// <param name="objBookMark"></param> /// <param name="srchType"></param> private void DisplayMyAssetResults(HtmlTextWriter writer, XmlNode bookMark, string srchType, string windowTitle) { try { RequestInfo requestInfo = CreateRequestInfo(bookMark, srchType); //Dream 4.0 paging related changes starts SetSkipInfo(requestInfo.Entity); //Dream 4.0 paging related changes ends xmlDocSearchResult = objReportController.GetSearchResults(requestInfo, intMaxRecords, srchType, strSortColumn, intSortOrder); //Show on map //sets the Column name used in Map service. SetMapUseColumnName(xmlDocSearchResult); hidMapUseColumnName.RenderControl(writer); hidMapIdentified.RenderControl(writer); XmlNodeList objXmlNodeList = xmlDocSearchResult.SelectNodes(XPATH); intMaxRecords = Convert.ToInt32(PortalConfiguration.GetInstance().GetKey(MAXRECORDS).ToString()); #region DREAM 4.0 Export All AssignHiddenFieldValues(xmlDocSearchResult); #endregion XmlTextReader objXmlTextReader = ((MOSSServiceManager)objMossController).GetXSLTemplate(TABULARRESULTSXSL, strCurrSiteUrl); //**********Added for My asset Delete option writer.Write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">"); RenderMyAssetDelete(writer, windowTitle); writer.Write("<tr><td>"); //******* //**Added for reordering of column //*start objReorder = new Reorder(); xmlNdLstReorderColumn = objReorder.GetColumnNodeList(strSearchType, strSearchType, xmlDocSearchResult); objReorder.SetColNameDisplayStatus(out strColNames, out strColDisplayStatus, xmlNdLstReorderColumn); //*end //Added in DREAM 4.0 for Checkbox state management SetColumnNamesHiddenField(); //** End //Dream 4.0 paging related changes starts SetPagingParameter(); TransformXmlToResultTable(xmlDocSearchResult, objXmlTextReader, strPageNumber, strSortColumn, strSortOrder, strSearchType, string.Empty); writer.Write(strResultTable.ToString()); //Dream 4.0 paging related changes ends writer.Write("</td></tr></table>"); string strExportOptionsDiv = GetExportOptionsDivHTML("SearchResults", true, true, true, true); writer.Write(strExportOptionsDiv); //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');"); } catch(SoapException soapEx) { string strErrorMsg = soapEx.Message; if(!string.Equals(strErrorMsg, NORECORDSFOUND)) { CommonUtility.HandleException(strCurrSiteUrl, soapEx, 1); } if(strErrorMsg.Contains(CONNECTIVITYERROR)) { strErrorMsg = CONNECTIVITYERROR; } RenderMyAssetException(writer, strErrorMsg, MYASSETTITLE); } }
/// <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');"); }