protected void Page_Load(object sender, EventArgs e) { string propertyName = "DetailsContent"; if (AttendRegistrationEngine.GetNumberOfSeats(CurrentData.ContentLink) < 1) { propertyName = "NoSeatsContent"; } if (AttendRegistrationEngine.RegistrationOpen(CurrentData.ContentLink) == false) { propertyName = "ClosedContent"; } ContentProperty.PropertyName = propertyName; }
protected string GetClass(PageData EventPageBase) { if ((EventPageBase as EventPageBase).EventDetails.Cancelled == true) { return("event-cancelled"); } if ((EventPageBase as EventPageBase).EventDetails.Private) { return("event-private"); } int participants = AttendRegistrationEngine.GetNumberOfParticipants(EventPageBase.ContentLink); if (participants == 0) { return("event-empty"); } int seats = AttendRegistrationEngine.GetNumberOfSeats(EventPageBase.ContentLink); if (seats > 0) { if (participants >= seats) { return("event-full"); } if (((double)participants / (double)seats) > 0.7) { return("event-many"); } if (((double)participants / (double)seats) > 0.4) { return("event-some"); } if (((double)participants / (double)seats) > 0) { return("event-few"); } } return("event-unknown"); }