public ResultModel GetOrdersPage(int startIndex, int pageSize, int?clientId) { int total; var orders = _shopOrderService.GetOrderPage(startIndex, pageSize, out total, clientId); var res = new { Total = total, Orders = orders }; return(new ResultModel(true, res)); }
public ActionResult Personal() { RoPrincipal currentPrincipal = Thread.CurrentPrincipal as RoPrincipal; if (currentPrincipal == null) { return(new HttpUnauthorizedResult()); } var client = _clientService.GetClientByUserId(currentPrincipal.UserId); //IEnumerable<Order> orders = _clientService.GetOrdersByUserId(currentPrincipal.UserId); if (client != null) { int total; IEnumerable <Order> orders = _shopOrderService.GetOrderPage(1, Int32.MaxValue, out total, client.ClientId); ViewBag.Orders = orders; } return(View(client)); }