Ejemplo n.º 1
0
        public IActionResult ListOrders()
        {
            List <ListOrderViewModel> models = new List <ListOrderViewModel>();

            foreach (var order in _orderRepository.GetOrders())
            {
                var model = new ListOrderViewModel()
                {
                    OrderId        = order.OrderId,
                    Email          = order.Email,
                    FullName       = order.FullName,
                    PhoneNumber    = order.PhoneNumber,
                    Address        = order.Address,
                    TotalPrice     = order.TotalPrice,
                    NoteToSalesMan = order.NoteToSalesMan,
                    OrderPlace     = order.OrderPlace
                };
                models.Add(model);
            }
            return(View(models));
        }