Beispiel #1
0
        public ActionResult Contract()
        {
            ShoppingCartVMService.Clear();
            var order = OrderService.GetCurrentOrder();

            if (order == null || order.IsEmpty)
            {
                return(RedirectToCart());
            }
            order.Manager_TC = CartService.GetOrderManagerTC(order.OrderID);
            order.Started    = true;
            order.UpdateDate = DateTime.Now;
            foreach (var orderDetail in order.OrderDetails)
            {
                if (CartService.AddForeignDelivery(orderDetail))
                {
                    break;
                }
            }

            OrderService.SubmitChanges();

            var model = ContractVMService.GetContractVM();

            if (model.Cart.Order.IsOrganization == User.IsCompany)
            {
                return(RedirectToAction(() => PaymentTypeChoice(order.OrderID)));
            }
            CartService.Clear();
            return(RedirectToCart());
        }