Exemplo n.º 1
0
        /**
         * Purpose: Redirects the user to the Payment Type Creation view
         * Return:
         *      Payment Type creation view
         */
        public async Task <IActionResult> Create()
        {
            var user = await GetCurrentUserAsync();

            var model = new PaymentTypeView(context, user);

            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult Purchase(PaymentTypeView paymentTypeView)
        {
            PaymentType payment = new PaymentType();

            var autoPayment = AutoMapper.Mapper.Map(paymentTypeView, payment);

            _unitOfWork.Payment.PurchaseCourse(autoPayment);
            return(RedirectToAction("ThankYouForPurchasing"));
        }
        public async Task <IActionResult> Create(PaymentTypeView paymentType)
        {
            paymentType.NewPaymentType.UserId = ActiveUser.Instance.User.UserId;
            if (ModelState.IsValid)
            {
                context.Add(paymentType.NewPaymentType);
                await context.SaveChangesAsync();

                return(RedirectToAction("Final", new RouteValueDictionary(

                                            new { controller = "Order", action = "Final", Id = paymentType.NewPaymentType.PaymentTypeId })));
            }

            var model = new PaymentTypeView(context);

            model.NewPaymentType = paymentType.NewPaymentType;

            return(View(model));
        }
        /**
         * Purpose: Redirects the user to the Payment Type Creation view
         * Return:
         *      Payment Type creation view
         */
        public IActionResult Create()
        {
            var model = new PaymentTypeView(context);

            return(View(model));
        }