示例#1
0
        private void update(SearchModel searcher)
        {
            searcher.name = nameText.Text.Trim();
            searcher.code = codeText.Text.Trim();
            Pagination pagination = ConfigResolver.GetInstance().GetDataProvider().Provide(searcher);

            ModelBindingSource.Clear();
            for (int i = 0; i < pagination.Records.Count; i++)
            {
                ModelBindingSource.Add(pagination.Records[i]);
            }

            if (pagination.PageNo <= 1)
            {
                ForwardFirstLabel.Enabled = false;
                ForwardPrevLabel.Enabled  = false;
            }
            else
            {
                ForwardFirstLabel.Enabled = true;
                ForwardPrevLabel.Enabled  = true;
            }

            if (searcher.pageNo >= pagination.getTotalPage())
            {
                ForwardNextLabel.Enabled = false;
                ForwardLastLabel.Enabled = false;
            }
            else
            {
                ForwardNextLabel.Enabled = true;
                ForwardLastLabel.Enabled = true;
            }

            StatisticLabel.Text  = String.Format("页次:{0}/{1} 共{2}条数据", pagination.PageNo, pagination.getTotalPage(), pagination.TotalCount);
            PagingPanel.Tag      = pagination;
            ForwardPageText.Text = pagination.PageNo.ToString();
            StudentTable.ClearSelection();
        }