示例#1
0
        public async Task <IActionResult> AdvancedSearch(ProcessAdvancedSearchPost SearchData)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            var result = await _client.PostProtectedAsync <List <ProcessAdvancedSearchResult> >($"{_configuration["APIUrl"]}api/FrontProcess/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.UITerms = await _client.GetProtectedAsync<List<UITermLanguageCustomizationList>>($"{_configuration["APIUrl"]}api/MVC/FrontProcess/SearchResult", token);
            //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.Env = _hostingEnv.EnvironmentName;

            return(View("SearchResult", result));
        }
示例#2
0
        public async Task <IActionResult> AdvancedSearch(ProcessAdvancedSearchPost 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 _ProcessProvider.CreatePostCheck(Process);
                //if (CheckString.Length == 0)
                //{
                if (AdvancedSearch.Contains == null)
                {
                    AdvancedSearch.Contains = "";
                }
                if (AdvancedSearch.RoleId == null)
                {
                    AdvancedSearch.RoleId = "";
                }
                if (AdvancedSearch.SelectedUserId == null)
                {
                    AdvancedSearch.SelectedUserId = "";
                }
                var Result = await _processProvider.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 ProcessSearch = new ProcessAdvancedSearchPost();
                ProcessSearch.SelectedUsers = await _userProvider.List();

                ProcessSearch.Organizations = await _organizationProvider.List(CurrentUser.Id);

                ProcessSearch.Projects = await _projectProvider.List(CurrentUser.Id);

                ProcessSearch.Languages = await _languageProvider.ActiveList(CurrentUser.Id);

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

                ProcessSearch.ClassificationValues = await _classificationValueProvider.List(CurrentUser.Id);

                ProcessSearch.Contents = await _contentProvider.List();

                ProcessSearch.Countries = await _masterListProvider.CountryList(CurrentUser.Id);

                ProcessSearch.SecurityLevels = await _securityLevelProvider.List(CurrentUser.Id);

                ProcessSearch.Roles = await _roleProvider.List(CurrentUser.Id);

                ProcessSearch.Persons = await _personProvider.List();

                ProcessSearch.ProcessTypeStageTypes = await _processTypeStageTypeProvider.List(CurrentUser.Id);

                return(Ok(ProcessSearch));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
示例#4
0
        //public async Task<List<ProcessType>> GetProcessTypes(string UserId)
        //{
        //    string usp = "usp_ProcessTypes @UserID";
        //    var x = await _sqlDataAccess.LoadData<ProcessType, dynamic>(usp, new { UserId = UserId });
        //    return x;
        //}
        public Task <List <ProcessAdvancedSearchResult> > AdvancedSearch(string UserId, ProcessAdvancedSearchPost AdvancedSearch)
        {
            string usp = "usp_ProcessAdvancedSearch @UserId, @Contains, @Number, @DateFrom, @DateTo, @SelectedUserId, @OrganizationId, @ProjectId, @LanguageId, @ClassificationId, @ClassificationValueId, @ContentId, @CountryId, @SecurityLevelId, @RoleId, @PersonId, @ProcessTypeStageTypeId ";

            return(_sqlDataAccess.LoadData <ProcessAdvancedSearchResult, dynamic>(usp, AdvancedSearch));
        }