Пример #1
0
        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",
            }));
        }