Exemple #1
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",
            }));
        }