Ejemplo n.º 1
0
        public IActionResult History(int id)
        {
            var query  = new CustomerHistoryEFQuery(_context);
            var result = query.Execute(id).orders.Select(o => new
            {
                o.id,
                lastModified = o.lastModified.ToString("MM/dd/yyyy H:mm"),
                status       = OrderPresenter.PresenetStatus(o.status)
            });

            return(Json(result));
        }
Ejemplo n.º 2
0
        public ActionResult Details(int id)
        {
            var query  = new OrderDetailsEFQuery(_context);
            var result = query.Execute(id);

            return(Json(new
            {
                result.id,
                status = OrderPresenter.PresenetStatus(result.status),
                creatAt = result.createdAt.ToString("MM/dd/yyyy H:mm"),
                products = result.products.Select(p => new
                {
                    p.id,
                    p.name,
                    p.sku,
                    p.descripciton,
                    status = OrderPresenter.PresentStatus(p.status)
                })
            }));
        }