public ActionResult QueryCitationAbstract(string sort = "date", string searchfolder = "", int MID = 0, int Search = 0)
        {
            SearchBL.MyQueryForm myQyeryForm = new SearchBL.MyQueryForm();

            List <SearchBL.MyQueryForm> myQueriesList = new List <SearchBL.MyQueryForm>();

            myQueriesList             = SearchBL.MyQueriesList(CurrentUser.UserId);
            myQyeryForm.myQueriesList = myQueriesList;

            myQyeryForm.Isendemail = SearchBL.GetIsSendEmail(CurrentUser.UserId);
            myQyeryForm.TopicsList = SearchBL.GetTopicsList(CurrentUser.UserId);
            if (MID != 0)
            {
                CitationsModel pmid = new CitationsModel();
                pmid.pmid = MID;
                List <CitationsModel> PMIDCitation = new List <CitationsModel>();
                PMIDCitation.Add(pmid);
                myQyeryForm.CitationDetails        = SearchBL.GetCitationDetails(PMIDCitation, sort, CurrentUser.UserId, 2);
                myQyeryForm.UserComment            = MyLibraryBL.GetUserComment(MID, CurrentUser.UserId);
                myQyeryForm.AbstractCommentsECList = MyLibraryBL.GetAbstractCommentsEC(MID);
                myQyeryForm.SearchID = Search; myQyeryForm.queryDetails = SearchBL.GetSearchQuery(CurrentUser.UserId, "", Search);
            }
            return(View(myQyeryForm));
        }
        //
        // GET: /MyQueries/

        #region

        public ActionResult MyQueries(int?FID, int?searchid, string SearchName, string searchfolder = "", int start = 1)
        {
            int userid = AJA_Core.CurrentUser.UserId;

            SearchBL.MyQueryForm        myQyeryForm   = new SearchBL.MyQueryForm();
            List <SearchBL.MyQueryForm> myQueriesList = new List <SearchBL.MyQueryForm>();

            myQueriesList             = SearchBL.MyQueriesList(userid);
            myQyeryForm.myQueriesList = myQueriesList;
            myQyeryForm.Isendemail    = SearchBL.GetIsSendEmail(userid);
            if (searchid != 0 && !string.IsNullOrEmpty(SearchName))
            {
                myQyeryForm.queryDetails = SearchBL.GetSearchQuery(userid, SearchName, searchid);
                myQyeryForm.searchInfo   = SearchBL.GetSearchInfo(userid, SearchName, Convert.ToInt32(searchid));
                SearchBL.ManageQuery MQ = new SearchBL.ManageQuery();
                MQ.SearchId    = searchid; MQ.QueryDetails = myQyeryForm.searchInfo.QueryDetails; MQ.Name = myQyeryForm.queryDetails.SearchName;
                MQ.Description = myQyeryForm.queryDetails.Description; MQ.Autosearch = Convert.ToBoolean(myQyeryForm.queryDetails.AutoSearch);
                MQ.KeepDelete  = Convert.ToInt32(myQyeryForm.queryDetails.KeepDelete);
                MQ.ShelfLife   = myQyeryForm.queryDetails.ShelfLife.ToString();

                if (FID != 0)
                {
                    myQyeryForm.queryDestination = SearchBL.GetQueryDestination(Convert.ToInt32(FID));
                    MQ.FolderID = FID;
                    if (myQyeryForm.queryDestination != null)
                    {
                        MQ.DestinationFolder = myQyeryForm.queryDestination.SpecialtyName + " / " + myQyeryForm.queryDestination.TopicName + " / " + myQyeryForm.queryDestination.SubTopicName;
                    }

                    myQyeryForm.Citations = SearchBL.GetSearchCitations(Convert.ToInt32(searchid), CurrentUser.UserId);

                    if (myQyeryForm.Citations.Count > 0)
                    {
                        myQyeryForm.CitationDetails = MyLibraryBL.GetCitationDetails(myQyeryForm.Citations, "date", CurrentUser.UserId, 1);
                        TimeSpan timespan = (DateTime.Now - Convert.ToDateTime(myQyeryForm.Citations[0].expiredate));
                        if (myQyeryForm.Citations[0].keepdelete)
                        {
                            myQyeryForm.TrackDays = timespan.Days.ToString() + " days until keep";
                        }
                        else
                        {
                            myQyeryForm.TrackDays = timespan.Days.ToString() + " days until delete";
                        }
                    }
                    else
                    {
                        myQyeryForm.CitationDetails = null;
                    }
                }
                if (!string.IsNullOrEmpty(searchfolder))
                {
                    myQyeryForm.CitationDetails = myQyeryForm.CitationDetails.Where(c => c.pmid.ToString() == searchfolder || (c.AuthorList ?? "").Contains(searchfolder) || (c.ArticleTitle ?? "").Contains(searchfolder) || (c.MedlinePgn ?? "").Contains(searchfolder) || (c.MedlineTA ?? "").Contains(searchfolder)).ToList();
                }
                if (myQyeryForm.CitationDetails != null)
                {
                    myQyeryForm.CitationDetailsTotal = myQyeryForm.CitationDetails;
                    myQyeryForm.CitationDetails      = myQyeryForm.CitationDetailsTotal.Skip(start - 1).Take(15).ToList();
                }

                Session["ManageQuery"] = MQ;
            }
            return(View(myQyeryForm));
        }