Esempio n. 1
0
        public ActionResult MakeOrder(MakeOrderRequest request)
        {
            var userId = CurrentUser.UserId;

            if (userId == Guid.Empty)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var order = _orderRepository.MakeOrder(userId, request);

            EmailUtils.SendUserOrderEmail(CurrentUser.FullName, CurrentUser.Email, order);
            EmailUtils.SendAdminOrderEmail();

            return(new HttpStatusCodeResult(HttpStatusCode.OK));
        }