Пример #1
0
        public async Task <IActionResult> AdvancedSearch(FrontOrganizationAdvancedSearchGet SearchData)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            var result = await _client.PostProtectedAsync <List <OrganizationAdvancedSearchResult> >($"{_configuration["APIUrl"]}api/FrontOrganization/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/FrontOrganization/SearchResult", token);
            //ViewBag.Env = _hostingEnv.EnvironmentName;

            return(View("SearchResult", result));
        }
        public async Task <FrontOrganizationAdvancedSearchGet> FrontOrganizationAdvancedSearchGet(string UserId)
        {
            var AdvancedOrganizationSearch = new FrontOrganizationAdvancedSearchGet();

            string ParentOrganizationsUsp = "usp_OrganizationListParentOrganizations @UserId";

            AdvancedOrganizationSearch.ParentOrganizations = await _sqlDataAccess.LoadData <OrganizationList, dynamic>(ParentOrganizationsUsp, new { UserId = UserId });

            AdvancedOrganizationSearch.ParentOrganizations.Insert(0, new OrganizationList {
                OrganizationId = 0, Name = "Select a parent organization"
            });

            string StatusesUsp = "usp_StatusList @UserId";

            AdvancedOrganizationSearch.Statuses = await _sqlDataAccess.LoadData <StatusList, dynamic>(StatusesUsp, new { UserId = UserId });

            AdvancedOrganizationSearch.Statuses.Insert(0, new StatusList {
                StatusId = 0, Name = "Select a status"
            });


            string OrganizationTypesUsp = "usp_OrganizationTypeList @UserId";

            AdvancedOrganizationSearch.OrganizationTypes = await _sqlDataAccess.LoadData <OrganizationTypeList, dynamic>(OrganizationTypesUsp, new { UserId = UserId });

            AdvancedOrganizationSearch.OrganizationTypes.Insert(0, new OrganizationTypeList {
                OrganizationTypeId = 0, Name = "Select an organization type"
            });

            string CountriesUsp = "usp_CountryList @UserId";

            AdvancedOrganizationSearch.Countries = await _sqlDataAccess.LoadData <CountryList, dynamic>(CountriesUsp, new { UserId = UserId });

            AdvancedOrganizationSearch.Countries.Insert(0, new CountryList {
                CountryId = 0, Name = "Select an organization type"
            });

            return(AdvancedOrganizationSearch);
        }
        public async Task <List <OrganizationList> > FrontOrganizationAdvancedSearchPost(FrontOrganizationAdvancedSearchGet SearchData)
        {
            string usp = "usp_FrontOrganizationAdvancedSearchPost @UserId, @OrganizationName, @OrganizationParentId, @OrganizationStatusId, @OrganizationTypeId , @CountryId, @OrganizationProvinceState , @OrganizationCity , @LegalEntity, @Internal, @IAmMemberOfOrganization ";
            var    x   = await _sqlDataAccess.LoadData <OrganizationList, dynamic>(usp, SearchData);

            return(x);
        }