예제 #1
0
        public async Task <IActionResult> Order(ProductOrderInputModel productOrderInputModel)
        {
            OrderServiceModel orderServiceModel = productOrderInputModel.To <OrderServiceModel>();

            orderServiceModel.IssuerId = this.User.FindFirst(ClaimTypes.NameIdentifier).Value;

            await this.orderService.CreateOrder(orderServiceModel);

            return(this.Redirect("/"));
        }
예제 #2
0
        public async Task <IActionResult> Order(ProductOrderInputModel inputModel)
        {
            OrderServiceModel orderServiceModel = inputModel.To <OrderServiceModel>();

            //orderServiceModel.IssuerId = this.User.Identity.Name;
            //note: това търси този, който го е създал, а не този, който купува!!!! ?????

            orderServiceModel.IssuerId = this.User.FindFirst(ClaimTypes.NameIdentifier).Value;
            await this.orderService.CreateOrder(orderServiceModel);


            return(this.Redirect("/Home/Index"));
        }
예제 #3
0
        public async Task <IActionResult> Order(ProductOrderInputModel productOrderInputModel)
        {
            if (!ModelState.IsValid)
            {
                return(this.Redirect($"/Product/Details/{productOrderInputModel.ProductId}"));
            }

            var orderServiceModel = productOrderInputModel.To <OrderServiceModel>();

            orderServiceModel.IssuerId = this.User.FindFirst(ClaimTypes.NameIdentifier).Value;

            await this.orderService.CreateOrder(orderServiceModel);

            return(this.Redirect("/"));
        }