private string GetStatusNameAndNumber(string p) { int cnt = Participants.Where(x => x.AttendStatus == p).Count(); string text = Locate.LocalizationService().GetString("/attend/attendstatus/" + p); return(text + " (" + cnt.ToString() + ")"); }
protected void PopulateStatusDropDown() { Array itemValues = System.Enum.GetValues(typeof(AttendStatus)); Array itemNames = System.Enum.GetNames(typeof(AttendStatus)); StatusDropDown.Items.Add(new ListItem(ServiceLocator.Current.GetInstance <LocalizationService>().GetString("/attend/edit/selectstatus"), "")); for (int i = 0; i <= itemNames.Length - 1; i++) { ListItem item = new ListItem(ServiceLocator.Current.GetInstance <LocalizationService>().GetString("/attend/attendstatus/" + itemValues.GetValue(i).ToString()), itemValues.GetValue(i).ToString()); StatusDropDown.Items.Add(item); } StatusFilterDropDown.Items.Add(new ListItem(Locate.LocalizationService().GetString("/attend/edit/status"), "")); for (int i = 0; i <= itemNames.Length - 1; i++) { string text = GetStatusNameAndNumber(itemNames.GetValue(i).ToString()); ListItem item = new ListItem(text, itemValues.GetValue(i).ToString()); item.Selected = Request.Form["StatusFilterDropDown"] == item.Value; StatusFilterDropDown.Items.Add(item); } StatusFilterDropDown.SelectedValue = Request.Form["StatusFilterDropDown"]; //StatusDropDown.DataBind(); //StatusFilterDropDown.DataBind(); }
protected void PopulateEMailDropDown() { List <IParticipant> contents = Participants; contents = FilterStatus(contents); contents = FilterSearch(contents); contents = FilterSessions(contents); EMailDropDownList.Items.Add(new ListItem(Locate.LocalizationService().GetString("/attend/edit/email"), "")); var emails = (from IParticipant p in contents where p.Email.Split('@').Length > 1 select p.Email.Split('@')[1]).OrderBy(p => p).Distinct(); foreach (var email in emails) { EMailDropDownList.Items.Add(new ListItem(email + " (" + (from p in contents where (p as IParticipant).Email.EndsWith(email) select p).Count() + ")", email)); } }
private void PopulateParticipants() { int total = Participants.Count; var contents = Participants; contents = FilterStatus(contents); contents = FilterEmail(contents); contents = FilterSessions(contents); contents = FilterSearch(contents); int totalFiltered = contents.Count; NumberOfParticipantsLiteral.Text = string.Format(Locate.LocalizationService().GetString("/attend/edit/findresult"), totalFiltered, total); ParticipantsRepeater.DataSource = contents; ParticipantsRepeater.DataBind(); }
protected void PopulateSessionDropDown() { SessionDropDownList.Items.Add(new ListItem(Locate.LocalizationService().GetString("/attend/edit/sessions"), "")); List <IParticipant> contents = Participants; contents = FilterStatus(contents); contents = FilterSearch(contents); contents = FilterEmail(contents); foreach (SessionBlock sessionBlock in Sessions) { var currentSession = contents.Where( x => (x as IParticipant).Sessions != null && (x as IParticipant).Sessions.Items.Where(s => s.ContentLink.ID == (sessionBlock as IContent).ContentLink.ID).Any()); SessionDropDownList.Items.Add(new ListItem((sessionBlock as IContent).Name + " (" + currentSession.Count() + ")", (sessionBlock as IContent).ContentLink.ID.ToString())); } }