/// <summary>
        /// Encodes search results before saving to the list.
        /// </summary>
        /// <param name="searchDetails">SavedSearchDetails object containing Current search details</param>
        /// <param name="isMatterSearch">Flag for matter or document search (true = matter, false = document)</param>
        internal static void EncodeSearchDetailsUtility(FilterObject searchDetails, Boolean isMatterSearch)
        {
            if (isMatterSearch && null != searchDetails.Name) // Encode name only in case of Matter search
            {
                searchDetails.Name = Encoder.HtmlEncode(searchDetails.Name);
            }

            if (null != searchDetails.ResponsibleAttorneys)
            {
                searchDetails.ResponsibleAttorneys = Encoder.HtmlEncode(searchDetails.ResponsibleAttorneys);
            }

            if (null != searchDetails.SubareaOfLaw)
            {
                searchDetails.SubareaOfLaw = Encoder.HtmlEncode(searchDetails.SubareaOfLaw);
            }
        }
        /// <summary>
        /// Encodes search results before saving to the list.
        /// </summary>
        /// <param name="searchDetails">SavedSearchDetails object containing Current search details</param>
        /// <param name="isMatterSearch">Flag for matter or document search (true = matter, false = document)</param>
        internal static void EncodeSearchDetails(FilterObject searchDetails, Boolean isMatterSearch)
        {
            // Encode all the values which are coming from the JS file
            searchDetails.FromDate = (null != searchDetails.FromDate) ? Encoder.HtmlEncode(searchDetails.FromDate) : string.Empty;
            searchDetails.ToDate = (null != searchDetails.ToDate) ? Encoder.HtmlEncode(searchDetails.ToDate) : string.Empty;

            if (null != searchDetails.AOLList)
            {
                IList<string> encodedAOLList = new List<string>();
                foreach (string aolList in searchDetails.AOLList)
                {
                    if (!string.IsNullOrWhiteSpace(aolList))
                    {
                        encodedAOLList.Add(Encoder.HtmlEncode(aolList));
                    }
                }
                searchDetails.AOLList = encodedAOLList;
            }

            if (null != searchDetails.PGList)
            {
                IList<string> encodedPGList = new List<string>();
                foreach (string pgList in searchDetails.PGList)
                {
                    if (!string.IsNullOrWhiteSpace(pgList))
                    {
                        encodedPGList.Add(Encoder.HtmlEncode(pgList));
                    }
                }
                searchDetails.PGList = encodedPGList;
            }

            if (null != searchDetails.ClientsList)
            {
                IList<string> encodedClientsList = new List<string>();
                foreach (string clientsList in searchDetails.ClientsList)
                {
                    if (!string.IsNullOrWhiteSpace(clientsList))
                    {
                        encodedClientsList.Add(Encoder.HtmlEncode(clientsList));
                    }
                }
                searchDetails.ClientsList = encodedClientsList;
            }

            EncodeSearchDetailsUtility(searchDetails, isMatterSearch);
        }