Exemple #1
0
        public virtual ActionResult ReturnRequest(int orderId)
        {
            var order = _orderService.GetOrderById(orderId);

            if (order == null || order.Deleted || _workContext.CurrentCustomer.Id != order.CustomerId)
            {
                return(new HttpUnauthorizedResult());
            }

            if (!_orderProcessingService.IsReturnRequestAllowed(order))
            {
                return(RedirectToRoute("HomePage"));
            }

            var model = new SubmitReturnRequestModel();

            model = _returnRequestModelFactory.PrepareSubmitReturnRequestModel(model, order);
            return(View(model));
        }
        public virtual ActionResult ReturnRequest(int subscriptionId)
        {
            var subscription = _subscriptionService.GetOrderById(subscriptionId);

            if (subscription == null || subscription.Deleted || _workContext.CurrentCustomer.Id != subscription.CustomerId)
            {
                return(new HttpUnauthorizedResult());
            }

            if (!_subscriptionProcessingService.IsReturnRequestAllowed(subscription))
            {
                return(RedirectToRoute("HomePage"));
            }

            var model = new SubmitReturnRequestModel();

            model = _returnRequestModelFactory.PrepareSubmitReturnRequestModel(model, subscription);
            return(View(model));
        }