Пример #1
0
 /// <summary>
 /// Determines whether [is doc lib file exist] [the specified doc lib name].
 /// </summary>
 /// <param name="docLibName">Name of the doc lib.</param>
 /// <param name="userID">The user ID.</param>
 /// <returns>
 /// 	<c>true</c> if [is doc lib file exist] [the specified doc lib name]; otherwise, <c>false</c>.
 /// </returns>
 public bool IsDocLibFileExist(string docLibName, string userID)
 {
     objSaveSearchHandler = new SaveSearchHandler();
     bool blnIsDocLibFileExist = false;
     try
     {
         blnIsDocLibFileExist = objSaveSearchHandler.IsDocLibFileExist(docLibName, userID);
     }
     catch(Exception)
     {
         throw;
     }
     return blnIsDocLibFileExist;
 }
Пример #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;
        }