Esempio n. 1
0
        public ActionResult ConfirmOrder()
        {
            string userName = this.User.Identity.Name;

            ConfirmedOrderVm vm = service.GetOrderId(userName);

            return(View(vm));
        }
Esempio n. 2
0
        public ConfirmedOrderVm GetOrderId(string userName)
        {
            Customer customer = Context.Customers.FirstOrDefault(cust => cust.User.UserName == userName);

            Order order   = Context.Orders.OrderByDescending(order1 => order1.Id).FirstOrDefault(ord => ord.Buyer.Id == customer.Id);
            int   orderId = order.Id;

            ConfirmedOrderVm vm = new ConfirmedOrderVm()
            {
                OrderId = orderId
            };

            return(vm);
        }