示例#1
0
 /// <summary>
 /// Gets the doc lib XML file.
 /// </summary>
 /// <param name="searchType">Type of the search.</param>
 /// <param name="userID">The user ID.</param>
 /// <returns></returns>
 public XmlDocument GetDocLibXMLFile(string searchType, string userID)
 {
     XmlDocument objXmlDocument = new XmlDocument();
     objSaveSearchHandler = new SaveSearchHandler();
     try
     {
         objXmlDocument = objSaveSearchHandler.GetDocLibXMLFile(searchType, userID);
     }
     catch(Exception)
     {
         throw;
     }
     return objXmlDocument;
 }
示例#2
0
        /// <summary>
        /// Creates the save search.
        /// </summary>
        /// <param name="searchName">Name of the search.</param>
        /// <param name="searchType">Type of the search.</param>
        /// <param name="userID">The user ID.</param>
        /// <param name="searchRequestXML">The search request XML.</param>
        /// <param name="saveSearchRequestInformation">The save search request object.</param>
        /// <returns></returns>
        private XmlDocument CreateSaveSearch(string searchName, string searchType, string userID, XmlDocument searchRequestXML, string searchOrder, SaveSearchRequest saveSearchRequestInformation)
        {
            ArrayList arlSaveOrderNumber = new ArrayList();
            XmlDocument objXmlFinalDoc = new XmlDocument();
            XmlDocument objXmlRootDoc = new XmlDocument();
            string strSaveSearchLimit = string.Empty;
            SaveSearchHandler objSaveSearchHandler = new SaveSearchHandler();
            try
            {

                     strSaveSearchLimit = PortalConfiguration.GetInstance().GetKey("SaveSearchLimit");
                     if (!objSaveSearchHandler.IsDocLibFileExist(searchType, userID))
                     {
                         objXmlRootDoc = CreateSaveSearchOuterXML();
                         objXmlFinalDoc = AppendInnerToOuterXML(objXmlRootDoc, searchRequestXML, searchName, searchOrder, saveSearchRequestInformation);
                     }
                     else
                     {
                         arlSaveOrderNumber = objSaveSearchHandler.GetSaveOrderNumber(searchType, userID);
                         if (arlSaveOrderNumber.Contains(strSaveSearchLimit))
                         {
                             //throw Exception message : Save Search Criteria Exceeds the limit..
                             throw new Exception("You have exceeded the Save Search Criteria Limit. Please contact administrator.");
                         }
                         else
                         {
                             objXmlRootDoc = objSaveSearchHandler.GetDocLibXMLFile(searchType, userID);
                             if (objSaveSearchHandler.IsDuplicateExists(searchRequestXML, objXmlRootDoc))
                             {
                                 //throw Exception message : Duplicate Criteria name Exist..
                                 throw new Exception("Save Search criteria already exist. Please choose a different criteria.");
                             }
                             else
                             {
                                 objXmlFinalDoc = AppendInnerToOuterXML(objXmlRootDoc, searchRequestXML, searchName, searchOrder, saveSearchRequestInformation);
                             }
                         }
                     }//end if

            }//end Try

            catch (Exception)
            {
                throw;
            }
            return objXmlFinalDoc;
        }