protected void Page_Load(object sender, EventArgs e)
    {
        string         attendeeIdString = Request.QueryString["AttendeeId"];
        ParleyAttendee attendee         = ParleyAttendee.FromIdentity(Int32.Parse(attendeeIdString));
        Parley         parley           = attendee.Parley;

        string expectedSecurityCode =
            SHA1.Hash(attendee.PersonId.ToString() + parley.Identity.ToString()).Replace(" ", "").Substring(0, 8);

        if (attendee.Active)
        {
            this.LabelResult.Text = "This attendee has already been confirmed.";
        }
        else if (expectedSecurityCode == Request.QueryString["SecurityCode"])
        {
            attendee.Active = true;

            PWEvents.CreateEvent(EventSource.SignupPage, EventType.ParleyAttendeeConfirmed, attendee.PersonId,
                                 parley.OrganizationId, parley.GeographyId, attendee.PersonId, attendee.Identity,
                                 string.Empty);

            this.LabelResult.Text =
                "Attendance has been confirmed. Thank you for registering for the conference, and have fun!";
        }
        else
        {
            this.LabelResult.Text =
                "We were unable to match the attendee identity with the security code. No attendance was confirmed.";
        }
    }
示例#2
0
        protected void ButtonSignup_Click(object sender, EventArgs e)
        {
            if (!Page.IsValid)
            {
                return; // no action
            }

            // Sign up this attendee, and create event to send confirmation mail

            ParleyAttendee newAttendee = _parley.CreateAttendee(this.TextNameFirst.Text, this.TextNameLast.Text, this.TextEmail.Text, false);

            // Add options

            ParleyOptions options = _parley.Options;

            foreach (ParleyOption option in options)
            {
                CheckBox checkOption = (CheckBox)this.PlaceholderOptions.FindControl("CheckOption" + option.Identity.ToString());
                if (checkOption.Checked)
                {
                    newAttendee.AddOption(option);
                }
            }

            PWEvents.CreateEvent(EventSource.SignupPage, EventType.ParleyAttendeeCreated, newAttendee.PersonId,
                                 _parley.OrganizationId, _parley.GeographyId, newAttendee.PersonId, newAttendee.Identity,
                                 string.Empty);

            if (Request.UserLanguages.Length > 0)
            {
                newAttendee.Person.PreferredCulture = Request.UserLanguages[0];
            }

            this.PanelSignupCompleted.Visible = true;
            this.PanelSignup.Visible          = false;
        }
示例#3
0
        static public object FromBasic(IHasIdentity basic)
        {
            string argumentType = basic.GetType().ToString();

            switch (argumentType)
            {
            // ----- Is there any way to make self-writing code here through replication or similar, so
            // ----- that every case doesn't need to be listed?


            // ------------ COMMUNICATION CLASSES ------------

            case "Swarmops.Basic.Types.BasicCommunicationTurnaround":
                return(CommunicationTurnaround.FromBasic((BasicCommunicationTurnaround)basic));

            case "Swarmops.Basic.Types.Communications.BasicOutboundComm":
                return(OutboundComm.FromBasic((BasicOutboundComm)basic));

            case "Swarmops.Basic.Types.Communications.BasicOutboundCommRecipient":
                return(OutboundCommRecipient.FromBasic((BasicOutboundCommRecipient)basic));


            // ----------- FINANCIAL CLASSES ----------

            case "Swarmops.Basic.Types.BasicExpenseClaim":
                return(ExpenseClaim.FromBasic((BasicExpenseClaim)basic));

            case "Swarmops.Basic.Types.Financial.BasicCashAdvance":
                return(CashAdvance.FromBasic((BasicCashAdvance)basic));

            case "Swarmops.Basic.Types.BasicInboundInvoice":
                return(InboundInvoice.FromBasic((BasicInboundInvoice)basic));

            case "Swarmops.Basic.Types.Financial.BasicFinancialAccount":
                return(FinancialAccount.FromBasic((BasicFinancialAccount)basic));

            case "Swarmops.Basic.Types.Financial.BasicFinancialTransaction":
                return(FinancialTransaction.FromBasic((BasicFinancialTransaction)basic));

            case "Swarmops.Basic.Types.BasicFinancialValidation":
                return(FinancialValidation.FromBasic((BasicFinancialValidation)basic));

            case "Swarmops.Basic.Types.BasicOutboundInvoice":
                return(OutboundInvoice.FromBasic((BasicOutboundInvoice)basic));

            case "Swarmops.Basic.Types.BasicOutboundInvoiceItem":
                return(OutboundInvoiceItem.FromBasic((BasicOutboundInvoiceItem)basic));

            case "Swarmops.Basic.Types.BasicPayment":
                return(Payment.FromBasic((BasicPayment)basic));

            case "Swarmops.Basic.Types.BasicPaymentGroup":
                return(PaymentGroup.FromBasic((BasicPaymentGroup)basic));

            case "Swarmops.Basic.Types.BasicPayout":
                return(Payout.FromBasic((BasicPayout)basic));

            case "Swarmops.Basic.Types.BasicPayrollAdjustment":
                return(PayrollAdjustment.FromBasic((BasicPayrollAdjustment)basic));

            case "Swarmops.Basic.Types.BasicPayrollItem":
                return(PayrollItem.FromBasic((BasicPayrollItem)basic));

            case "Swarmops.Basic.Types.BasicSalary":
                return(Salary.FromBasic((BasicSalary)basic));

            case "Swarmops.Basic.Types.Financial.BasicFinancialTransactionTagSet":
                return(FinancialTransactionTagSet.FromBasic((BasicFinancialTransactionTagSet)basic));

            case "Swarmops.Basic.Types.Financial.BasicFinancialTransactionTagType":
                return(FinancialTransactionTagType.FromBasic((BasicFinancialTransactionTagType)basic));

            // ------------ GOVERNANCE CLASSES ------------

            case "Swarmops.Basic.Types.BasicBallot":
                return(Ballot.FromBasic((BasicBallot)basic));

            case "Swarmops.Basic.Types.BasicMeetingElectionCandidate":
                return(MeetingElectionCandidate.FromBasic((BasicInternalPollCandidate)basic));

            case "Swarmops.Basic.Types.BasicMeetingElection":
                return(MeetingElection.FromBasic((BasicInternalPoll)basic));

            case "Swarmops.Basic.Types.BasicMeetingElectionVote":
                return(MeetingElectionVote.FromBasic((BasicInternalPollVote)basic));

            case "Swarmops.Basic.Types.Governance.BasicMotion":
                return(Motion.FromBasic((BasicMotion)basic));

            case "Swarmops.Basic.Types.Governance.BasicMotionAmendment":
                return(MotionAmendment.FromBasic((BasicMotionAmendment)basic));


            // ------------ PARLEY/ACTIVISM CLASSES ------------

            case "Swarmops.Basic.Types.BasicExternalActivity":
                return(ExternalActivity.FromBasic((BasicExternalActivity)basic));

            case "Swarmops.Basic.Types.BasicParley":
                return(Parley.FromBasic((BasicParley)basic));

            case "Swarmops.Basic.Types.BasicParleyAttendee":
                return(ParleyAttendee.FromBasic((BasicParleyAttendee)basic));

            case "Swarmops.Basic.Types.BasicParleyOption":
                return(ParleyOption.FromBasic((BasicParleyOption)basic));

            case "Swarmops.Basic.Types.BasicPerson":
                return(Person.FromBasic((BasicPerson)basic));

            // ------------------ FAIL ----------------

            default:
                throw new NotImplementedException("Unimplemented argument type: " + argumentType);
            }
        }