Пример #1
0
        //the tutor is shown a list and then a tutor can process logging payments for a class or session
        //validation has been considered
        //
        public ActionResult ProcessingLogPayment(Customer customer, int id)
        {
            if (customer.UserId == null || id == 0)
            {
                return(RedirectToAction("LogPayment"));
            }

            var check = _tutorRepository.TutorLogCustomerPayment(customer.UserId, id);

            var bookings = _tutorRepository.GetUserBookingsByUserId(customer.UserId);
            var cust     = _customerRepository.GetCustomerByUserId(customer.UserId);
            var vModel   = new PaymentLogViewModel
            {
                Bookings = bookings,
                Customer = cust
            };

            if (check == false)
            {
                ViewData["Message"] = "Something went wrong with processing payment.";
                return(View("ProcessLogPayment", vModel));
            }

            ViewData["Message"] = "Payment succesfully received!";
            return(View("ProcessLogPayment", vModel));
        }
Пример #2
0
        //this method processes the logging payment for a customer
        //and shows the page to a tutor that can process the logging payment
        public ActionResult ProcessLogPayment(Customer customer)
        {
            if (customer.UserId == null)
            {
                return(RedirectToAction("LogPayment"));
            }

            var bookings = _tutorRepository.GetUserBookingsByUserId(customer.UserId);
            var cust     = _customerRepository.GetCustomerByUserId(customer.UserId);
            var vModel   = new PaymentLogViewModel
            {
                Bookings = bookings,
                Customer = cust
            };

            return(View(vModel));
        }
Пример #3
0
 public IHttpActionResult PayAmountLog(PaymentLogViewModel payment)
 {
     return(Ok(services.payAmountLog(payment).Data));
 }