public IActionResult PagingConditionPrice(string condition, int pageIndex, int pageSize, string sortOrder, int priceStart, int priceEnd)
        {
            var claims = User.Claims.Select(claim => new { claim.Type, claim.Value }).ToDictionary(t => t.Type, t => t.Value);

            if (claims.ContainsKey("name"))
            {
                if (claims["name"].Equals("ADMIN") || claims["name"].Equals("MANAGER"))
                {
                    return(Ok(_repository.PagingConditionPrice(condition, pageIndex, pageSize, sortOrder, priceStart, priceEnd)));
                }
            }
            else
            {
                return(Forbid());
            }
            return(Forbid());
        }
示例#2
0
 public IActionResult PagingConditionPrice(string condition, int pageIndex, int pageSize, string sortOrder, int priceStart, int priceEnd)
 {
     return(Ok(_repository.PagingConditionPrice(condition, pageIndex, pageSize, sortOrder, priceStart, priceEnd)));
 }