Exemplo n.º 1
0
 private RouteModel CheckTermsNoFee(OnlineRegController ctl)
 {
     ctl.SetHeaders(this);
     if (PayAmount() == 0 && Terms.HasValue())
     {
         Log("ViewTerms");
         return RouteModel.ViewTerms("Other/Terms");
     }
     return null;
 }
Exemplo n.º 2
0
        public RouteModel CompleteRegistration(OnlineRegController ctl)
        {
            HistoryAdd("CompleteRegistration");

            var ret = CheckSpecialJavascript();
            if (ret != null)
                return ret;

            ret = CheckAskDonation(ctl);
            if (ret != null)
                return ret;

            if (List.Count == 0)
                return RouteModel.ErrorMessage("Can't find any registrants");

            RemoveLastRegistrantIfEmpty();

            UpdateDatum();

            ret = CheckNoFeesDue();
            if (ret != null)
                return ret;

            var terms = Util.PickFirst(Terms, "");
            if (terms.HasValue())
                ctl.ViewBag.Terms = terms;

            ret = CheckTermsNoFee(ctl);
            if (ret != null)
                return ret;

            ret = CheckAlreadyRegistered();
            if (ret != null)
                return ret;

            var pf = PaymentForm.CreatePaymentForm(this);

            #if DEBUG2
            pf.CheckTesting();
            #endif
            Log("PaymentForm");
            ctl.ModelState.Clear();
            return RouteModel.ViewPayment("Payment/Process", pf);
        }
Exemplo n.º 3
0
 private RouteModel CheckAskDonation(OnlineRegController ctl)
 {
     if (AskDonation() && !donor.HasValue && donation > 0)
     {
         ctl.SetHeaders(this);
         ctl.ModelState.AddModelError("donation",
             "Please indicate a donor or clear the donation amount");
         Log("AskDonation");
         return RouteModel.ViewAction("Other/AskDonation");
     }
     return null;
 }