コード例 #1
0
ファイル: Confirm.cs プロジェクト: marius310/bvcms
        public RouteModel FinishRegistration(Transaction ti)
        {
            TranId = ti.Id;
            HistoryAdd("ProcessPayment");
            var ed = DbUtil.Db.RegistrationDatas.Single(dd => dd.Id == DatumId);

            ed.Data      = Util.Serialize(this);
            ed.Completed = true;
            DbUtil.Db.SubmitChanges();

            try
            {
                LogOutOfOnlineReg();
                var view = ConfirmTransaction(ti.TransactionId);
                switch (view)
                {
                case ConfirmEnum.Confirm:
                    return(RouteModel.ViewAction("Confirm", this));

                case ConfirmEnum.ConfirmAccount:
                    return(RouteModel.ViewAction("ConfirmAccount", this));
                }
            }
            catch (Exception ex)
            {
                Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
                return(RouteModel.ErrorMessage(ex.Message));
            }
            return(null);
        }
コード例 #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));
        }
コード例 #3
0
        private RouteModel CheckAlreadyRegistered()
        {
            var om = DbUtil.Db.OrganizationMembers.SingleOrDefault(
                mm => mm.OrganizationId == Orgid && mm.PeopleId == List[0].PeopleId);

            ParseSettings();

            if (om != null && settings[om.OrganizationId].AllowReRegister == false && !SupportMissionTrip)
            {
                Log("AlreadyRegistered");
                return(RouteModel.ErrorMessage("You are already registered it appears"));
            }
            return(null);
        }
コード例 #4
0
ファイル: Confirm.cs プロジェクト: bsbillings/bvcms
 public RouteModel ConfirmTransaction(Transaction ti)
 {
     try
     {
         LogOutOfOnlineReg();
         var view = ConfirmTransaction(ti.TransactionId);
         switch (view)
         {
             case ConfirmEnum.Confirm:
                 return RouteModel.ViewAction("Confirm", this);
             case ConfirmEnum.ConfirmAccount:
                 return RouteModel.ViewAction("ConfirmAccount", this);
         }
     }
     catch (Exception ex)
     {
         Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
         return RouteModel.ErrorMessage(ex.Message);
     }
     return null;
 }