public async Task <IActionResult> AdvancedSearch(ProjectAdvancedSearchPost 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 _ProjectProvider.CreatePostCheck(Project); //if (CheckString.Length == 0) //{ if (AdvancedSearch.Contains == null) { AdvancedSearch.Contains = ""; } var Result = await _projectProvider.AdvancedSearch(AdvancedSearch); return(Ok(Result)); //} return(BadRequest(new { IsSuccess = false, //Message = CheckString, })); } return(BadRequest(new { IsSuccess = false, Message = "No rights", })); }
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 ProjectAdvancedSearch = new ProjectAdvancedSearchPost(); ProjectAdvancedSearch.SecurityLevels = await _securityLevelProvider.List(CurrentUser.Id); ProjectAdvancedSearch.ParentProjects = await _projectProvider.List(CurrentUser.Id); ProjectAdvancedSearch.Statuses = await _masterListProvider.StatusList(CurrentUser.Id); ProjectAdvancedSearch.ProjectTypes = await _projectTypeProvider.List(CurrentUser.Id); ProjectAdvancedSearch.Persons = await _personProvider.List(); // ProjectAdvancedSearch = await _projectProvider.FrontProjectAdvancedSearchGet(CurrentUser.Id); return(Ok(ProjectAdvancedSearch)); } return(BadRequest(new { IsSuccess = false, Message = "No rights", })); }
public async Task <IActionResult> AdvancedSearch(ProjectAdvancedSearchPost SearchData) { var token = HttpContext.Session.GetString("Token"); if (token == null) { return(RedirectToAction("Login", "FrontAuth")); } var result = await _client.PostProtectedAsync <List <ProjectAdvancedSearchResult> >($"{_configuration["APIUrl"]}api/FrontProject/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/FrontProject/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)); }
public Task <List <ProjectAdvancedSearchResult> > AdvancedSearch(ProjectAdvancedSearchPost AdvancedSearch) { string usp = "usp_ProjectAdvancedSearch @UserId, @Contains, @ParentProjectId, @ProjectTypeId, @SecurityLevelId, @StatusId, @PersonId "; return(_sqlDataAccess.LoadData <ProjectAdvancedSearchResult, dynamic>(usp, AdvancedSearch)); }