From 8ed8ee61c7ba7367f9d9f649156da5760bda59d4 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期五, 28 三月 2025 14:54:07 +0800
Subject: [PATCH] 工艺

---
 DevApp/Gs.DevApp/UserControl/UcPageBar.cs |   43 ++++++++++++++++++++++++++++++++++---------
 1 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/DevApp/Gs.DevApp/UserControl/UcPageBar.cs b/DevApp/Gs.DevApp/UserControl/UcPageBar.cs
index bec80ee..bfcfa35 100644
--- a/DevApp/Gs.DevApp/UserControl/UcPageBar.cs
+++ b/DevApp/Gs.DevApp/UserControl/UcPageBar.cs
@@ -1,4 +1,6 @@
-锘縰sing System;
+锘縰sing DevExpress.XtraLayout.Utils;
+using Gs.DevApp.ToolBox;
+using System;
 using System.Windows.Forms;
 
 namespace UserControls.Data
@@ -8,10 +10,20 @@
         public delegate void
             GetPageDataEvents(int curPage, int pageSize); //瀹氫箟濮旀墭
 
-        public UcPageBar()
+        public UcPageBar(bool _IsAll=true)
         {
             InitializeComponent();
-            // UtilityHelper.SetFont(layoutControl1);
+            if (_IsAll == false)
+            {
+                layoutControlItem6.Visibility = LayoutVisibility.Never;
+                emptySpaceItem4.Visibility = LayoutVisibility.Never;
+                layoutControlItem12.Visibility = LayoutVisibility.Never;
+                emptySpaceItem1.Visibility = LayoutVisibility.Never;
+                layoutControlItem7.Visibility = LayoutVisibility.Never;
+            }
+
+            this.cbxRowCount.Text = "50";
+            this.cbxRowCount.SelectedIndexChanged += new System.EventHandler(this.cbxRowCount_SelectedIndexChanged);
         }
 
         public event GetPageDataEvents PagerEvent; //瀹氫箟浜嬩欢
@@ -20,10 +32,11 @@
         private void cbxRowCount_SelectedIndexChanged(object sender,
             EventArgs e)
         {
-            RowsCount = Convert.ToInt32(cbxRowCount.Text);
+           int  _RowsCount = Convert.ToInt32(cbxRowCount.Text);
             CurrentPage = 1;
             if (PagerEvent != null)
-                BtnEvents(sender, e);
+                if (_RowsCount > 0 && _RowsCount > 0)
+                    BtnEvents(sender, e);
         }
 
         //鎵嬪姩杈撳叆鏄剧ず椤甸潰缂栧彿
@@ -86,7 +99,6 @@
 
         private void BtnEvents(object sender, EventArgs e)
         {
-            //setTxt();
             PagerEvent(CurrentPage, RowsCount);
         }
 
@@ -95,7 +107,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
@@ -116,6 +129,8 @@
 
         #region 瀹氫箟灞炴��
 
+   
+
         /// <summary>
         ///     鎬婚〉鏁�
         /// </summary>
@@ -129,12 +144,22 @@
         /// <summary>
         ///     姣忛〉鏉℃暟
         /// </summary>
-        public int RowsCount { get; set; }
+        public int RowsCount { get { return int.Parse(this.cbxRowCount.Text); } }
 
+
+        int _RecordCount;
         /// <summary>
         ///     鎬昏褰曟暟
         /// </summary>
-        public int RecordCount { get; set; }
+        public int RecordCount
+        {
+            get { return _RecordCount; }
+            set
+            {
+                _RecordCount = value;
+                setTxt();
+            }
+        }
 
         #endregion
     }

--
Gitblit v1.9.3