protected void UpdateSessions_Click(object sender, EventArgs e) { ParticipantBlock current = (CurrentBlock.CreateWritableClone() as ParticipantBlock); current.Sessions = new ContentArea(); current.Sessions.Items.Clear(); foreach (ContentReference item in GetChosenSessions()) { current.Sessions.Items.Add(new ContentAreaItem() { ContentLink = item }); } Locate.ContentRepository().Save(current as IContent, EPiServer.DataAccess.SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess); }
protected void UpdateParticipant_Click(object sender, EventArgs e) { try { bool UseForms = BVNetwork.Attend.Business.API.AttendRegistrationEngine.UseForms; ParticipantBlock current = (CurrentBlock.CreateWritableClone() as ParticipantBlock); if (UseForms) { XmlDocument doc = new XmlDocument(); XmlNode rootNode = doc.CreateElement("FormData"); doc.AppendChild(rootNode); foreach (RepeaterItem item in FormElementsRepeater.Items) { if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem) { System.Web.UI.WebControls.Label label = (System.Web.UI.WebControls.Label)item.FindControl("FormLabel"); TextBox textBox = (TextBox)item.FindControl("FormTextBox"); XmlNode formElementNode = doc.CreateElement(label.Text); formElementNode.InnerText = textBox.Text; rootNode.AppendChild(formElementNode); } } current.XForm = doc.InnerXml; } else { current.XForm = DetailsXFormControl.Data.Data.OuterXml; } Locate.ContentRepository().Save(current as IContent, EPiServer.DataAccess.SaveAction.Publish); } catch (Exception ex) { StatusLiteral.Text = ex.Message; } }