private void PopulateParticipants() { List <IParticipant> participants = EPiServer.CacheManager.Get("participants-" + FromDateTime.ToString() + ToDateTime.ToString()) as List <IParticipant>; FieldsList = EPiServer.CacheManager.Get("fieldnames-" + FromDateTime.ToString() + ToDateTime.ToString()) as List <String>; if (participants == null) { FieldsList = new List <string>(); var events = ParticipantProviderManager.Provider.GetEventPages(); participants = new List <IParticipant>(); foreach (PageData EventPageBaseData in (events)) { if ((EventPageBaseData as EventPageBase).EventDetails.EventEnd <= ToDateTime && (EventPageBaseData as EventPageBase).EventDetails.EventStart >= FromDateTime) { ExtractFieldNames(EventPageBaseData as EventPageBase); foreach (var participant in AttendRegistrationEngine.GetParticipants(EventPageBaseData.ContentLink)) { participants.Add(participant as IParticipant); } } } EPiServer.CacheManager.Insert("fieldnames-" + FromDateTime.ToString() + ToDateTime.ToString(), FieldsList); EPiServer.CacheManager.Insert("participants-" + FromDateTime.ToString() + ToDateTime.ToString(), participants); } participants = (from p in participants orderby p.DateSubmitted descending select p).ToList(); ParticipantsList = participants; SetupPreviewPropertyControl(ParticipantsList); }
protected void RegisterAllParticipantsButton_Click(object sender, EventArgs e) { IEnumerable <IParticipant> allConfirmed = AttendRegistrationEngine.GetParticipants(CurrentEvent.ContentLink, Business.Text.AttendStatus.Confirmed); foreach (IParticipant participant in allConfirmed) { RegisterParticipant(AttendRegistrationEngine.GetParticipant(participant.Code), false); } AddStatusText("All participants registered!"); }
protected void Page_Init(object sender, EventArgs e) { Participants = AttendRegistrationEngine.GetParticipants(CurrentPage.ContentLink).ToList(); NoParticipants.Visible = !(Participants.Count <IParticipant>() > 0); Sessions = AttendSessionEngine.GetSessions(CurrentPage.ContentLink).ToList(); PopulateStatusDropDown(); PopulateEMailDropDown(); PopulateSessionDropDown(); DeleteParticipantsCopy.OnClientClick = "return confirm('" + DeleteConfirmation() + "');"; NoParticipants.DataBind(); }
protected void previewRepeater_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e) { var propertyControl = e.Item.FindControl("Participants") as Repeater; EventPageBase EventPageBase = e.Item.DataItem as EventPageBase; if (EventPageBase != null) { propertyControl.DataSource = AttendRegistrationEngine.GetParticipants(EventPageBase.ContentLink).ToList(); propertyControl.DataBind(); //var eventDetailsControl = e.Item.FindControl("EventInfoProperty") as Property; //SetupPreviewPropertyControl(eventDetailsControl, EventPageBase); } //SetupPreviewPropertyControl(propertyControl, AttendRegistrationEngine.GetParticipants(EventPageBase.ContentLink).ToList()); }
protected void Page_Load(object sender, EventArgs e) { IEnumerable <IParticipant> participants = AttendRegistrationEngine.GetParticipants(new EPiServer.Core.ContentReference(HttpContext.Current.Request.QueryString["EventPageBase"])); string attachment = "attachment; filename=ParticipantList.csv"; HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ClearHeaders(); HttpContext.Current.Response.ClearContent(); HttpContext.Current.Response.AddHeader("content-disposition", attachment); HttpContext.Current.Response.ContentType = "text/csv"; HttpContext.Current.Response.AddHeader("Attend", "public"); var sb = new StringBuilder(); foreach (var participant in participants) { sb.AppendLine(GetParticipantData(participant)); } HttpContext.Current.Response.Write(sb.ToString()); HttpContext.Current.Response.End(); }
protected void SearchEvents() { var events = ParticipantProviderManager.Provider.GetEventPages(); var upcomingEvents = (from PageData p in events orderby((EventPageBase)p).EventDetails.EventStart where ((EventPageBase)p).EventDetails.EventStart >= FromDateTime && ((EventPageBase)p).EventDetails.EventEnd <= ToDateTime select p); List <IParticipant> participants = new List <IParticipant>(); foreach (PageData EventPageBaseData in upcomingEvents) { if ((EventPageBaseData as EventPageBase).EventDetails.EventEnd <= ToDateTime && (EventPageBaseData as EventPageBase).EventDetails.EventStart >= FromDateTime) { //ExtractFieldNames(EventPageBaseData as EventPageBase); foreach (var participant in AttendRegistrationEngine.GetParticipants(EventPageBaseData.ContentLink)) { participants.Add(participant as IParticipant); } } } Participants = participants; (AttendInvoiceList as Attend.Admin.Partials.InvoiceList).ParticipantList = participants; AttendInvoiceList.DataBind(); }
protected void DataBindTables() { RegisteredRepeater.DataSource = AttendRegistrationEngine.GetParticipants(CurrentEvent.ContentLink, Business.Text.AttendStatus.Participated); NotRegisteredRepeater.DataSource = AttendRegistrationEngine.GetParticipants(CurrentEvent.ContentLink, Business.Text.AttendStatus.Confirmed); DataBind(); }
protected void ExportParticipantsButton_OnClick(object sender, CommandEventArgs e) { EventPageBase EventPageBase = DataFactory.Instance.Get <EventPageBase>(new ContentReference(e.CommandArgument.ToString())); ParticipantExport.Export(AttendRegistrationEngine.GetParticipants(EventPageBase.ContentLink).ToList()); }