Пример #1
0
        public async Task <IActionResult> AdvancedSearch(ClassificationValueAdvancedSearchPost SearchData)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            var result = await _client.PostProtectedAsync <List <ClassificationValueAdvancedSearchResult> >($"{_configuration["APIUrl"]}api/FrontClassificationValue/AdvancedSearch", SearchData, token);

            ViewBag.AllStuff = await _loadViewBagModel.ViewBagLoad(this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString(), token, _hostingEnv.EnvironmentName, _configuration, false, 0, "");

            //ViewBag.Favorites = await _client.GetProtectedAsync<List<MVCFavoriteMenu>>($"{_configuration["APIUrl"]}api/MVCFavorite/Menu", token);
            //ViewBag.FavoriteGroupList = await _client.GetProtectedAsync<List<MVCFavoriteGroupList>>($"{_configuration["APIUrl"]}api/MVCFavorite/GroupList", token);
            //ViewBag.UITerms = await _client.GetProtectedAsync<List<UITermLanguageCustomizationList>>($"{_configuration["APIUrl"]}api/MVC/FrontClassificationValue/SearchResult", token);
            //ViewBag.Env = _hostingEnv.EnvironmentName;

            return(View("SearchResult", result));
        }
Пример #2
0
        public async Task <IActionResult> AdvancedSearch(ClassificationValueAdvancedSearchPost AdvancedSearch)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            AdvancedSearch.UserId = CurrentUser.Id;
            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                //var CheckString = await _ClassificationValueProvider.CreatePostCheck(ClassificationValue);
                //if (CheckString.Length == 0)
                //{
                if (AdvancedSearch.Contains == null)
                {
                    AdvancedSearch.Contains = "";
                }
                if (AdvancedSearch.ClassificationId == null)
                {
                    AdvancedSearch.ClassificationId = 0;
                }
                if (AdvancedSearch.DateLevelId == null)
                {
                    AdvancedSearch.DateLevelId = 1;
                }
                if (AdvancedSearch.PersonId == null)
                {
                    AdvancedSearch.PersonId = 0;
                }
                var Result = await _classificationValueProvider.AdvancedSearch(CurrentUser.Id, AdvancedSearch);

                return(Ok(Result));

                //}
                return(BadRequest(new
                {
                    IsSuccess = false,
                    //Message = CheckString,
                }));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Пример #3
0
        public async Task <IActionResult> AdvancedSearch()
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                var ClassificationValueSearch = new ClassificationValueAdvancedSearchPost();
                ClassificationValueSearch.DateLevels = await _dateLevelProvider.List(CurrentUser.Id);

                ClassificationValueSearch.Classifications = await _classificationProvider.List(CurrentUser.Id);

                ClassificationValueSearch.Persons = await _personProvider.List();

                return(Ok(ClassificationValueSearch));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Пример #4
0
        public Task <List <ClassificationValueAdvancedSearchResult> > AdvancedSearch(string UserId, ClassificationValueAdvancedSearchPost AdvancedSearch)
        //    public async Task<string> AdvancedSearch(string UserId, ClassificationValueAdvancedSearchPost AdvancedSearch)
        {
            string usp = "usp_ClassificationValueAdvancedSearch @UserId, @Contains, @ClassificationId, @DateLevelId, @DateFrom, @DateTo, @PersonId";

            //            var x = await _sqlDataAccess.LoadSingleRecord<string, dynamic>(usp, AdvancedSearch);
            //          return x;
            return(_sqlDataAccess.LoadData <ClassificationValueAdvancedSearchResult, dynamic>(usp, AdvancedSearch));
        }