コード例 #1
0
        //private void PopolaCboUsers(DropDownList drop, List<User> list)
        //{
        //    foreach (User Curr in list)
        //    {
        //        var listItem = new ListItem();
        //        listItem.Value = Curr.IdUser.ToString();
        //        listItem.Text = Curr.Name;
        //        drop.Items.Add(listItem);
        //    }
        //}
        private void BindRepeater()
        {
            //if (ViewState["LstEvtDto"] == null)
            //{
            //    ViewState["LstEvtDto"] = TrackManagement2PageManager.GetEventi(Convert.ToDateTime(TxtDa.Text), Convert.ToDateTime(TxtA.Text));
            //}
            TrackManagement2PageManager ObjTrackManagement2PageManager = new TrackManagement2PageManager();
            List <EventoDTO>            LstEvtDto = ObjTrackManagement2PageManager.GetEventi(Convert.ToDateTime(TxtDa.Text), Convert.ToDateTime(TxtA.Text), ChkProcessed.Checked);
            //List<EventoDTO> LstEvtDto = TrackManagement2PageManager.GetEventi(Convert.ToDateTime(TxtDa.Text), Convert.ToDateTime(TxtA.Text));

            //Create the PagedDataSource that will be used in paging
            PagedDataSource pgitems = new PagedDataSource();
            //List<EventoDTO> LstEvtDto =(List<EventoDTO>)ViewState["LstEvtDto"];
            //pgitems.DataSource = LstEvtDto.OrderByDescending(x => x.date).ToList();
            List <EventoDTO> LstEvtDtoOrdered = LstEvtDto.OrderByDescending(x => x.date).ToList();

            pgitems.DataSource = LstEvtDtoOrdered;
            //pgitems.DataSource = LstEvtDto.ToList();
            pgitems.AllowPaging = true;

            //Control page size from here
            pgitems.PageSize = Convert.ToInt32(CboRowsInPages.SelectedValue);
            //pgitems.PageSize = 5;
            pgitems.CurrentPageIndex = PageNumber;
            //Raccolgo il numero pagine
            TotalNumPages = pgitems.PageCount;
            if (pgitems.PageCount > 1)
            {
                rptPaging.Visible = true;
                ArrayList pages = new ArrayList();
                for (int i = 0; i <= pgitems.PageCount - 1; i++)
                {
                    pages.Add((i + 1).ToString());
                }
                rptPaging.DataSource = pages;
                rptPaging.DataBind();
            }
            else
            {
                rptPaging.Visible = false;
            }

            //Finally, set the datasource of the repeater
            Repeater1.DataSource = pgitems;
            Repeater1.DataBind();


            LitShowOneOf.Text = "Showing 1 to " + pgitems.PageSize + " of " + LstEvtDto.Count + " entries";
            btnPage.Text      = "Pag. " + (PageNumber + 1);
        }
コード例 #2
0
        //protected void BtnClose_Click(object sender, EventArgs e)
        //{
        //    DivError.Attributes.Add("Class", "ParentDivDeleting Disattivato");

        //}

        #endregion



        #region routine private alla pagina

        private void BindBrotherEvts()
        {
            TrackManagement2PageManager ObjTrackManagement2PageManager = new TrackManagement2PageManager();
            //arrivato qui-----------------------------
            //startDate=2018-08-01&endDate=2018-08-31&
            //EventoDTO ObjEvtDto = ObjTrackManagement2PageManager.GetEvento(Convert.ToInt32(Request.QueryString["bankReportEntryId"].ToString()));
            //List<EventoDTO> LstEvtDto = new List<EventoDTO>();
            //LstEvtDto.Add(ObjEvtDto);
            List <EventoDTO> LstEvtDto = new List <EventoDTO>();

            LstEvtDto = ObjTrackManagement2PageManager.GetEventi(Convert.ToDateTime("1000-01-01"), Convert.ToDateTime("3000-01-01"), false, Convert.ToInt32(Request.QueryString["bankReportEntryId"].ToString()));


            RptSelEvt.DataSource = LstEvtDto;
            RptSelEvt.DataBind();


            ////Finally, set the datasource of the repeater
            //Repeater1.DataSource = pgitems;
            //Repeater1.DataBind();
        }