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); }
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)); }
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); }
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; }