Пример #1
0
        /// <summary>
        /// Gets the response XML.
        /// </summary>
        /// 
        private XmlDocument GetResponseXML(string searchName)
        {
            XmlDocument xmlDocResponse = null;
            objRequestInfo = new RequestInfo();
            int intMaxRecords = Convert.ToInt32(PortalConfiguration.GetInstance().GetKey(MAXRECORDS));
            string strIdentifiedItem = string.Empty;
            base.ResponseType = TABULAR;
            base.EntityName = searchName;
            if (!string.IsNullOrEmpty(strSelectedRows))
            {
                /// Gets the Selected Identifier value from the results page.
                strIdentifiedItem = strSelectedRows;

                /// Gets the Selected Identifier Column name from the results page.
                arrIdentifierValue = strIdentifiedItem.Split('|');

                /// Creates the requestInfo object to fetch result from report service.
                objRequestInfo = SetBasicDataObjects(searchName, strSelectedCriteriaName, arrIdentifierValue, false, false, intMaxRecords);
            }
            else
            {
                objRequestInfo = null;
            }

            if (objRequestInfo != null)
            {
                if (string.Equals(searchName.ToLowerInvariant(), PALEOMARKERSREPORT))
                {
                    AddPaleoMarkersAttribute();
                }
                string strLengthType = string.Empty;
                if (!string.IsNullOrEmpty(strLengthType = objCommonUtility.GetFormControlValue("rdoLengthType")))
                {
                    if (strLengthType.Equals(TRUEVERTICAL))
                    {
                        objRequestInfo.Entity.TVDSS = true;
                    }
                    else
                    {
                        objRequestInfo.Entity.TVDSS = false;
                    }
                }
                //end
                /// Call for the GetSearchResults() method to fetch the search results from webservice.
                if (strSearchType.Equals("Query Search"))
                {
                    objQueryBuildController = objFactory.GetServiceManager(QUERYSERVICE);
                    xmlDocResponse = objQueryBuildController.GetSearchResults(objRequestInfo, intMaxRecords, searchName, null, 0);
                }
                else
                {
                    xmlDocResponse = objReportController.GetSearchResults(objRequestInfo, intMaxRecords, searchName, null, 0);
                }
            }
            return xmlDocResponse;
        }
Пример #2
0
        /// <summary>
        /// Gets the result XML doument.
        /// </summary>
        /// <returns></returns>
        private XmlDocument GetResponseXml()
        {
            int intMaxRecords = 0;
            XmlDocument xmlDocResponse;
            objQueryBuildController = objFactory.GetServiceManager(QUERYSERVICE);
            objRequestInfo = new RequestInfo();
            xmlDocResponse = new XmlDocument();

            intMaxRecords = Convert.ToInt32(PortalConfiguration.GetInstance().GetKey(MAXRECORDS));
            base.ResponseType = "Tabular";
            objRequestInfo = SetBasicDataObjects(string.Empty, string.Empty, null, true, true, intMaxRecords);
            if (strSearchType.Equals("Query Search"))
            {
                xmlDocResponse = objQueryBuildController.GetSearchResults(objRequestInfo, intMaxRecords, strSearchType, null, 0);
            }
            else
            {
                xmlDocResponse = objReportController.GetSearchResults(objRequestInfo, intMaxRecords, strSearchType, null, 0);
            }
            return xmlDocResponse;
        }
Пример #3
0
 /// <summary>
 /// Gets the response XML.
 /// </summary>
 /// <param name="criteriaName">Name of the criteria.</param>
 /// <param name="selectedCriteriaValues">The selected criteria values.</param>
 /// <returns></returns>
 protected XmlDocument GetResponseXML(string criteriaName, string selectedCriteriaValues)
 {
     objRequestInfo = GetRequestInfo(criteriaName, selectedCriteriaValues);
     objFactory = new ServiceProvider();
     objReportController = objFactory.GetServiceManager(REPORTSERVICE);
     objRespXmlDocument = objReportController.GetSearchResults(objRequestInfo, -1, SearchType, null, 0);
     //objRespXmlDocument = new XmlDocument();
     //objRespXmlDocument.Load(@"C:\yasotha\RadChart\Shell.SharePoint.DREAM.WebParts.ChartPOC\dir survey detail resp-SIEP.xml");
     return objRespXmlDocument;
 }
Пример #4
0
 /// <summary>
 /// Method is use to get the staus XML and render as in HTML tables.
 /// </summary>
 /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter"></see> object that receives the control content.</param>
 private void RenderResourceStatus(HtmlTextWriter writer)
 {
     ServiceProvider objFactory = new ServiceProvider();
     objResourceController = objFactory.GetServiceManager("ResourceManager");
     XmlNodeList objXMLnodeList = null;
     Boolean blnCheckValue = false;
     xmlResourceStatus = new XmlDocument();
     try
     {
         //Gets the resource status result from the report service.
         xmlResourceStatus = objResourceController.GetSearchResults();
         if (xmlResourceStatus != null)
         {
             writer.Write("<div id=\"tableContainer\" class=\"tableContainer\">");
             writer.Write("<table style=\"border-right:1px solid #bdbdbd;\"  cellpadding=\"0\" cellspacing=\"0\" class=\"scrollTable\" id=\"tblSearchResults\"><thead class=\"fixedHeader\" id=\"fixedHeader\"><tr style=\"height: 20px;\" align=\"center\"><th valign=\"center\" align=\"center\" text-align=\"center\">");
             //Checks whether any service is not working and need to show the Description column.
             objXMLnodeList = xmlResourceStatus.SelectNodes("response/resources/resource");
             foreach (XmlNode xmlNodeResource in objXMLnodeList)
             {
                 if (xmlNodeResource.Attributes["value"].Value.ToString() == "false")
                 {
                     blnCheckValue = true;
                     break;
                 }
             }
             if (blnCheckValue)
             {
                 writer.Write("Resource Name</th>");
                 writer.Write("<th>Status</th>");
                 writer.Write("<th>Description</th>");
             }
             else
             {
                 writer.Write("Resource Name</th>");
                 writer.Write("<th>Status</th>");
             }
             writer.Write("</tr></thead><tbody boder =\"1\" class=\"scrollContent\">");
             //render each service status.
             foreach (XmlNode xmlNodeResource in objXMLnodeList)
             {
                 writer.Write("<tr height=\"20px\"><td>&#160;");
                 writer.Write(xmlNodeResource.Attributes["name"].Value.ToString());
                 writer.Write("&#160;</td>");
                 if (xmlNodeResource.Attributes["value"].Value.ToString() == "true")
                 {
                     if (!blnCheckValue)
                     {
                         //if the service is available shows the resource available image.
                         writer.Write("<td align=\"center\"><img align='absmiddle' src='/_layouts/DREAM/images/Resource_Available.gif' alt='Available' />");
                         writer.Write("</td>");
                     }
                     else
                     {
                         writer.Write("<td align=\"center\"><img align='absmiddle' src='/_layouts/DREAM/images/Resource_Available.gif' alt='Available' />");
                         writer.Write("</td>");
                         writer.Write("<td>&#160;</td>");
                     }
                 }
                 else
                 {
                     if (!blnCheckValue)
                     {
                         //if the service is available shows the resource available image.
                         writer.Write("<td align=\"center\"><img align='absmiddle' src='/_layouts/DREAM/images/Resource_Unavailable.gif' alt='Unavailable' />");
                         writer.Write("</td>");
                     }
                     else
                     {
                         writer.Write("<td align=\"center\"><img align='absmiddle' src='/_layouts/DREAM/images/Resource_Unavailable.gif' alt='Unavailable' />");
                         writer.Write("</td><td>");
                         writer.Write(xmlNodeResource.Attributes["desc"].Value.ToString());
                         writer.Write("&#160;</td>");
                     }
                 }
                 writer.Write("</tr>");
             }
             writer.Write("</table></tbody></table></div>");
         }
         else
         {
             //renders the exception message.
             RenderException(ERRORMESSAGE, writer);
         }
     }
     catch (SoapException soapEx)
     {
         if (!string.Equals(soapEx.Message.ToString(), NORECORDSFOUND))
         {
             CommonUtility.HandleException(strCurrSiteUrl, soapEx, 1);
         }
         RenderException(soapEx.Message.ToString(),writer);
     }
     catch (Exception Ex)
     {
         RenderException(Ex.Message.ToString(),writer);
     }
     finally
     {
         objCommonUtility.CloseAjaxBusyBox(this.Page);
     }
 }
Пример #5
0
 /// <summary>
 /// Gets the basins.
 /// </summary>
 /// <returns>XmlDocument</returns>
 protected XmlDocument GetBasinFromWebService()
 {
     objReportController = objFactory.GetServiceManager(REPORTSERVICE);
     RequestInfo objRequestInfo = new RequestInfo();
     Entity objEntity = new Entity();
     Criteria objCriteria = new Criteria();
     objCriteria.Value = STAROPERATOR;
     objCriteria.Operator = LIKEOPERATOR;
     objEntity.Criteria = objCriteria;
     objRequestInfo.Entity = objEntity;
     XmlDocument xmlDocResponse = objReportController.GetSearchResults(objRequestInfo, intListValMaxRecord, BASINITEMVAL, null, 0);
     return xmlDocResponse;
 }
Пример #6
0
        /// <summary>
        /// Adds the type1 to PDF doc.
        /// </summary>
        /// <param name="docPDF">The doc PDF.</param>
        /// <param name="xpatpageNode">The xpatpage node.</param>
        internal string AddType1toPDFDoc(string[] strarrPageDetails, string context)
        {
            strWr = new StringWriter();
            objFactory = new ServiceProvider();
            objreqinf = new RequestInfo();
            xmlDocSearchResult = new XmlDocument();
            pdfBLL = new PdfBLL();
            XmlTextReader xmlTextReader = null;
            AbstractController objMossController = null;
            objMossController = objFactory.GetServiceManager(MOSSSERVICE);
            objreqinf.Entity = SetEntity(strarrPageDetails);
            if (!strarrPageDetails[3].ToUpper().Equals("WELLHISTORY"))
            {
                objQueryServiceController = objFactory.GetServiceManager(Constant.REPORTSERVICE, context);
                xmlDocSearchResult = objQueryServiceController.GetSearchResults(objreqinf, -1, strarrPageDetails[3], null, 0);
            }
            else
            {
                objQueryServiceController = objFactory.GetServiceManager(Constant.EVENTSERVICE, context);
                xmlDocSearchResult = objQueryServiceController.GetSearchResults(objreqinf, -1, strarrPageDetails[3], null, 0);
            }
            switch (strarrPageDetails[3].ToUpper())
            {
                case "PREPRODRFT":
                    xmlTextReader = ((MOSSServiceManager)objMossController).GetXSLTemplate("PDFTabular Results", context);
                    break;
                case "WELLBOREHEADER":
                    xmlTextReader = ((MOSSServiceManager)objMossController).GetXSLTemplate("WellboreHeader Datasheet", context);
                    break;
                case "WELLHISTORY":
                    xmlTextReader = ((MOSSServiceManager)objMossController).GetXSLTemplate("WellHistory DataSheet", context);
                    break;
                case "WELLSUMMARY":
                    xmlTextReader = ((MOSSServiceManager)objMossController).GetXSLTemplate("WellSummary", context);
                    break;
            }
            strWr = pdfBLL.TransformSearchResultsToXSL(xmlDocSearchResult, xmlTextReader, string.Empty, string.Empty,
              string.Empty, strarrPageDetails[3], 100, "Report", 100, context);

            return Convert.ToString(strWr.GetStringBuilder());
        }