Ejemplo n.º 1
0
        private void SetupPreviewPropertyControl(IEnumerable <IParticipant> contents, int page, int itemsPrPage, bool databind)
        {
            int total = contents.Count();

            contents = FilterStatus(contents);
            contents = FilterEmail(contents);
            contents = FilterSearch(contents);
            contents = FilterEvent(contents);

            int totalFiltered = contents.Count();
            int last          = itemsPrPage * (page);

            if (last > totalFiltered)
            {
                last = totalFiltered;
            }
            int first           = itemsPrPage * (page - 1) + 1;
            var filteredContent = contents.Skip(first - 1).Take(itemsPrPage);


            NumberOfParticipantsLiteral.Text = string.Format(EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance <LocalizationService>().GetString("/attend/edit/findresult"), totalFiltered, total);

            PageResultLiteral.Text  = string.Format(EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance <LocalizationService>().GetString("/attend/edit/pageresult"), page, first, last, totalFiltered);
            PageResultLiteral2.Text = PageResultLiteral.Text;

            ParticipantsRepeater.DataSource = filteredContent;

            //if (databind)
            ParticipantsRepeater.DataBind();

            PopulateEMailDropDown();
            PopulateEventDropDown();
            PopulateStatusDropDown();
        }
        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();
        }