public async Task <ActionResult> Index(string CredId, string dataSetIndexId, string dataSetId, string pageNumber, string pageSize, string Search, string sortby)
        {
            if (!string.IsNullOrEmpty(Convert.ToString(TempData["msg"])))
            {
                ViewBag.msg = Convert.ToString(TempData["msg"]);
            }
            else
            {
                ViewBag.msg = "";
            }
            if (string.IsNullOrEmpty(pageNumber))
            {
                pageNumber = "1";
            }
            if (string.IsNullOrEmpty(pageSize))
            {
                pageSize = "10";
            }
            if (string.IsNullOrWhiteSpace(Search))
            {
                Search = string.Empty;
            }
            if (string.IsNullOrEmpty(sortby))
            {
                sortby = "datecreated";
            }
            SearchPatternViewModel objSearchPatternViewModel = new SearchPatternViewModel();
            await objSearchPatternViewModel.dataSetName(Session, dataSetId);

            await objSearchPatternViewModel.GetAllSearchPattern(Session, CredId, pageNumber, pageSize, Search, sortby);

            await objSearchPatternViewModel.GetLatestFile(Session, CredId);

            objSearchPatternViewModel.dataSetId          = dataSetId;
            objSearchPatternViewModel.dataSetIndexId     = dataSetIndexId;
            objSearchPatternViewModel.dataSetIndexCredId = CredId;

            objSearchPatternViewModel.pageNumber = pageNumber;
            objSearchPatternViewModel.pageSize   = pageSize;
            objSearchPatternViewModel.Search     = Search;
            objSearchPatternViewModel.sortby     = sortby;

            if (objSearchPatternViewModel.errorOccurred)
            {
                return(RedirectToAction("Index", "Authenticate"));
            }
            else
            {
                return(View(objSearchPatternViewModel));
            }
        }
        public async Task <ActionResult> Reviewed(string CredId, string dataSetIndexId, string dataSetId, string pageNumber, string pageSize, string Search, string sortby)
        {
            if (string.IsNullOrEmpty(pageNumber))
            {
                pageNumber = "1";
            }
            if (string.IsNullOrEmpty(pageSize))
            {
                pageSize = "10";
            }
            if (string.IsNullOrWhiteSpace(Search))
            {
                Search = string.Empty;
            }
            if (string.IsNullOrEmpty(sortby))
            {
                sortby = "filename";
            }
            SearchPatternViewModel objSearchPatternViewModel = new SearchPatternViewModel();

            await objSearchPatternViewModel.dataSetName(Session, dataSetId);

            objSearchPatternViewModel.objreviewed = new List <Reviewed>();
            await objSearchPatternViewModel.GetAllReviewed(Session, CredId, pageNumber, pageSize, Search, sortby);

            objSearchPatternViewModel.dataSetId          = dataSetId;
            objSearchPatternViewModel.dataSetIndexId     = dataSetIndexId;
            objSearchPatternViewModel.dataSetIndexCredId = CredId;

            objSearchPatternViewModel.pageNumber = pageNumber;
            objSearchPatternViewModel.pageSize   = pageSize;
            objSearchPatternViewModel.Search     = Search;
            objSearchPatternViewModel.sortby     = sortby;

            if (objSearchPatternViewModel.errorOccurred)
            {
                return(RedirectToAction("Index", "Authenticate"));
            }
            else
            {
                return(View(objSearchPatternViewModel));
            }
        }