From 05731195c2c3d5adcbefd2bc18f12ebe84b0d68a Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期一, 02 十二月 2024 09:49:54 +0800 Subject: [PATCH] 其它业务 --- DevApp/Gs.DevApp/UserControl/UcPageBar.cs | 25 +++++++++++++++++++------ 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/DevApp/Gs.DevApp/UserControl/UcPageBar.cs b/DevApp/Gs.DevApp/UserControl/UcPageBar.cs index bec80ee..e0c5213 100644 --- a/DevApp/Gs.DevApp/UserControl/UcPageBar.cs +++ b/DevApp/Gs.DevApp/UserControl/UcPageBar.cs @@ -1,4 +1,5 @@ -锘縰sing System; +锘縰sing Gs.DevApp.ToolBox; +using System; using System.Windows.Forms; namespace UserControls.Data @@ -11,7 +12,8 @@ public UcPageBar() { InitializeComponent(); - // UtilityHelper.SetFont(layoutControl1); + this.cbxRowCount.Text = "50"; + this.cbxRowCount.SelectedIndexChanged += new System.EventHandler(this.cbxRowCount_SelectedIndexChanged); } public event GetPageDataEvents PagerEvent; //瀹氫箟浜嬩欢 @@ -23,7 +25,8 @@ RowsCount = Convert.ToInt32(cbxRowCount.Text); CurrentPage = 1; if (PagerEvent != null) - BtnEvents(sender, e); + if (RecordCount > 0 && RowsCount>0) + BtnEvents(sender, e); } //鎵嬪姩杈撳叆鏄剧ず椤甸潰缂栧彿 @@ -86,7 +89,6 @@ private void BtnEvents(object sender, EventArgs e) { - //setTxt(); PagerEvent(CurrentPage, RowsCount); } @@ -95,7 +97,8 @@ tbxCurrentPage.Text = CurrentPage.ToString(); lbTotalPages.Text = "鍏� " + TotalPages + "椤�"; lbTotalRows.Text = "鍏� " + RecordCount + " 鏉¤褰�"; - cbxRowCount.Text = RowsCount.ToString(); + if (RowsCount > 0) + cbxRowCount.Text = RowsCount.ToString(); if (CurrentPage == 1) lbFirstPage.Enabled = false; else @@ -131,10 +134,20 @@ /// </summary> public int RowsCount { get; set; } + + int _RecordCount; /// <summary> /// 鎬昏褰曟暟 /// </summary> - public int RecordCount { get; set; } + public int RecordCount + { + get { return _RecordCount; } + set + { + _RecordCount = value; + setTxt(); + } + } #endregion } -- Gitblit v1.9.3