// // GET: /Search/ #region Get Search Using MyQuries /// <summary> /// Get Search Form-- RaviM /// </summary> /// <param name="ddlValue"></param> /// <returns></returns> public ActionResult Search(int?ddlValue) { int userid = CurrentUser.UserId; string x = string.Empty; x = SearchBL.GetSearchName(ddlValue); SearchBL.SearchForm searchForm = new SearchBL.SearchForm(); searchForm.SearchName = x; if (ddlValue == null || ddlValue == 0) { searchForm.MyQueries = SearchBL.GetMyQueriesForSearch(userid, ddlValue); searchForm.MyQueryValue = Convert.ToInt32(ddlValue); return(View(searchForm)); } else { searchForm.ResultQuery = SearchBL.GetSearchQuery(userid, x, ddlValue); searchForm.AbstractMask = Convert.ToBoolean(searchForm.ResultQuery.AbstractMask); searchForm.MyQueries = SearchBL.GetMyQueriesForSearch(userid, ddlValue); searchForm.MyQueryValue = Convert.ToInt32(ddlValue); return(View(searchForm)); } }
/// <summary> /// Copy Citations to library Folder. - RaviM /// </summary> /// <param name="Model"></param> /// <param name="MID"></param> /// <param name="Collection"></param> /// <param name="start"></param> /// <returns></returns> public ActionResult CopyCitation(SearchBL.SearchForm Model, int MID, FormCollection Collection, int start = 1) { bool keepDelete; if (Collection["KeepDelete"] == "0") { keepDelete = false; } else { keepDelete = true; } short?DateEnd = Convert.ToInt16(Collection["dateEnd"]); if (!string.IsNullOrEmpty(Collection["ddlUserSubTopic"])) { var Result = SearchBL.CopyCitation(MID, Collection["ddlUserSubTopic"], CurrentUser.UserId, Convert.ToInt32(Collection["SearchId"]), DateEnd, keepDelete); return(RedirectToAction("index", "mylibrary", new { specid = Result, oid = Model.FolderID, fid = Collection["ddlUserSubTopic"], selaction = "saved", start = start })); } else { alert(new MyResult() { Tittle = "Copy Citiations", Message = "Select Sub Topic", restype = false }); return(RedirectToAction("SearchDetails", "Search", new { PMID = MID })); } return(RedirectToAction("SearchDetails", "Search", new { PMID = MID })); }
/// <summary> /// Get Search Results View .. Search Post will be done through Ajax method - RaviM /// </summary> /// <param name="Model"></param> /// <returns></returns> public ActionResult SearchResults(int start = 1, string range = "20") { SearchBL.SearchForm obj = new SearchBL.SearchForm(); if (Session["SearchLimits"] != null) { SearchBL.MyQueryForm myQyeryForm = new SearchBL.MyQueryForm(); int userid = CurrentUser.UserId; obj = (SearchBL.SearchForm)Session["SearchLimits"]; int RangeCount = int.Parse(range); myQyeryForm.searchInfo = SearchBL.GetSearchInfo(userid, obj.SearchName, Convert.ToInt32(obj.SearchId)); obj.ArticlesList = SearchBL.SearchFetchRange(userid, obj.SearchName, obj.SearchId, start, start + (RangeCount - 1)); StringBuilder str = new StringBuilder(); if (obj.ArticlesList != null) { foreach (var item in obj.ArticlesList) { str.Append(item.PMID + ","); } } string PMIDList = str.ToString(); if (!string.IsNullOrEmpty(PMIDList)) { PMIDList = PMIDList.Remove(PMIDList.LastIndexOf(','), 1); } obj.AllCitationDetails = SearchBL.GetAllCitationAbstract(CurrentUser.UserId, PMIDList, 2, 1); obj.QueryDetails = myQyeryForm.searchInfo.QueryDetails; obj.ErrorDesc = myQyeryForm.searchInfo.ErrorDesc; obj.CitationCount = Convert.ToInt32(myQyeryForm.searchInfo.SearchResultsCount); obj.TopicsList = SearchBL.GetTopicsList(CurrentUser.UserId); Session["SearchLimits"] = obj; obj.DisplayCount = range; if (Session["SearchResults"] != null) { SearchBL.SearchForm keep = (SearchBL.SearchForm)Session["SearchResults"]; obj.showGoToDestionation = keep.showGoToDestionation; obj.TopicFolderID = keep.FolderID; obj.SpecId = keep.SpecId; obj.resultFolder2 = keep.resultFolder2; } Session["SearchResults"] = null; return(View(obj)); } else { return(RedirectToAction("Search", "Search")); } return(View(obj)); }
public ActionResult Search(SearchBL.SearchForm Model) { Session["SearchLimits"] = null; var result = SearchBL.DeleteSearchQuery(CurrentUser.UserId);//no need to check isDeleted or not to Add new search query. var newSearchID = SearchBL.SearchQueryAdd(Model, CurrentUser.UserId); Model.SearchId = newSearchID; Session["SearchLimits"] = Model; return(Json(true, JsonRequestBehavior.AllowGet)); }
/// <summary> /// Get the search details based on PMID - RaviM /// </summary> /// <param name="PMID"></param> /// <returns></returns> public ActionResult SearchDetails(int?PMID, bool FromPMedline = false) { int ID = Convert.ToInt32(PMID); SearchBL.SearchForm obj = new SearchBL.SearchForm(); obj.TopicsList = SearchBL.GetTopicsList(CurrentUser.UserId); obj.AbstractCommentsECList = MyLibraryBL.GetAbstractCommentsEC(ID); obj.CitationDetails = SearchBL.GetCitationabstract(CurrentUser.UserId, ID.ToString(), 2, 1); obj.SearchId = obj.SearchId; obj.PMID = ID; obj.FolderID = 0; if (FromPMedline) { obj.FromPMedline = true; } return(View(obj)); }
/// <summary> /// Keep the checked Citations in - RaviM /// </summary> /// <param name="keep"></param> /// <returns></returns> public ActionResult Action(SearchBL.SearchForm keep) { if (keep.Parameters != null) { string[] PMIDList = keep.Parameters.Split(','); if (keep.resultFolder2 != null) { foreach (string pmid in PMIDList) { var Result = SearchBL.CopyCitation(Convert.ToInt32(pmid), keep.resultFolder2, CurrentUser.UserId, keep.SearchId, Convert.ToInt16(keep.DateEnd), true); keep.SpecId = Result; keep.showGoToDestionation = true; Session["SearchResults"] = keep; } return(RedirectToAction("SearchResults", "Search")); } } return(View(keep)); }