Пример #1
0
        public ActionResult SaveOrder(int masterId, int managerId, int customerId, DateTime startDate)
        {
            Cart cart = new Cart();

            cart.GetFromCoockie(HttpContext);


            Order order = new Order()
            {
                ClientId = customerId, ManagerId = managerId, MasterId = masterId, StartDate = startDate
            };

            _orderServices.Create(order);
            var list = cart.OrderLine.Values.Select(x => new OrderInfo()
            {
                OrderNumber = order.Id, BuildStandart = x.BuildStandart, CountOfServicesRendered = x.Count
            });

            foreach (var item in list)
            {
                _orderInfoServise.Create(item);
            }
            cart.Clear();
            cart.SaveToCoockie(HttpContext);
            return(View());
        }
Пример #2
0
 private void CreateJunk()
 {
     _orderServices.Create(new Order
     {
         Id          = Guid.NewGuid(),
         CreatedDate = DateTime.Now
     });
 }
        public ActionResult <Guid> CreateOrder(OrderCreateRequestModel orderRequestModel)
        {
            var orderModel = _orderServices.Create(new OrderModel(orderRequestModel));

            return(orderModel.Id);
        }