示例#1
0
        protected override void OnInit(EventArgs e)
        {
            DetailsXFormControl.FormDefinition = XForm.CreateInstance(new Guid((CurrentData as EventPageBase).RegistrationForm.Id.ToString()));

            string email = Request.QueryString["email"];
            string code  = Request.QueryString["code"];

            HiddenCode.Value  = code;
            HiddenEmail.Value = email;


            if (!string.IsNullOrEmpty(email) && !string.IsNullOrEmpty(code))
            {
                IParticipant participant = AttendRegistrationEngine.GetParticipant(email, code);
                if (participant != null)
                {
                    SerializableXmlDocument xmlDoc = new SerializableXmlDocument();
                    xmlDoc.LoadXml(participant.XForm);
                    DetailsXFormControl.Data.Data = xmlDoc;
                }
            }

            SessionsPanel.Controls.Add(AttendSessionEngine.GetSessionsControl(CurrentData.ContentLink, null));
            SessionsPanel.DataBind();
            base.OnInit(e);
        }
        public IEnumerable <ISelectItem> GetSelections(ExtendedMetadata metadata)
        {
            if ((metadata.Model as PropertyData) == null || (metadata.Model as PropertyData).Parent["icontent_contentlink"] == null || string.IsNullOrEmpty((metadata.Model as PropertyData).Parent["icontent_contentlink"].ToString()))
            {
                yield break;
            }

            var           ownerPage     = new ContentReference((metadata.Model as PropertyData).Parent["icontent_contentlink"].ToString());
            EventPageBase EventPageBase = EPiServer.DataFactory.Instance.Get <EventPageBase>(ownerPage);

            if (EventPageBase.RegistrationForm == null)
            {
                yield break;
            }

            XForm xform = XForm.CreateInstance(new Guid(EventPageBase.RegistrationForm.Id.ToString()));
            NameValueCollection formControls = xform.CreateFormData().GetValues();

            foreach (string data in formControls)
            {
                yield return(new SelectItem()
                {
                    Text = data, Value = data
                });
            }
        }
示例#3
0
        protected override bool ProcessXFormAction(System.Web.Mvc.Controller controller, EPiServer.XForms.Util.XFormPostedData post)
        {
            var xFormData = new XFormPageHelper().GetXFormData(controller, post);
            var xform     = XForm.CreateInstance(xFormData.FormId);

            if (xform != null && xFormData.GetValue("formName").Equals("Yes", StringComparison.OrdinalIgnoreCase))
            {
                var from = post.SelectedSubmit.Sender;
                var to   = post.SelectedSubmit.Receiver;
                PerformCustomAction(xFormData, post.SelectedSubmit.Subject, to, from);
            }

            return(base.ProcessXFormAction(controller, post));
        }
示例#4
0
        private void ExtractFieldNames(EventPageBase EventPageBase)
        {
            if (EventPageBase.RegistrationForm == null)
            {
                return;
            }

            XForm xform = XForm.CreateInstance(new Guid(EventPageBase.RegistrationForm.Id.ToString()));
            NameValueCollection formControls = xform.CreateFormData().GetValues();

            foreach (string data in formControls)
            {
                if (!FieldsList.Contains(data))
                {
                    FieldsList.Add(data);
                }
            }
        }
示例#5
0
        protected void Page_Init(object sender, EventArgs e)
        {
            bool UseForms  = BVNetwork.Attend.Business.API.AttendRegistrationEngine.UseForms;
            var  eventPage = Locate.ContentRepository().Get <EventPageBase>(CurrentBlock.EventPage);

            if (UseForms == false)
            {
                DetailsXFormControl.FormDefinition = XForm.CreateInstance(new Guid(eventPage.RegistrationForm.Id.ToString()));
                PopulateForm();
                DetailsXFormControl.DataBind();
            }
            else
            {
                FormData = BVNetwork.Attend.Business.API.AttendRegistrationEngine.GetFormData(CurrentBlock);
                FormElementsRepeater.DataSource = FormData;
                FormElementsRepeater.DataBind();
            }
            XFormContainer.Visible = !UseForms;
            FormContainer.Visible  = UseForms;
            SessionList.Controls.Add(AttendSessionEngine.GetSessionsControl(CurrentData.EventPage, CurrentData));
        }