Beispiel #1
0
        /// <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);
            }
        }
Beispiel #2
0
        /// <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');");
        }