Просмотр исходного кода

新增通用分页控件,完美无瑕

zoule 5 месяцев назад
Родитель
Сommit
a6ff48ed49

+ 212 - 0
DW5S.App/UserControl/CtrlPage.Designer.cs

@@ -0,0 +1,212 @@
+namespace DW5S.App.UserControl
+{
+    partial class CtrlPage
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CtrlPage));
+            btnLast = new DevExpress.XtraEditors.SimpleButton();
+            btnNext = new DevExpress.XtraEditors.SimpleButton();
+            btnPrev = new DevExpress.XtraEditors.SimpleButton();
+            btnFirst = new DevExpress.XtraEditors.SimpleButton();
+            btnGo = new DevExpress.XtraEditors.SimpleButton();
+            txtGoPage = new DevExpress.XtraEditors.TextEdit();
+            txtCountPerPage = new DevExpress.XtraEditors.ComboBoxEdit();
+            stackPanel1 = new DevExpress.Utils.Layout.StackPanel();
+            labelControl1 = new DevExpress.XtraEditors.LabelControl();
+            labelControl2 = new DevExpress.XtraEditors.LabelControl();
+            txtPageInfo = new DevExpress.XtraEditors.LabelControl();
+            ((System.ComponentModel.ISupportInitialize)txtGoPage.Properties).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)txtCountPerPage.Properties).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)stackPanel1).BeginInit();
+            stackPanel1.SuspendLayout();
+            SuspendLayout();
+            // 
+            // btnLast
+            // 
+            btnLast.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("btnLast.ImageOptions.SvgImage");
+            btnLast.ImageOptions.SvgImageSize = new System.Drawing.Size(12, 12);
+            btnLast.Location = new System.Drawing.Point(311, 10);
+            btnLast.Name = "btnLast";
+            btnLast.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light;
+            btnLast.ShowFocusRectangle = DevExpress.Utils.DefaultBoolean.False;
+            btnLast.Size = new System.Drawing.Size(20, 20);
+            btnLast.TabIndex = 4;
+            btnLast.ToolTip = "尾页";
+            btnLast.Click += btn_Click;
+            // 
+            // btnNext
+            // 
+            btnNext.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("btnNext.ImageOptions.SvgImage");
+            btnNext.ImageOptions.SvgImageSize = new System.Drawing.Size(12, 12);
+            btnNext.Location = new System.Drawing.Point(287, 10);
+            btnNext.Name = "btnNext";
+            btnNext.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light;
+            btnNext.ShowFocusRectangle = DevExpress.Utils.DefaultBoolean.False;
+            btnNext.Size = new System.Drawing.Size(20, 20);
+            btnNext.TabIndex = 3;
+            btnNext.ToolTip = "下一页";
+            btnNext.Click += btn_Click;
+            // 
+            // btnPrev
+            // 
+            btnPrev.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("btnPrev.ImageOptions.SvgImage");
+            btnPrev.ImageOptions.SvgImageSize = new System.Drawing.Size(12, 12);
+            btnPrev.Location = new System.Drawing.Point(176, 10);
+            btnPrev.Name = "btnPrev";
+            btnPrev.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light;
+            btnPrev.ShowFocusRectangle = DevExpress.Utils.DefaultBoolean.False;
+            btnPrev.Size = new System.Drawing.Size(20, 20);
+            btnPrev.TabIndex = 2;
+            btnPrev.ToolTip = "上一页";
+            btnPrev.Click += btn_Click;
+            // 
+            // btnFirst
+            // 
+            btnFirst.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("btnFirst.ImageOptions.SvgImage");
+            btnFirst.ImageOptions.SvgImageSize = new System.Drawing.Size(12, 12);
+            btnFirst.Location = new System.Drawing.Point(151, 10);
+            btnFirst.Margin = new System.Windows.Forms.Padding(20, 3, 3, 3);
+            btnFirst.Name = "btnFirst";
+            btnFirst.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light;
+            btnFirst.ShowFocusRectangle = DevExpress.Utils.DefaultBoolean.False;
+            btnFirst.Size = new System.Drawing.Size(20, 20);
+            btnFirst.TabIndex = 0;
+            btnFirst.ToolTip = "首页";
+            btnFirst.Click += btn_Click;
+            // 
+            // btnGo
+            // 
+            btnGo.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("btnGo.ImageOptions.SvgImage");
+            btnGo.ImageOptions.SvgImageSize = new System.Drawing.Size(12, 12);
+            btnGo.Location = new System.Drawing.Point(434, 10);
+            btnGo.Name = "btnGo";
+            btnGo.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light;
+            btnGo.ShowFocusRectangle = DevExpress.Utils.DefaultBoolean.False;
+            btnGo.Size = new System.Drawing.Size(20, 20);
+            btnGo.TabIndex = 6;
+            btnGo.ToolTip = "跳转";
+            btnGo.Click += btn_Click;
+            // 
+            // txtGoPage
+            // 
+            txtGoPage.Location = new System.Drawing.Point(353, 10);
+            txtGoPage.Margin = new System.Windows.Forms.Padding(20, 3, 3, 3);
+            txtGoPage.Name = "txtGoPage";
+            txtGoPage.Properties.AutoHeight = false;
+            txtGoPage.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
+            txtGoPage.Size = new System.Drawing.Size(76, 20);
+            txtGoPage.TabIndex = 5;
+            // 
+            // txtCountPerPage
+            // 
+            txtCountPerPage.EditValue = "100";
+            txtCountPerPage.Location = new System.Drawing.Point(37, 10);
+            txtCountPerPage.Name = "txtCountPerPage";
+            txtCountPerPage.Properties.AutoHeight = false;
+            txtCountPerPage.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
+            txtCountPerPage.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) });
+            txtCountPerPage.Properties.Items.AddRange(new object[] { "100", "500", "1000", "2000", "5000", "10000" });
+            txtCountPerPage.Size = new System.Drawing.Size(76, 20);
+            txtCountPerPage.TabIndex = 0;
+            txtCountPerPage.EditValueChanged += txtCountPerPage_EditValueChanged;
+            // 
+            // stackPanel1
+            // 
+            stackPanel1.Controls.Add(labelControl1);
+            stackPanel1.Controls.Add(txtCountPerPage);
+            stackPanel1.Controls.Add(labelControl2);
+            stackPanel1.Controls.Add(btnFirst);
+            stackPanel1.Controls.Add(btnPrev);
+            stackPanel1.Controls.Add(txtPageInfo);
+            stackPanel1.Controls.Add(btnNext);
+            stackPanel1.Controls.Add(btnLast);
+            stackPanel1.Controls.Add(txtGoPage);
+            stackPanel1.Controls.Add(btnGo);
+            stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+            stackPanel1.Location = new System.Drawing.Point(0, 0);
+            stackPanel1.Name = "stackPanel1";
+            stackPanel1.Size = new System.Drawing.Size(796, 42);
+            stackPanel1.TabIndex = 2;
+            stackPanel1.UseSkinIndents = true;
+            // 
+            // labelControl1
+            // 
+            labelControl1.Location = new System.Drawing.Point(11, 13);
+            labelControl1.Margin = new System.Windows.Forms.Padding(0);
+            labelControl1.Name = "labelControl1";
+            labelControl1.Size = new System.Drawing.Size(24, 14);
+            labelControl1.TabIndex = 0;
+            labelControl1.Text = "每页";
+            // 
+            // labelControl2
+            // 
+            labelControl2.Location = new System.Drawing.Point(117, 13);
+            labelControl2.Name = "labelControl2";
+            labelControl2.Size = new System.Drawing.Size(12, 14);
+            labelControl2.TabIndex = 0;
+            labelControl2.Text = "条";
+            // 
+            // txtPageInfo
+            // 
+            txtPageInfo.Location = new System.Drawing.Point(208, 13);
+            txtPageInfo.Margin = new System.Windows.Forms.Padding(10, 3, 10, 3);
+            txtPageInfo.Name = "txtPageInfo";
+            txtPageInfo.Size = new System.Drawing.Size(67, 14);
+            txtPageInfo.TabIndex = 0;
+            txtPageInfo.Text = "第0页/共0页";
+            // 
+            // CtrlPage
+            // 
+            AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
+            AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            Controls.Add(stackPanel1);
+            Margin = new System.Windows.Forms.Padding(0);
+            Name = "CtrlPage";
+            Size = new System.Drawing.Size(796, 42);
+            ((System.ComponentModel.ISupportInitialize)txtGoPage.Properties).EndInit();
+            ((System.ComponentModel.ISupportInitialize)txtCountPerPage.Properties).EndInit();
+            ((System.ComponentModel.ISupportInitialize)stackPanel1).EndInit();
+            stackPanel1.ResumeLayout(false);
+            stackPanel1.PerformLayout();
+            ResumeLayout(false);
+        }
+
+        #endregion
+        private DevExpress.XtraEditors.SimpleButton btnLast;
+        private DevExpress.XtraEditors.SimpleButton btnNext;
+        private DevExpress.XtraEditors.SimpleButton btnPrev;
+        private DevExpress.XtraEditors.SimpleButton btnFirst;
+        private DevExpress.XtraEditors.SimpleButton btnGo;
+        private DevExpress.XtraEditors.TextEdit txtGoPage;
+        private DevExpress.XtraEditors.ComboBoxEdit txtCountPerPage;
+        private DevExpress.Utils.Layout.StackPanel stackPanel1;
+        private DevExpress.XtraEditors.LabelControl labelControl1;
+        private DevExpress.XtraEditors.LabelControl labelControl2;
+        private DevExpress.XtraEditors.LabelControl txtPageInfo;
+    }
+}

+ 162 - 0
DW5S.App/UserControl/CtrlPage.cs

@@ -0,0 +1,162 @@
+using DevExpress.XtraEditors;
+using DevExpress.XtraPrinting.Native;
+using DW5S.DTO;
+using DW5S.Entity;
+using DW5S.Repostory;
+using ExtensionsDev;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace DW5S.App.UserControl
+{
+
+    public partial class CtrlPage : DevExpress.XtraEditors.XtraUserControl
+    {
+        public event Func<PageQueryDto, Task<DTO.PageData>> OnQueryAsync;
+
+        private bool comPact = false;
+
+        /// <summary>
+        /// 紧凑模式(默认false)
+        /// </summary>
+        [ToolboxItem(false)]
+        [DefaultValue(false)]
+        [Category("Style"), Description("紧凑模式")]
+        public bool Compact
+        {
+            get
+            {
+                return comPact;
+            }
+            set
+            {
+                comPact = value;
+                if (comPact)
+                {
+                    foreach (Control item in this.stackPanel1.Controls)
+                    {
+                        item.Margin = new Padding(2);
+                        if (item.GetType() == typeof(Button))
+                            item.Width = 14;
+                    }
+                    txtCountPerPage.Width = 50;
+                    txtGoPage.Width = 50;
+                }
+                else
+                {
+                    foreach (Control item in this.stackPanel1.Controls)
+                    {
+                        item.Margin = new Padding(2);
+                        if (item.GetType() == typeof(Button))
+                            item.Width = 20;
+                    }
+                    btnFirst.Margin = new System.Windows.Forms.Padding(20, 3, 3, 3);
+                    txtPageInfo.Margin = new System.Windows.Forms.Padding(10, 3, 10, 3);
+                    txtGoPage.Margin = new System.Windows.Forms.Padding(20, 3, 3, 3);
+                    this.txtCountPerPage.Width = 76;
+                    txtGoPage.Width = 76;
+                }
+            }
+        }
+
+        public bool showGoto = true;
+
+        /// <summary>
+        /// 是否显示跳转(模式true)
+        /// </summary>
+        [ToolboxItem(true)]
+        [Category("Style"), Description("是否显示跳转")]
+        [DefaultValue(true)]
+        public bool ShowGoto
+        {
+            get
+            {
+                return showGoto;
+            }
+            set
+            {
+                showGoto = value;
+                this.txtGoPage.Visible = value;
+                this.btnGo.Visible = value;
+            }
+        }
+
+        /// <summary>
+        /// 当前页数
+        /// </summary>
+        private int CurrentPage { get; set; } = 1;
+        public CtrlPage()
+        {
+            InitializeComponent();
+            this.MinimumSize = new System.Drawing.Size(100, 26);
+        }
+
+        /// <summary>
+        /// 刷新数据(当前页会变为1)
+        /// </summary>
+        public void RefreshData()
+        {
+            btn_Click(btnFirst, null);
+        }
+        private void txtCountPerPage_EditValueChanged(object sender, EventArgs e)
+        {
+            btn_Click(btnFirst, null);
+        }
+        private async void btn_Click(object sender, EventArgs e)
+        {
+            try
+            {
+                if (sender == btnFirst)
+                {
+                    this.CurrentPage = 1;
+                }
+                else if (sender == btnPrev)
+                {
+                    if (this.CurrentPage > 1)
+                        this.CurrentPage--;
+                }
+                else if (sender == btnNext)
+                {
+                    this.CurrentPage++;
+                }
+                else if (sender == btnLast)
+                {
+                    this.CurrentPage = int.MaxValue;
+                }
+                else
+                {
+                    int.TryParse(txtGoPage.Text, out int currentPage);
+                    if (currentPage <= 0) return;
+                    this.CurrentPage = currentPage;
+                }
+                int.TryParse(txtCountPerPage.Text, out int countPerPage);
+                if (countPerPage <= 0)
+                {
+                    countPerPage = (int)txtCountPerPage.Properties.Items[0];
+                }
+                this.Enabled = false;
+                var pageData = await this.OnQueryAsync(new PageQueryDto()
+                {
+                    CountPerPage = countPerPage,
+                    Page = CurrentPage,
+                });
+                this.CurrentPage = pageData.Page;
+                txtPageInfo.Text = $"第{pageData.Page}页/共{pageData.TotalPage}页";
+            }
+            catch (Exception ex)
+            {
+                IocContainer.Logger.Error(ex, $"分页查询异常");
+            }
+            finally
+            {
+                this.Enabled = true;
+            }
+        }
+    }
+}

+ 89 - 27
DW5S.App/UserControl/CtrlPaging.resx → DW5S.App/UserControl/CtrlPage.resx

@@ -1,24 +1,24 @@
 <?xml version="1.0" encoding="utf-8"?>
 <root>
-  <!-- 
+  <!--
     Microsoft ResX Schema 
-    
+
     Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
+
+    The primary goals of this format is to allow a simple XML format
+    that is mostly human readable. The generation and parsing of the
+    various data types are done through the TypeConverter classes
     associated with the data types.
-    
+
     Example:
-    
+
     ... ado.net/XML headers & schema ...
     <resheader name="resmimetype">text/microsoft-resx</resheader>
     <resheader name="version">2.0</resheader>
     <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
     <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
     <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
     <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
         <value>[base64 mime encoded serialized .NET Framework object]</value>
     </data>
@@ -26,36 +26,36 @@
         <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
         <comment>This is a comment</comment>
     </data>
-                
-    There are any number of "resheader" rows that contain simple 
+
+    There are any number of "resheader" rows that contain simple
     name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
+
+    Each data row contains a name, and value. The row also contains a
+    type or mimetype. Type corresponds to a .NET class that support
+    text/value conversion through the TypeConverter architecture.
+    Classes that don't support this are serialized and stored with the
     mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
+
+    The mimetype is used for serialized objects, and tells the
+    ResXResourceReader how to depersist the object. This is currently not
     extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
+
+    Note - application/x-microsoft.net.object.binary.base64 is the format
+    that the ResXResourceWriter will generate, however the reader can
     read any of the formats listed below.
-    
+
     mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
+    value   : The object must be serialized with
             : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
             : and then encoded with base64 encoding.
     
     mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
+    value   : The object must be serialized with
             : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
             : and then encoded with base64 encoding.
 
     mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
+    value   : The object must be serialized into a byte array
             : using a System.ComponentModel.TypeConverter
             : and then encoded with base64 encoding.
     -->
@@ -117,7 +117,69 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <assembly alias="DevExpress.Data.v23.2" name="DevExpress.Data.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+  <assembly alias="DevExpress.Data.v23.2" name="DevExpress.Data.v23.2, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+  <data name="btnLast.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi4z
+        LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
+        dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAABgCAAAC77u/
+        PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
+        IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
+        MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
+        Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg
+        MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsdWV7ZmlsbDojMTE3N0Q3O30KPC9z
+        dHlsZT4NCiAgPHBhdGggZD0iTTIxLjYsMTUuNWMwLjUsMC4zLDAuNSwwLjksMCwxLjJMNC45LDI3Ljlj
+        LTAuNSwwLjMtMC45LDAtMC45LTAuNVY0LjdDNCw0LDQuNCwzLjgsNC45LDQuMUwyMS42LDE1LjV6IE0y
+        OCwyNyAgVjVjMC0wLjYtMC41LTEtMS0xaC0yYy0wLjUsMC0xLDAuNC0xLDF2MjJjMCwwLjUsMC41LDEs
+        MSwxaDJDMjcuNSwyOCwyOCwyNy41LDI4LDI3eiIgY2xhc3M9IkJsdWUiIC8+DQo8L3N2Zz4L
+</value>
+  </data>
+  <data name="btnNext.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi4z
+        LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
+        dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAALoBAAAC77u/
+        PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
+        IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
+        MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
+        Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg
+        MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsdWV7ZmlsbDojMTE3N0Q3O30KPC9z
+        dHlsZT4NCiAgPHBhdGggZD0iTTguOSw0LjFDOC40LDMuOCw4LDQuMSw4LDQuN3YyMi42YzAsMC43LDAu
+        NCwwLjksMC45LDAuNWwxNi43LTExLjNjMC41LTAuMywwLjUtMC45LDAtMS4yTDguOSw0LjF6IiBjbGFz
+        cz0iQmx1ZSIgLz4NCjwvc3ZnPgs=
+</value>
+  </data>
+  <data name="btnPrev.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi4z
+        LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
+        dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAL4BAAAC77u/
+        PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
+        IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
+        MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
+        Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg
+        MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsdWV7ZmlsbDojMTE3N0Q3O30KPC9z
+        dHlsZT4NCiAgPHBhdGggZD0iTTIzLjEsNC4xYzAuNS0wLjMsMC45LDAsMC45LDAuNXYyMi42YzAsMC43
+        LTAuNCwwLjktMC45LDAuNUw2LjQsMTYuNmMtMC41LTAuMy0wLjUtMC45LDAtMS4yTDIzLjEsNC4xeiIg
+        Y2xhc3M9IkJsdWUiIC8+DQo8L3N2Zz4L
+</value>
+  </data>
+  <data name="btnFirst.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi4z
+        LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
+        dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAABcCAAAC77u/
+        PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
+        IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
+        MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
+        Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg
+        MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsdWV7ZmlsbDojMTE3N0Q3O30KPC9z
+        dHlsZT4NCiAgPHBhdGggZD0iTTEwLjQsMTUuNWMtMC41LDAuMy0wLjUsMC45LDAsMS4ybDE2LjcsMTEu
+        MmMwLjUsMC4zLDAuOSwwLjEsMC45LTAuNVY0LjdjMC0wLjctMC40LTAuOS0wLjktMC41TDEwLjQsMTUu
+        NXogICBNNCwyN1Y1YzAtMC42LDAuNC0xLDEtMWgyYzAuNiwwLDEsMC40LDEsMXYyMmMwLDAuNS0wLjQs
+        MS0xLDFINUM0LjQsMjgsNCwyNy41LDQsMjd6IiBjbGFzcz0iQmx1ZSIgLz4NCjwvc3ZnPgs=
+</value>
+  </data>
   <data name="btnGo.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi4z

+ 0 - 276
DW5S.App/UserControl/CtrlPaging.Designer.cs

@@ -1,276 +0,0 @@
-namespace DW5S.App.UserControl
-{
-    partial class CtrlPaging
-    {
-        /// <summary> 
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary> 
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Component Designer generated code
-
-        /// <summary> 
-        /// Required method for Designer support - do not modify 
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CtrlPaging));
-            this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
-            this.btnGo = new DevExpress.XtraEditors.SimpleButton();
-            this.txtGoPage = new DevExpress.XtraEditors.TextEdit();
-            this.dataNavigator1 = new DevExpress.XtraEditors.DataNavigator();
-            this.txtCountPerPage = new DevExpress.XtraEditors.ComboBoxEdit();
-            this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
-            this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.simpleLabelItem1 = new DevExpress.XtraLayout.SimpleLabelItem();
-            this.simpleLabelItem2 = new DevExpress.XtraLayout.SimpleLabelItem();
-            this.layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
-            this.layoutControl1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.txtGoPage.Properties)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtCountPerPage.Properties)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem2)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
-            this.SuspendLayout();
-            // 
-            // layoutControl1
-            // 
-            this.layoutControl1.Controls.Add(this.btnGo);
-            this.layoutControl1.Controls.Add(this.txtGoPage);
-            this.layoutControl1.Controls.Add(this.dataNavigator1);
-            this.layoutControl1.Controls.Add(this.txtCountPerPage);
-            this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.layoutControl1.Location = new System.Drawing.Point(0, 0);
-            this.layoutControl1.MaximumSize = new System.Drawing.Size(0, 31);
-            this.layoutControl1.MinimumSize = new System.Drawing.Size(0, 32);
-            this.layoutControl1.Name = "layoutControl1";
-            this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(1044, 185, 650, 400);
-            this.layoutControl1.Root = this.Root;
-            this.layoutControl1.Size = new System.Drawing.Size(645, 32);
-            this.layoutControl1.TabIndex = 0;
-            this.layoutControl1.Text = "layoutControl1";
-            // 
-            // btnGo
-            // 
-            this.btnGo.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnGo.ImageOptions.SvgImage")));
-            this.btnGo.ImageOptions.SvgImageSize = new System.Drawing.Size(16, 16);
-            this.btnGo.Location = new System.Drawing.Point(621, 7);
-            this.btnGo.Name = "btnGo";
-            this.btnGo.Size = new System.Drawing.Size(20, 17);
-            this.btnGo.StyleController = this.layoutControl1;
-            this.btnGo.TabIndex = 11;
-            this.btnGo.ToolTip = "跳转";
-            this.btnGo.Click += new System.EventHandler(this.btnGo_Click);
-            // 
-            // txtGoPage
-            // 
-            this.txtGoPage.Location = new System.Drawing.Point(541, 7);
-            this.txtGoPage.Name = "txtGoPage";
-            this.txtGoPage.Properties.AutoHeight = false;
-            this.txtGoPage.Size = new System.Drawing.Size(76, 17);
-            this.txtGoPage.StyleController = this.layoutControl1;
-            this.txtGoPage.TabIndex = 9;
-            // 
-            // dataNavigator1
-            // 
-            this.dataNavigator1.Buttons.Append.Visible = false;
-            this.dataNavigator1.Buttons.CancelEdit.Visible = false;
-            this.dataNavigator1.Buttons.EndEdit.Visible = false;
-            this.dataNavigator1.Buttons.Next.Visible = false;
-            this.dataNavigator1.Buttons.Prev.Visible = false;
-            this.dataNavigator1.Buttons.Remove.Visible = false;
-            this.dataNavigator1.Location = new System.Drawing.Point(152, 7);
-            this.dataNavigator1.Name = "dataNavigator1";
-            this.dataNavigator1.Size = new System.Drawing.Size(152, 20);
-            this.dataNavigator1.StyleController = this.layoutControl1;
-            this.dataNavigator1.TabIndex = 8;
-            this.dataNavigator1.Text = "dataNavigator1";
-            this.dataNavigator1.TextLocation = DevExpress.XtraEditors.NavigatorButtonsTextLocation.Center;
-            this.dataNavigator1.TextStringFormat = "第{0}页/共{1}页";
-            this.dataNavigator1.ButtonClick += new DevExpress.XtraEditors.NavigatorButtonClickEventHandler(this.dataNavigator1_ButtonClick);
-            // 
-            // txtCountPerPage
-            // 
-            this.txtCountPerPage.EditValue = "5000";
-            this.txtCountPerPage.Location = new System.Drawing.Point(34, 7);
-            this.txtCountPerPage.Name = "txtCountPerPage";
-            this.txtCountPerPage.Properties.AutoHeight = false;
-            this.txtCountPerPage.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
-            this.txtCountPerPage.Properties.Items.AddRange(new object[] {
-            "100",
-            "500",
-            "1000",
-            "2000",
-            "5000",
-            "10000"});
-            this.txtCountPerPage.Size = new System.Drawing.Size(76, 18);
-            this.txtCountPerPage.StyleController = this.layoutControl1;
-            this.txtCountPerPage.TabIndex = 10;
-            this.txtCountPerPage.EditValueChanged += new System.EventHandler(this.txtCountPerPage_EditValueChanged);
-            // 
-            // Root
-            // 
-            this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
-            this.Root.GroupBordersVisible = false;
-            this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
-            this.layoutControlItem5,
-            this.layoutControlItem6,
-            this.layoutControlItem7,
-            this.simpleLabelItem1,
-            this.simpleLabelItem2,
-            this.layoutControlItem8,
-            this.emptySpaceItem1});
-            this.Root.Name = "Root";
-            this.Root.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 2, 2);
-            this.Root.Size = new System.Drawing.Size(645, 32);
-            this.Root.TextVisible = false;
-            // 
-            // layoutControlItem5
-            // 
-            this.layoutControlItem5.Control = this.dataNavigator1;
-            this.layoutControlItem5.Location = new System.Drawing.Point(148, 0);
-            this.layoutControlItem5.MaxSize = new System.Drawing.Size(156, 25);
-            this.layoutControlItem5.MinSize = new System.Drawing.Size(156, 25);
-            this.layoutControlItem5.Name = "layoutControlItem5";
-            this.layoutControlItem5.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 5, 2);
-            this.layoutControlItem5.Size = new System.Drawing.Size(156, 28);
-            this.layoutControlItem5.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0);
-            this.layoutControlItem5.TextVisible = false;
-            // 
-            // layoutControlItem6
-            // 
-            this.layoutControlItem6.Control = this.txtGoPage;
-            this.layoutControlItem6.Location = new System.Drawing.Point(537, 0);
-            this.layoutControlItem6.MaxSize = new System.Drawing.Size(80, 24);
-            this.layoutControlItem6.MinSize = new System.Drawing.Size(80, 24);
-            this.layoutControlItem6.Name = "layoutControlItem6";
-            this.layoutControlItem6.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 5, 2);
-            this.layoutControlItem6.Size = new System.Drawing.Size(80, 28);
-            this.layoutControlItem6.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0);
-            this.layoutControlItem6.TextVisible = false;
-            // 
-            // layoutControlItem7
-            // 
-            this.layoutControlItem7.Control = this.txtCountPerPage;
-            this.layoutControlItem7.Location = new System.Drawing.Point(30, 0);
-            this.layoutControlItem7.MaxSize = new System.Drawing.Size(80, 25);
-            this.layoutControlItem7.MinSize = new System.Drawing.Size(80, 25);
-            this.layoutControlItem7.Name = "layoutControlItem7";
-            this.layoutControlItem7.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 5, 2);
-            this.layoutControlItem7.Size = new System.Drawing.Size(80, 28);
-            this.layoutControlItem7.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.layoutControlItem7.TextSize = new System.Drawing.Size(0, 0);
-            this.layoutControlItem7.TextVisible = false;
-            // 
-            // simpleLabelItem1
-            // 
-            this.simpleLabelItem1.AllowHotTrack = false;
-            this.simpleLabelItem1.Location = new System.Drawing.Point(0, 0);
-            this.simpleLabelItem1.MaxSize = new System.Drawing.Size(30, 28);
-            this.simpleLabelItem1.MinSize = new System.Drawing.Size(30, 28);
-            this.simpleLabelItem1.Name = "simpleLabelItem1";
-            this.simpleLabelItem1.Size = new System.Drawing.Size(30, 28);
-            this.simpleLabelItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.simpleLabelItem1.Text = "每页";
-            this.simpleLabelItem1.TextSize = new System.Drawing.Size(24, 14);
-            // 
-            // simpleLabelItem2
-            // 
-            this.simpleLabelItem2.AllowHotTrack = false;
-            this.simpleLabelItem2.Location = new System.Drawing.Point(110, 0);
-            this.simpleLabelItem2.MaxSize = new System.Drawing.Size(38, 25);
-            this.simpleLabelItem2.MinSize = new System.Drawing.Size(38, 25);
-            this.simpleLabelItem2.Name = "simpleLabelItem2";
-            this.simpleLabelItem2.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 20, 2, 2);
-            this.simpleLabelItem2.Size = new System.Drawing.Size(38, 28);
-            this.simpleLabelItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.simpleLabelItem2.Text = "条";
-            this.simpleLabelItem2.TextSize = new System.Drawing.Size(24, 14);
-            // 
-            // layoutControlItem8
-            // 
-            this.layoutControlItem8.Control = this.btnGo;
-            this.layoutControlItem8.Location = new System.Drawing.Point(617, 0);
-            this.layoutControlItem8.MaxSize = new System.Drawing.Size(24, 24);
-            this.layoutControlItem8.MinSize = new System.Drawing.Size(24, 24);
-            this.layoutControlItem8.Name = "layoutControlItem8";
-            this.layoutControlItem8.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 5, 2);
-            this.layoutControlItem8.Size = new System.Drawing.Size(24, 28);
-            this.layoutControlItem8.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.layoutControlItem8.TextSize = new System.Drawing.Size(0, 0);
-            this.layoutControlItem8.TextVisible = false;
-            // 
-            // emptySpaceItem1
-            // 
-            this.emptySpaceItem1.AllowHotTrack = false;
-            this.emptySpaceItem1.Location = new System.Drawing.Point(304, 0);
-            this.emptySpaceItem1.Name = "emptySpaceItem1";
-            this.emptySpaceItem1.Size = new System.Drawing.Size(233, 28);
-            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
-            // 
-            // CtrlPaging
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.Controls.Add(this.layoutControl1);
-            this.Name = "CtrlPaging";
-            this.Size = new System.Drawing.Size(645, 32);
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
-            this.layoutControl1.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.txtGoPage.Properties)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtCountPerPage.Properties)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem2)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-        private DevExpress.XtraLayout.LayoutControl layoutControl1;
-        private DevExpress.XtraLayout.LayoutControlGroup Root;
-        private DevExpress.XtraEditors.TextEdit txtGoPage;
-        private DevExpress.XtraEditors.DataNavigator dataNavigator1;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
-        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
-        private DevExpress.XtraLayout.SimpleLabelItem simpleLabelItem1;
-        private DevExpress.XtraLayout.SimpleLabelItem simpleLabelItem2;
-        private DevExpress.XtraEditors.SimpleButton btnGo;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8;
-        private DevExpress.XtraEditors.ComboBoxEdit txtCountPerPage;
-    }
-}

+ 0 - 210
DW5S.App/UserControl/CtrlPaging.cs

@@ -1,210 +0,0 @@
-using DevExpress.XtraEditors;
-using DW5S.Repostory;
-using ExtensionsDev;
-using System;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace DW5S.App.UserControl
-{
-    public partial class CtrlPaging : DevExpress.XtraEditors.XtraUserControl
-    {
-        public delegate Task CurrentPageEventHandler(int currentPage);
-        /// <summary>
-        /// 当前页数改变事件 当前页数
-        /// </summary>
-        public event CurrentPageEventHandler CurrentPageChanged;
-
-
-        public delegate Task PageCountEventHandler(int pageCount);
-        /// <summary>
-        /// 每页条数改变事件 每页条数
-        /// </summary>
-        public event PageCountEventHandler PageCountChanged;
-
-        /// <summary>
-        /// 总条数
-        /// </summary>
-        private int TotalCount { get; set; } = 0;
-        /// <summary>
-        /// 总页数
-        /// </summary>
-        private int TotalPage { get; set; } = 0;
-        /// <summary>
-        /// 当前页数
-        /// </summary>
-        private int CurrentPage { get; set; } = 1;
-        public CtrlPaging()
-        {
-            InitializeComponent();
-            this.layoutControl1.UseDefault();
-        }
-        public async Task LoadData(int totalCount, int currentPage)
-        {
-            try
-            {
-                this.TotalCount = totalCount;
-                this.CurrentPage = currentPage;
-                var countPerPage = Convert.ToInt32(txtCountPerPage.Text);
-                this.TotalPage = TotalCount / countPerPage;
-                if (TotalCount % countPerPage != 0)
-                    TotalPage++;
-                if (TotalPage == 1)
-                {
-                    dataNavigator1.Buttons.First.Enabled = false;
-                    dataNavigator1.Buttons.PrevPage.Enabled = false;
-                    dataNavigator1.Buttons.Last.Enabled = false;
-                    dataNavigator1.Buttons.NextPage.Enabled = false;
-                }
-                dataNavigator1.TextStringFormat = $"第{CurrentPage}页/共{TotalPage}页";
-            }
-            catch (Exception ex)
-            {
-                 IocContainer.Logger.Error(ex,"加载星历信息异常");
-                DxHelper.MsgBoxHelper.ShowError("加载星历信息异常");
-            }
-        }
-
-
-        private async void dataNavigator1_ButtonClick(object sender, NavigatorButtonClickEventArgs e)
-        {
-            if (e.Button.ButtonType == NavigatorButtonType.First)
-            {
-                CurrentPage = 1;
-                dataNavigator1.Buttons.First.Enabled = false;
-                dataNavigator1.Buttons.PrevPage.Enabled = false;
-                dataNavigator1.Buttons.Last.Enabled = true;
-                dataNavigator1.Buttons.NextPage.Enabled = true;
-
-            }
-            else if (e.Button.ButtonType == NavigatorButtonType.Last)
-            {
-                CurrentPage = TotalPage;
-                dataNavigator1.Buttons.Last.Enabled = false;
-                dataNavigator1.Buttons.NextPage.Enabled = false;
-                dataNavigator1.Buttons.First.Enabled = true;
-                dataNavigator1.Buttons.PrevPage.Enabled = true;
-            }
-            else if (e.Button.ButtonType == NavigatorButtonType.NextPage)
-            {
-                CurrentPage++;
-                dataNavigator1.Buttons.First.Enabled = true;
-                dataNavigator1.Buttons.PrevPage.Enabled = true;
-                if (CurrentPage >= TotalPage)
-                {
-                    dataNavigator1.Buttons.Last.Enabled = false;
-                    dataNavigator1.Buttons.NextPage.Enabled = false;
-                }
-                else
-                {
-                    dataNavigator1.Buttons.Last.Enabled = true;
-                    dataNavigator1.Buttons.NextPage.Enabled = true;
-                }
-            }
-            else if (e.Button.ButtonType == NavigatorButtonType.PrevPage)
-            {
-                CurrentPage--;
-                dataNavigator1.Buttons.Last.Enabled = true;
-                dataNavigator1.Buttons.NextPage.Enabled = true;
-                if (CurrentPage == 1)
-                {
-                    dataNavigator1.Buttons.First.Enabled = false;
-                    dataNavigator1.Buttons.PrevPage.Enabled = false;
-                }
-            }
-            await CurrentPageChanged?.Invoke(CurrentPage);
-            dataNavigator1.TextStringFormat = $"第{CurrentPage}页/共{TotalPage}页";
-        }
-
-        private async void btnGo_Click(object sender, EventArgs e)
-        {
-            int.TryParse(txtGoPage.Text, out int _currentPage);
-            if (_currentPage > TotalPage)
-            {
-                _currentPage = TotalPage;
-            }
-            if (_currentPage > 0)
-            {
-                CurrentPage = _currentPage;
-                if (CurrentPage == 1 && CurrentPage < TotalPage)
-                {
-                    dataNavigator1.Buttons.First.Enabled = false;
-                    dataNavigator1.Buttons.PrevPage.Enabled = false;
-                    dataNavigator1.Buttons.Last.Enabled = true;
-                    dataNavigator1.Buttons.NextPage.Enabled = true;
-                }
-                else if (CurrentPage == 1 && CurrentPage == TotalPage)
-                {
-                    dataNavigator1.Buttons.First.Enabled = false;
-                    dataNavigator1.Buttons.PrevPage.Enabled = false;
-                    dataNavigator1.Buttons.First.Enabled = false;
-                    dataNavigator1.Buttons.PrevPage.Enabled = false;
-                }
-                else if (CurrentPage == TotalPage)
-                {
-                    dataNavigator1.Buttons.First.Enabled = true;
-                    dataNavigator1.Buttons.PrevPage.Enabled = true;
-                    dataNavigator1.Buttons.Last.Enabled = false;
-                    dataNavigator1.Buttons.NextPage.Enabled = false;
-                    if (dataNavigator1.Position == 0)
-                        dataNavigator1.Position = 1;
-                }
-                else
-                {
-                    dataNavigator1.Buttons.First.Enabled = true;
-                    dataNavigator1.Buttons.PrevPage.Enabled = true;
-                    dataNavigator1.Buttons.Last.Enabled = true;
-                    dataNavigator1.Buttons.NextPage.Enabled = true;
-                    dataNavigator1.Position = 1;
-                }
-                await CurrentPageChanged(CurrentPage);
-                dataNavigator1.TextStringFormat = $"第{CurrentPage}页/共{TotalPage}页";
-
-            }
-        }
-
-        private async void txtCountPerPage_EditValueChanged(object sender, EventArgs e)
-        {
-            int.TryParse(txtCountPerPage.Text, out int countPerPage);
-            if (countPerPage > 0)
-            {
-                this.TotalPage = TotalCount / countPerPage;
-                if (TotalCount % countPerPage != 0)
-                    TotalPage++;
-                if (CurrentPage > TotalPage)
-                    CurrentPage = TotalPage;
-                if (CurrentPage == 1 && CurrentPage < TotalPage)
-                {
-                    dataNavigator1.Buttons.First.Enabled = false;
-                    dataNavigator1.Buttons.PrevPage.Enabled = false;
-                    dataNavigator1.Buttons.Last.Enabled = true;
-                    dataNavigator1.Buttons.NextPage.Enabled = true;
-                }
-                else if (CurrentPage == 1 && CurrentPage == TotalPage)
-                {
-                    dataNavigator1.Buttons.First.Enabled = false;
-                    dataNavigator1.Buttons.PrevPage.Enabled = false;
-                    dataNavigator1.Buttons.First.Enabled = false;
-                    dataNavigator1.Buttons.PrevPage.Enabled = false;
-                }
-                else if (CurrentPage == TotalPage)
-                {
-                    dataNavigator1.Buttons.First.Enabled = true;
-                    dataNavigator1.Buttons.PrevPage.Enabled = true;
-                    dataNavigator1.Buttons.Last.Enabled = false;
-                    dataNavigator1.Buttons.NextPage.Enabled = false;
-                }
-                else
-                {
-                    dataNavigator1.Buttons.First.Enabled = true;
-                    dataNavigator1.Buttons.PrevPage.Enabled = true;
-                    dataNavigator1.Buttons.Last.Enabled = true;
-                    dataNavigator1.Buttons.NextPage.Enabled = true;
-                    dataNavigator1.Position = 1;
-                }
-                await PageCountChanged?.Invoke(CurrentPage);
-                dataNavigator1.TextStringFormat = $"第{CurrentPage}页/共{TotalPage}页";
-            }
-        }
-    }
-}

+ 2 - 2
DW5S.App/UserControl/CtrlRefCgRes.Designer.cs

@@ -30,7 +30,7 @@ namespace DW5S.App.UserControl
         private void InitializeComponent()
         {
             this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
-            this.ctrlPaging = new DW5S.App.UserControl.CtrlPaging();
+            this.ctrlPaging = new DW5S.App.UserControl.CtrlPage();
             this.gridCg = new DevExpress.XtraGrid.GridControl();
             this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
             this.txtTimeCho = new DevExpress.XtraEditors.ImageComboBoxEdit();
@@ -393,7 +393,7 @@ namespace DW5S.App.UserControl
         private DevExpress.XtraGrid.Views.Grid.GridView searchLookUpEdit1View;
         private DevExpress.XtraEditors.SimpleButton btnDraw;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
-        private CtrlPaging ctrlPaging;
+        private CtrlPage ctrlPaging;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
     }
 }

+ 6 - 6
DW5S.App/UserControl/CtrlRefCgRes.cs

@@ -35,14 +35,14 @@ namespace DW5S.App.UserControl
                 satList.AddRange(await repsSat.GetAllAsync(p => p.UpdateTime));
 
                 this.txtSat.UseDefault().SetData(satList, nameof(SatInfo.Sat)).UseDoubleClickToSelectAll();
-                ctrlPaging.CurrentPageChanged += async (int currentPage) =>
-                {
+                //ctrlPaging.CurrentPageChanged += async (int currentPage) =>
+                //{
 
-                };
-                ctrlPaging.PageCountChanged += async (int pageCount) =>
-                {
+                //};
+                //ctrlPaging.PageCountChanged += async (int pageCount) =>
+                //{
 
-                };
+                //};
 
             }
             catch (Exception ex)

+ 169 - 344
DW5S.App/UserControl/CtrlXl.Designer.cs

@@ -29,379 +29,213 @@
         private void InitializeComponent()
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CtrlXl));
-            this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
-            this.txtSat = new DevExpress.XtraEditors.SearchLookUpEdit();
-            this.searchLookUpEdit1View = new DevExpress.XtraGrid.Views.Grid.GridView();
-            this.btnGo = new DevExpress.XtraEditors.SimpleButton();
-            this.txtGoPage = new DevExpress.XtraEditors.TextEdit();
-            this.dataNavigator1 = new DevExpress.XtraEditors.DataNavigator();
-            this.btnImp = new DevExpress.XtraEditors.SimpleButton();
-            this.gridXl = new DevExpress.XtraGrid.GridControl();
-            this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
-            this.btnOpen = new DevExpress.XtraEditors.ButtonEdit();
-            this.txtCountPerPage = new DevExpress.XtraEditors.ComboBoxEdit();
-            this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
-            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.simpleLabelItem1 = new DevExpress.XtraLayout.SimpleLabelItem();
-            this.simpleLabelItem2 = new DevExpress.XtraLayout.SimpleLabelItem();
-            this.layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
-            this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
-            this.layoutControl1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.txtSat.Properties)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtGoPage.Properties)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.gridXl)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.btnOpen.Properties)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtCountPerPage.Properties)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem2)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
-            this.SuspendLayout();
+            layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
+            ctrlPage1 = new CtrlPage();
+            txtSat = new DevExpress.XtraEditors.SearchLookUpEdit();
+            searchLookUpEdit1View = new DevExpress.XtraGrid.Views.Grid.GridView();
+            btnImp = new DevExpress.XtraEditors.SimpleButton();
+            gridXl = new DevExpress.XtraGrid.GridControl();
+            gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
+            btnOpen = new DevExpress.XtraEditors.ButtonEdit();
+            Root = new DevExpress.XtraLayout.LayoutControlGroup();
+            layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
+            layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
+            layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
+            layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
+            layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
+            ((System.ComponentModel.ISupportInitialize)layoutControl1).BeginInit();
+            layoutControl1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)txtSat.Properties).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)searchLookUpEdit1View).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)gridXl).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)gridView1).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)btnOpen.Properties).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)Root).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem1).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem2).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem3).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem4).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem5).BeginInit();
+            SuspendLayout();
             // 
             // layoutControl1
             // 
-            this.layoutControl1.Controls.Add(this.txtSat);
-            this.layoutControl1.Controls.Add(this.btnGo);
-            this.layoutControl1.Controls.Add(this.txtGoPage);
-            this.layoutControl1.Controls.Add(this.dataNavigator1);
-            this.layoutControl1.Controls.Add(this.btnImp);
-            this.layoutControl1.Controls.Add(this.gridXl);
-            this.layoutControl1.Controls.Add(this.btnOpen);
-            this.layoutControl1.Controls.Add(this.txtCountPerPage);
-            this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.layoutControl1.Location = new System.Drawing.Point(0, 0);
-            this.layoutControl1.Name = "layoutControl1";
-            this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(1044, 185, 650, 400);
-            this.layoutControl1.Root = this.Root;
-            this.layoutControl1.Size = new System.Drawing.Size(647, 473);
-            this.layoutControl1.TabIndex = 0;
-            this.layoutControl1.Text = "layoutControl1";
+            layoutControl1.Controls.Add(ctrlPage1);
+            layoutControl1.Controls.Add(txtSat);
+            layoutControl1.Controls.Add(btnImp);
+            layoutControl1.Controls.Add(gridXl);
+            layoutControl1.Controls.Add(btnOpen);
+            layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+            layoutControl1.Location = new System.Drawing.Point(0, 0);
+            layoutControl1.Name = "layoutControl1";
+            layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(1044, 185, 650, 400);
+            layoutControl1.Root = Root;
+            layoutControl1.Size = new System.Drawing.Size(694, 473);
+            layoutControl1.TabIndex = 0;
+            layoutControl1.Text = "layoutControl1";
+            // 
+            // ctrlPage1
+            // 
+            ctrlPage1.Location = new System.Drawing.Point(4, 443);
+            ctrlPage1.Margin = new System.Windows.Forms.Padding(0);
+            ctrlPage1.MinimumSize = new System.Drawing.Size(100, 26);
+            ctrlPage1.Name = "ctrlPage1";
+            ctrlPage1.Size = new System.Drawing.Size(686, 26);
+            ctrlPage1.TabIndex = 13;
             // 
             // txtSat
             // 
-            this.txtSat.Location = new System.Drawing.Point(61, 32);
-            this.txtSat.Name = "txtSat";
-            this.txtSat.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
-            this.txtSat.Properties.PopupView = this.searchLookUpEdit1View;
-            this.txtSat.Size = new System.Drawing.Size(582, 20);
-            this.txtSat.StyleController = this.layoutControl1;
-            this.txtSat.TabIndex = 12;
-            this.txtSat.EditValueChanged += new System.EventHandler(this.TxtSat_EditValueChanged);
+            txtSat.Location = new System.Drawing.Point(61, 32);
+            txtSat.Name = "txtSat";
+            txtSat.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) });
+            txtSat.Properties.PopupView = searchLookUpEdit1View;
+            txtSat.Size = new System.Drawing.Size(629, 20);
+            txtSat.StyleController = layoutControl1;
+            txtSat.TabIndex = 12;
+            txtSat.EditValueChanged += TxtSat_EditValueChanged;
             // 
             // searchLookUpEdit1View
             // 
-            this.searchLookUpEdit1View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
-            this.searchLookUpEdit1View.Name = "searchLookUpEdit1View";
-            this.searchLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
-            this.searchLookUpEdit1View.OptionsView.ShowGroupPanel = false;
-            // 
-            // btnGo
-            // 
-            this.btnGo.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnGo.ImageOptions.SvgImage")));
-            this.btnGo.ImageOptions.SvgImageSize = new System.Drawing.Size(16, 16);
-            this.btnGo.Location = new System.Drawing.Point(623, 448);
-            this.btnGo.Name = "btnGo";
-            this.btnGo.Size = new System.Drawing.Size(20, 17);
-            this.btnGo.StyleController = this.layoutControl1;
-            this.btnGo.TabIndex = 11;
-            this.btnGo.ToolTip = "跳转";
-            this.btnGo.Click += new System.EventHandler(this.btnGo_Click);
-            // 
-            // txtGoPage
-            // 
-            this.txtGoPage.Location = new System.Drawing.Point(543, 448);
-            this.txtGoPage.Name = "txtGoPage";
-            this.txtGoPage.Properties.AutoHeight = false;
-            this.txtGoPage.Size = new System.Drawing.Size(76, 17);
-            this.txtGoPage.StyleController = this.layoutControl1;
-            this.txtGoPage.TabIndex = 9;
-            // 
-            // dataNavigator1
-            // 
-            this.dataNavigator1.Buttons.Append.Visible = false;
-            this.dataNavigator1.Buttons.CancelEdit.Visible = false;
-            this.dataNavigator1.Buttons.EndEdit.Visible = false;
-            this.dataNavigator1.Buttons.Next.Visible = false;
-            this.dataNavigator1.Buttons.Prev.Visible = false;
-            this.dataNavigator1.Buttons.Remove.Visible = false;
-            this.dataNavigator1.Location = new System.Drawing.Point(152, 448);
-            this.dataNavigator1.Name = "dataNavigator1";
-            this.dataNavigator1.Size = new System.Drawing.Size(152, 20);
-            this.dataNavigator1.StyleController = this.layoutControl1;
-            this.dataNavigator1.TabIndex = 8;
-            this.dataNavigator1.Text = "dataNavigator1";
-            this.dataNavigator1.TextLocation = DevExpress.XtraEditors.NavigatorButtonsTextLocation.Center;
-            this.dataNavigator1.TextStringFormat = "第{0}页/共{1}页";
-            this.dataNavigator1.ButtonClick += new DevExpress.XtraEditors.NavigatorButtonClickEventHandler(this.dataNavigator1_ButtonClick);
+            searchLookUpEdit1View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
+            searchLookUpEdit1View.Name = "searchLookUpEdit1View";
+            searchLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
+            searchLookUpEdit1View.OptionsView.ShowGroupPanel = false;
             // 
             // btnImp
             // 
-            this.btnImp.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnImp.ImageOptions.SvgImage")));
-            this.btnImp.Location = new System.Drawing.Point(547, 4);
-            this.btnImp.Name = "btnImp";
-            this.btnImp.Size = new System.Drawing.Size(96, 24);
-            this.btnImp.StyleController = this.layoutControl1;
-            this.btnImp.TabIndex = 6;
-            this.btnImp.Text = "导入";
-            this.btnImp.Click += new System.EventHandler(this.btnImp_Click);
+            btnImp.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("btnImp.ImageOptions.SvgImage");
+            btnImp.Location = new System.Drawing.Point(594, 4);
+            btnImp.Name = "btnImp";
+            btnImp.Size = new System.Drawing.Size(96, 24);
+            btnImp.StyleController = layoutControl1;
+            btnImp.TabIndex = 6;
+            btnImp.Text = "导入";
+            btnImp.Click += btnImp_Click;
             // 
             // gridXl
             // 
-            this.gridXl.EmbeddedNavigator.Buttons.Append.Visible = false;
-            this.gridXl.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
-            this.gridXl.EmbeddedNavigator.Buttons.Edit.Visible = false;
-            this.gridXl.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
-            this.gridXl.EmbeddedNavigator.Buttons.Next.Visible = false;
-            this.gridXl.EmbeddedNavigator.Buttons.Prev.Visible = false;
-            this.gridXl.EmbeddedNavigator.Buttons.Remove.Visible = false;
-            this.gridXl.EmbeddedNavigator.TextLocation = DevExpress.XtraEditors.NavigatorButtonsTextLocation.Begin;
-            this.gridXl.EmbeddedNavigator.TextStringFormat = "第{0}页/共{1}页";
-            this.gridXl.Location = new System.Drawing.Point(2, 54);
-            this.gridXl.MainView = this.gridView1;
-            this.gridXl.Name = "gridXl";
-            this.gridXl.Size = new System.Drawing.Size(643, 389);
-            this.gridXl.TabIndex = 5;
-            this.gridXl.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
-            this.gridView1});
+            gridXl.EmbeddedNavigator.Buttons.Append.Visible = false;
+            gridXl.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
+            gridXl.EmbeddedNavigator.Buttons.Edit.Visible = false;
+            gridXl.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
+            gridXl.EmbeddedNavigator.Buttons.Next.Visible = false;
+            gridXl.EmbeddedNavigator.Buttons.Prev.Visible = false;
+            gridXl.EmbeddedNavigator.Buttons.Remove.Visible = false;
+            gridXl.EmbeddedNavigator.TextLocation = DevExpress.XtraEditors.NavigatorButtonsTextLocation.Begin;
+            gridXl.EmbeddedNavigator.TextStringFormat = "第{0}页/共{1}页";
+            gridXl.Location = new System.Drawing.Point(2, 54);
+            gridXl.MainView = gridView1;
+            gridXl.Name = "gridXl";
+            gridXl.Size = new System.Drawing.Size(690, 387);
+            gridXl.TabIndex = 5;
+            gridXl.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView1 });
             // 
             // gridView1
             // 
-            this.gridView1.GridControl = this.gridXl;
-            this.gridView1.Name = "gridView1";
+            gridView1.GridControl = gridXl;
+            gridView1.Name = "gridView1";
             // 
             // btnOpen
             // 
-            this.btnOpen.Location = new System.Drawing.Point(61, 4);
-            this.btnOpen.Name = "btnOpen";
-            this.btnOpen.Properties.AutoHeight = false;
-            this.btnOpen.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton()});
-            this.btnOpen.Size = new System.Drawing.Size(482, 24);
-            this.btnOpen.StyleController = this.layoutControl1;
-            this.btnOpen.TabIndex = 4;
-            // 
-            // txtCountPerPage
-            // 
-            this.txtCountPerPage.EditValue = "5000";
-            this.txtCountPerPage.Location = new System.Drawing.Point(34, 448);
-            this.txtCountPerPage.Name = "txtCountPerPage";
-            this.txtCountPerPage.Properties.AutoHeight = false;
-            this.txtCountPerPage.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
-            this.txtCountPerPage.Properties.Items.AddRange(new object[] {
-            "100",
-            "500",
-            "1000",
-            "2000",
-            "5000",
-            "10000"});
-            this.txtCountPerPage.Size = new System.Drawing.Size(76, 18);
-            this.txtCountPerPage.StyleController = this.layoutControl1;
-            this.txtCountPerPage.TabIndex = 10;
-            this.txtCountPerPage.EditValueChanged += new System.EventHandler(this.txtCountPerPage_EditValueChanged);
+            btnOpen.Location = new System.Drawing.Point(61, 4);
+            btnOpen.Name = "btnOpen";
+            btnOpen.Properties.AutoHeight = false;
+            btnOpen.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton() });
+            btnOpen.Size = new System.Drawing.Size(529, 24);
+            btnOpen.StyleController = layoutControl1;
+            btnOpen.TabIndex = 4;
             // 
             // Root
             // 
-            this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
-            this.Root.GroupBordersVisible = false;
-            this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
-            this.layoutControlItem1,
-            this.layoutControlItem2,
-            this.layoutControlItem3,
-            this.layoutControlItem5,
-            this.layoutControlItem6,
-            this.layoutControlItem7,
-            this.simpleLabelItem1,
-            this.simpleLabelItem2,
-            this.layoutControlItem8,
-            this.emptySpaceItem1,
-            this.layoutControlItem4});
-            this.Root.Name = "Root";
-            this.Root.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 2, 2);
-            this.Root.Size = new System.Drawing.Size(647, 473);
-            this.Root.TextVisible = false;
+            Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
+            Root.GroupBordersVisible = false;
+            Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { layoutControlItem1, layoutControlItem2, layoutControlItem3, layoutControlItem4, layoutControlItem5 });
+            Root.Name = "Root";
+            Root.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 2, 2);
+            Root.Size = new System.Drawing.Size(694, 473);
+            Root.TextVisible = false;
             // 
             // layoutControlItem1
             // 
-            this.layoutControlItem1.Control = this.btnOpen;
-            this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
-            this.layoutControlItem1.MaxSize = new System.Drawing.Size(0, 28);
-            this.layoutControlItem1.MinSize = new System.Drawing.Size(118, 28);
-            this.layoutControlItem1.Name = "layoutControlItem1";
-            this.layoutControlItem1.Size = new System.Drawing.Size(543, 28);
-            this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.layoutControlItem1.Text = "星历文件";
-            this.layoutControlItem1.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.CustomSize;
-            this.layoutControlItem1.TextSize = new System.Drawing.Size(52, 14);
-            this.layoutControlItem1.TextToControlDistance = 5;
+            layoutControlItem1.Control = btnOpen;
+            layoutControlItem1.Location = new System.Drawing.Point(0, 0);
+            layoutControlItem1.MaxSize = new System.Drawing.Size(0, 28);
+            layoutControlItem1.MinSize = new System.Drawing.Size(118, 28);
+            layoutControlItem1.Name = "layoutControlItem1";
+            layoutControlItem1.Size = new System.Drawing.Size(590, 28);
+            layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            layoutControlItem1.Text = "星历文件";
+            layoutControlItem1.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.CustomSize;
+            layoutControlItem1.TextSize = new System.Drawing.Size(52, 14);
+            layoutControlItem1.TextToControlDistance = 5;
             // 
             // layoutControlItem2
             // 
-            this.layoutControlItem2.Control = this.gridXl;
-            this.layoutControlItem2.Location = new System.Drawing.Point(0, 52);
-            this.layoutControlItem2.Name = "layoutControlItem2";
-            this.layoutControlItem2.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
-            this.layoutControlItem2.Size = new System.Drawing.Size(643, 389);
-            this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
-            this.layoutControlItem2.TextVisible = false;
+            layoutControlItem2.Control = gridXl;
+            layoutControlItem2.Location = new System.Drawing.Point(0, 52);
+            layoutControlItem2.Name = "layoutControlItem2";
+            layoutControlItem2.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
+            layoutControlItem2.Size = new System.Drawing.Size(690, 387);
+            layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
+            layoutControlItem2.TextVisible = false;
             // 
             // layoutControlItem3
             // 
-            this.layoutControlItem3.Control = this.btnImp;
-            this.layoutControlItem3.Location = new System.Drawing.Point(543, 0);
-            this.layoutControlItem3.MaxSize = new System.Drawing.Size(100, 28);
-            this.layoutControlItem3.MinSize = new System.Drawing.Size(100, 28);
-            this.layoutControlItem3.Name = "layoutControlItem3";
-            this.layoutControlItem3.Size = new System.Drawing.Size(100, 28);
-            this.layoutControlItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
-            this.layoutControlItem3.TextVisible = false;
-            // 
-            // layoutControlItem5
-            // 
-            this.layoutControlItem5.Control = this.dataNavigator1;
-            this.layoutControlItem5.Location = new System.Drawing.Point(148, 441);
-            this.layoutControlItem5.MaxSize = new System.Drawing.Size(156, 25);
-            this.layoutControlItem5.MinSize = new System.Drawing.Size(156, 25);
-            this.layoutControlItem5.Name = "layoutControlItem5";
-            this.layoutControlItem5.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 5, 2);
-            this.layoutControlItem5.Size = new System.Drawing.Size(156, 28);
-            this.layoutControlItem5.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0);
-            this.layoutControlItem5.TextVisible = false;
-            // 
-            // layoutControlItem6
-            // 
-            this.layoutControlItem6.Control = this.txtGoPage;
-            this.layoutControlItem6.Location = new System.Drawing.Point(539, 441);
-            this.layoutControlItem6.MaxSize = new System.Drawing.Size(80, 24);
-            this.layoutControlItem6.MinSize = new System.Drawing.Size(80, 24);
-            this.layoutControlItem6.Name = "layoutControlItem6";
-            this.layoutControlItem6.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 5, 2);
-            this.layoutControlItem6.Size = new System.Drawing.Size(80, 28);
-            this.layoutControlItem6.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0);
-            this.layoutControlItem6.TextVisible = false;
-            // 
-            // layoutControlItem7
+            layoutControlItem3.Control = btnImp;
+            layoutControlItem3.Location = new System.Drawing.Point(590, 0);
+            layoutControlItem3.MaxSize = new System.Drawing.Size(100, 28);
+            layoutControlItem3.MinSize = new System.Drawing.Size(100, 28);
+            layoutControlItem3.Name = "layoutControlItem3";
+            layoutControlItem3.Size = new System.Drawing.Size(100, 28);
+            layoutControlItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
+            layoutControlItem3.TextVisible = false;
             // 
-            this.layoutControlItem7.Control = this.txtCountPerPage;
-            this.layoutControlItem7.Location = new System.Drawing.Point(30, 441);
-            this.layoutControlItem7.MaxSize = new System.Drawing.Size(80, 25);
-            this.layoutControlItem7.MinSize = new System.Drawing.Size(80, 25);
-            this.layoutControlItem7.Name = "layoutControlItem7";
-            this.layoutControlItem7.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 5, 2);
-            this.layoutControlItem7.Size = new System.Drawing.Size(80, 28);
-            this.layoutControlItem7.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.layoutControlItem7.TextSize = new System.Drawing.Size(0, 0);
-            this.layoutControlItem7.TextVisible = false;
-            // 
-            // simpleLabelItem1
-            // 
-            this.simpleLabelItem1.AllowHotTrack = false;
-            this.simpleLabelItem1.Location = new System.Drawing.Point(0, 441);
-            this.simpleLabelItem1.MaxSize = new System.Drawing.Size(30, 28);
-            this.simpleLabelItem1.MinSize = new System.Drawing.Size(30, 28);
-            this.simpleLabelItem1.Name = "simpleLabelItem1";
-            this.simpleLabelItem1.Size = new System.Drawing.Size(30, 28);
-            this.simpleLabelItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.simpleLabelItem1.Text = "每页";
-            this.simpleLabelItem1.TextSize = new System.Drawing.Size(24, 14);
-            // 
-            // simpleLabelItem2
-            // 
-            this.simpleLabelItem2.AllowHotTrack = false;
-            this.simpleLabelItem2.Location = new System.Drawing.Point(110, 441);
-            this.simpleLabelItem2.MaxSize = new System.Drawing.Size(38, 25);
-            this.simpleLabelItem2.MinSize = new System.Drawing.Size(38, 25);
-            this.simpleLabelItem2.Name = "simpleLabelItem2";
-            this.simpleLabelItem2.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 20, 2, 2);
-            this.simpleLabelItem2.Size = new System.Drawing.Size(38, 28);
-            this.simpleLabelItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.simpleLabelItem2.Text = "条";
-            this.simpleLabelItem2.TextSize = new System.Drawing.Size(24, 14);
-            // 
-            // layoutControlItem8
-            // 
-            this.layoutControlItem8.Control = this.btnGo;
-            this.layoutControlItem8.Location = new System.Drawing.Point(619, 441);
-            this.layoutControlItem8.MaxSize = new System.Drawing.Size(24, 24);
-            this.layoutControlItem8.MinSize = new System.Drawing.Size(24, 24);
-            this.layoutControlItem8.Name = "layoutControlItem8";
-            this.layoutControlItem8.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 5, 2);
-            this.layoutControlItem8.Size = new System.Drawing.Size(24, 28);
-            this.layoutControlItem8.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
-            this.layoutControlItem8.TextSize = new System.Drawing.Size(0, 0);
-            this.layoutControlItem8.TextVisible = false;
-            // 
-            // emptySpaceItem1
+            // layoutControlItem4
             // 
-            this.emptySpaceItem1.AllowHotTrack = false;
-            this.emptySpaceItem1.Location = new System.Drawing.Point(304, 441);
-            this.emptySpaceItem1.Name = "emptySpaceItem1";
-            this.emptySpaceItem1.Size = new System.Drawing.Size(235, 28);
-            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
+            layoutControlItem4.Control = txtSat;
+            layoutControlItem4.Location = new System.Drawing.Point(0, 28);
+            layoutControlItem4.Name = "layoutControlItem4";
+            layoutControlItem4.Size = new System.Drawing.Size(690, 24);
+            layoutControlItem4.Text = "卫星";
+            layoutControlItem4.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.CustomSize;
+            layoutControlItem4.TextSize = new System.Drawing.Size(50, 20);
+            layoutControlItem4.TextToControlDistance = 7;
             // 
-            // layoutControlItem4
+            // layoutControlItem5
             // 
-            this.layoutControlItem4.Control = this.txtSat;
-            this.layoutControlItem4.Location = new System.Drawing.Point(0, 28);
-            this.layoutControlItem4.Name = "layoutControlItem4";
-            this.layoutControlItem4.Size = new System.Drawing.Size(643, 24);
-            this.layoutControlItem4.Text = "卫星";
-            this.layoutControlItem4.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.CustomSize;
-            this.layoutControlItem4.TextSize = new System.Drawing.Size(50, 20);
-            this.layoutControlItem4.TextToControlDistance = 7;
+            layoutControlItem5.Control = ctrlPage1;
+            layoutControlItem5.Location = new System.Drawing.Point(0, 439);
+            layoutControlItem5.MaxSize = new System.Drawing.Size(0, 30);
+            layoutControlItem5.MinSize = new System.Drawing.Size(104, 30);
+            layoutControlItem5.Name = "layoutControlItem5";
+            layoutControlItem5.Size = new System.Drawing.Size(690, 30);
+            layoutControlItem5.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            layoutControlItem5.TextSize = new System.Drawing.Size(0, 0);
+            layoutControlItem5.TextVisible = false;
             // 
             // CtrlXl
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.Controls.Add(this.layoutControl1);
-            this.Name = "CtrlXl";
-            this.Size = new System.Drawing.Size(647, 473);
-            this.Load += new System.EventHandler(this.CtrlXl_Load);
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
-            this.layoutControl1.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.txtSat.Properties)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtGoPage.Properties)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.gridXl)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.btnOpen.Properties)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtCountPerPage.Properties)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem2)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
-            this.ResumeLayout(false);
-
+            AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
+            AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            Controls.Add(layoutControl1);
+            Name = "CtrlXl";
+            Size = new System.Drawing.Size(694, 473);
+            Load += CtrlXl_Load;
+            ((System.ComponentModel.ISupportInitialize)layoutControl1).EndInit();
+            layoutControl1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)txtSat.Properties).EndInit();
+            ((System.ComponentModel.ISupportInitialize)searchLookUpEdit1View).EndInit();
+            ((System.ComponentModel.ISupportInitialize)gridXl).EndInit();
+            ((System.ComponentModel.ISupportInitialize)gridView1).EndInit();
+            ((System.ComponentModel.ISupportInitialize)btnOpen.Properties).EndInit();
+            ((System.ComponentModel.ISupportInitialize)Root).EndInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem1).EndInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem2).EndInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem3).EndInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem4).EndInit();
+            ((System.ComponentModel.ISupportInitialize)layoutControlItem5).EndInit();
+            ResumeLayout(false);
         }
 
         #endregion
@@ -415,19 +249,10 @@
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
         private DevExpress.XtraEditors.SimpleButton btnImp;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
-        private DevExpress.XtraEditors.TextEdit txtGoPage;
-        private DevExpress.XtraEditors.DataNavigator dataNavigator1;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
-        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
-        private DevExpress.XtraLayout.SimpleLabelItem simpleLabelItem1;
-        private DevExpress.XtraLayout.SimpleLabelItem simpleLabelItem2;
-        private DevExpress.XtraEditors.SimpleButton btnGo;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8;
-        private DevExpress.XtraEditors.ComboBoxEdit txtCountPerPage;
         private DevExpress.XtraEditors.SearchLookUpEdit txtSat;
         private DevExpress.XtraGrid.Views.Grid.GridView searchLookUpEdit1View;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
+        private CtrlPage ctrlPage1;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
     }
 }

+ 29 - 201
DW5S.App/UserControl/CtrlXl.cs

@@ -16,6 +16,8 @@ using DW5S.Repostory;
 using Serilog;
 using static DevExpress.Xpo.Helpers.AssociatedCollectionCriteriaHelper;
 using DW5S.Service;
+using DevExpress.Skins;
+using DevExpress.XtraSpreadsheet.Model;
 
 namespace DW5S.App.UserControl
 {
@@ -30,29 +32,23 @@ namespace DW5S.App.UserControl
         {
             InitializeComponent();
             this.layoutControl1.UseDefault();
+            this.ctrlPage1.Compact = false;
+            this.ctrlPage1.ShowGoto = true;
             btnOpen.UseChooseFile().UseDoubleClickToSelectAll();
 
         }
 
-        private async void TxtSat_EditValueChanged(object sender, EventArgs e)
+        private void TxtSat_EditValueChanged(object sender, EventArgs e)
         {
             var sat = txtSat.EditValue as SatInfo;
             satCode = sat?.SatCode;
-            var unitOfWork = IocContainer.UnitOfWork;
-            var repsXl = unitOfWork.Of<XlInfo>() as XlRepository;
-            this.maxCount = await repsXl.GetCount(satCode);
-            var countPerPage = Convert.ToInt32(txtCountPerPage.Text);
-            this.maxPage = maxCount / countPerPage;
-            if (maxCount % countPerPage != 0)
-                maxPage++;
-            currentPage = 1;
-            dataNavigator1.TextStringFormat = $"第{1}页/共{maxPage}页";
-            await LoadPageData(1);
+            ctrlPage1.RefreshData();
 
         }
 
         private async void CtrlXl_Load(object sender, EventArgs e)
         {
+            ctrlPage1.OnQueryAsync += ctrlPage1_OnQueryAsync;
             var unitOfWork = IocContainer.UnitOfWork;
             var repsXl = unitOfWork.Of<XlInfo>() as XlRepository;
             var sat = await repsXl.GetAllSat();
@@ -71,60 +67,31 @@ namespace DW5S.App.UserControl
                 var item = gridView1.GetRow(ids[0]) as XlInfo;
                 XlCalculateForm form = new XlCalculateForm(item.TwoLine);
                 form.ShowDialog();
-            })
-            .AddMenu("刷新数据", SvgHelper.CreateRefresh(), async () =>
-            {
-                currentPage = 1;
-                dataNavigator1.Buttons.First.Enabled = false;
-                dataNavigator1.Buttons.PrevPage.Enabled = false;
-                dataNavigator1.Buttons.Last.Enabled = true;
-                dataNavigator1.Buttons.NextPage.Enabled = true;
-                dataNavigator1.TextStringFormat = $"第{currentPage}页/共{maxPage}页";
-                await LoadPageData(currentPage);
             });
-            await LoadData(1);
-            dataNavigator1.TextStringFormat = $"第{currentPage}页/共{maxPage}页";
-            dataNavigator1.DataSource = list;
-            dataNavigator1.Buttons.First.Enabled = false;
-            dataNavigator1.Buttons.PrevPage.Enabled = false;
-        }
-        public async Task LoadData(int currentPage)
-        {
-            try
-            {
-                var unitOfWork = IocContainer.UnitOfWork;
-                var repsXl = unitOfWork.Of<XlInfo>() as XlRepository;
-                this.maxCount = await repsXl.GetCount(satCode);
-                var countPerPage = Convert.ToInt32(txtCountPerPage.Text);
-                this.maxPage = maxCount / countPerPage;
-                if (maxCount % countPerPage != 0)
-                    maxPage++;
-                await LoadPageData(1);
-            }
-            catch (Exception ex)
-            {
-                string msg = "加载星历信息异常";
-                IocContainer.Logger.Error(ex, msg);
-                DxHelper.MsgBoxHelper.ShowError(msg);
-            }
+            //.AddMenu("刷新数据", SvgHelper.CreateRefresh(),  () =>
+            //{
+            //    currentPage = 1;
+            //    ctrlPage1.RefreshData();
+            //});
+            ctrlPage1.RefreshData();
         }
-        private async Task LoadPageData(int currentPage)
+
+        private async Task<PageData> ctrlPage1_OnQueryAsync(PageQueryDto arg)
         {
-            var unitOfWork = IocContainer.UnitOfWork;
-            var repsXl = unitOfWork.Of<XlInfo>() as XlRepository;
-            var dtResult = await repsXl.GetPageAsync(currentPage, Convert.ToInt32(txtCountPerPage.Text), satCode);
+            var repsXl = IocContainer.UnitOfWork.Of<XlInfo>();
+            var queryable = repsXl.AsQueryable();
+            if (satCode != null)
+                queryable = queryable.Where(x => x.SatCode == satCode);
+            queryable = queryable.OrderByDescending(p => p.TimeUTC).ThenByDescending(p => p.Lon);
+            var pageData = await repsXl.GetPageData(arg, queryable);
             list.Clear();
-            list.AddRange(dtResult);
+            list.AddRange(pageData.Data);
             gridView1.RefreshData();
-            if (maxPage == 1)
-            {
-                dataNavigator1.Buttons.First.Enabled = false;
-                dataNavigator1.Buttons.PrevPage.Enabled = false;
-                dataNavigator1.Buttons.Last.Enabled = false;
-                dataNavigator1.Buttons.NextPage.Enabled = false;
-            }
-
+            return pageData;
         }
+
+
+
         private async void btnImp_Click(object sender, EventArgs e)
         {
             this.layoutControl1.Enabled = false;
@@ -154,7 +121,7 @@ namespace DW5S.App.UserControl
                 if (result.code == 200)
                 {
                     DxHelper.MsgBoxHelper.ShowInfo($"星历导入成功.共导入{result.data.Count}条");
-                    await LoadData(1);
+                    ctrlPage1.RefreshData();
                 }
                 else
                 {
@@ -182,7 +149,7 @@ namespace DW5S.App.UserControl
                 var repsXl = unitOfWork.Of<XlInfo>();
                 await repsXl.DeleteAsync(list);
                 await unitOfWork.SaveAsync();
-                await LoadData(1);
+                ctrlPage1.RefreshData();
                 return true;
             }
             catch (Exception ex)
@@ -206,7 +173,7 @@ namespace DW5S.App.UserControl
                 var repsXl = unitOfWork.Of<XlInfo>();
                 await repsXl.DeleteAsync(list);
                 await unitOfWork.SaveAsync();
-                await LoadData(1);
+                ctrlPage1.RefreshData();
                 return true;
             }
             catch (Exception ex)
@@ -221,144 +188,5 @@ namespace DW5S.App.UserControl
                 this.Enabled = true;
             }
         }
-        private async void dataNavigator1_ButtonClick(object sender, NavigatorButtonClickEventArgs e)
-        {
-            if (e.Button.ButtonType == NavigatorButtonType.First)
-            {
-                currentPage = 1;
-                dataNavigator1.Buttons.First.Enabled = false;
-                dataNavigator1.Buttons.PrevPage.Enabled = false;
-                dataNavigator1.Buttons.Last.Enabled = true;
-                dataNavigator1.Buttons.NextPage.Enabled = true;
-
-            }
-            else if (e.Button.ButtonType == NavigatorButtonType.Last)
-            {
-                currentPage = maxPage;
-                dataNavigator1.Buttons.Last.Enabled = false;
-                dataNavigator1.Buttons.NextPage.Enabled = false;
-                dataNavigator1.Buttons.First.Enabled = true;
-                dataNavigator1.Buttons.PrevPage.Enabled = true;
-            }
-            else if (e.Button.ButtonType == NavigatorButtonType.NextPage)
-            {
-                currentPage++;
-                dataNavigator1.Buttons.First.Enabled = true;
-                dataNavigator1.Buttons.PrevPage.Enabled = true;
-                if (currentPage >= maxPage)
-                {
-                    dataNavigator1.Buttons.Last.Enabled = false;
-                    dataNavigator1.Buttons.NextPage.Enabled = false;
-                }
-                else
-                {
-                    dataNavigator1.Buttons.Last.Enabled = true;
-                    dataNavigator1.Buttons.NextPage.Enabled = true;
-                }
-            }
-            else if (e.Button.ButtonType == NavigatorButtonType.PrevPage)
-            {
-                currentPage--;
-                dataNavigator1.Buttons.Last.Enabled = true;
-                dataNavigator1.Buttons.NextPage.Enabled = true;
-                if (currentPage == 1)
-                {
-                    dataNavigator1.Buttons.First.Enabled = false;
-                    dataNavigator1.Buttons.PrevPage.Enabled = false;
-                }
-            }
-            await LoadPageData(currentPage);
-            dataNavigator1.TextStringFormat = $"第{currentPage}页/共{maxPage}页";
-        }
-
-        private async void btnGo_Click(object sender, EventArgs e)
-        {
-            int.TryParse(txtGoPage.Text, out int _currentPage);
-            if (_currentPage > maxPage)
-            {
-                _currentPage = maxPage;
-            }
-            if (_currentPage > 0)
-            {
-                currentPage = _currentPage;
-                if (currentPage == 1 && currentPage < maxPage)
-                {
-                    dataNavigator1.Buttons.First.Enabled = false;
-                    dataNavigator1.Buttons.PrevPage.Enabled = false;
-                    dataNavigator1.Buttons.Last.Enabled = true;
-                    dataNavigator1.Buttons.NextPage.Enabled = true;
-                }
-                else if (currentPage == 1 && currentPage == maxPage)
-                {
-                    dataNavigator1.Buttons.First.Enabled = false;
-                    dataNavigator1.Buttons.PrevPage.Enabled = false;
-                    dataNavigator1.Buttons.First.Enabled = false;
-                    dataNavigator1.Buttons.PrevPage.Enabled = false;
-                }
-                else if (currentPage == maxPage)
-                {
-                    dataNavigator1.Buttons.First.Enabled = true;
-                    dataNavigator1.Buttons.PrevPage.Enabled = true;
-                    dataNavigator1.Buttons.Last.Enabled = false;
-                    dataNavigator1.Buttons.NextPage.Enabled = false;
-                    if (dataNavigator1.Position == 0)
-                        dataNavigator1.Position = 1;
-                }
-                else
-                {
-                    dataNavigator1.Buttons.First.Enabled = true;
-                    dataNavigator1.Buttons.PrevPage.Enabled = true;
-                    dataNavigator1.Buttons.Last.Enabled = true;
-                    dataNavigator1.Buttons.NextPage.Enabled = true;
-                    dataNavigator1.Position = 1;
-                }
-                dataNavigator1.TextStringFormat = $"第{currentPage}页/共{maxPage}页";
-                await LoadPageData(currentPage);
-            }
-        }
-
-        private async void txtCountPerPage_EditValueChanged(object sender, EventArgs e)
-        {
-            int.TryParse(txtCountPerPage.Text, out int countPerPage);
-            if (countPerPage > 0)
-            {
-                this.maxPage = maxCount / countPerPage;
-                if (maxCount % countPerPage != 0)
-                    maxPage++;
-                if (currentPage > maxPage)
-                    currentPage = maxPage;
-                if (currentPage == 1 && currentPage < maxPage)
-                {
-                    dataNavigator1.Buttons.First.Enabled = false;
-                    dataNavigator1.Buttons.PrevPage.Enabled = false;
-                    dataNavigator1.Buttons.Last.Enabled = true;
-                    dataNavigator1.Buttons.NextPage.Enabled = true;
-                }
-                else if (currentPage == 1 && currentPage == maxPage)
-                {
-                    dataNavigator1.Buttons.First.Enabled = false;
-                    dataNavigator1.Buttons.PrevPage.Enabled = false;
-                    dataNavigator1.Buttons.First.Enabled = false;
-                    dataNavigator1.Buttons.PrevPage.Enabled = false;
-                }
-                else if (currentPage == maxPage)
-                {
-                    dataNavigator1.Buttons.First.Enabled = true;
-                    dataNavigator1.Buttons.PrevPage.Enabled = true;
-                    dataNavigator1.Buttons.Last.Enabled = false;
-                    dataNavigator1.Buttons.NextPage.Enabled = false;
-                }
-                else
-                {
-                    dataNavigator1.Buttons.First.Enabled = true;
-                    dataNavigator1.Buttons.PrevPage.Enabled = true;
-                    dataNavigator1.Buttons.Last.Enabled = true;
-                    dataNavigator1.Buttons.NextPage.Enabled = true;
-                    dataNavigator1.Position = 1;
-                }
-                dataNavigator1.TextStringFormat = $"第{currentPage}页/共{maxPage}页";
-                await LoadPageData(currentPage);
-            }
-        }
     }
 }

+ 27 - 46
DW5S.App/UserControl/CtrlXl.resx

@@ -1,24 +1,24 @@
 <?xml version="1.0" encoding="utf-8"?>
 <root>
-  <!-- 
+  <!--
     Microsoft ResX Schema 
-    
+
     Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
+
+    The primary goals of this format is to allow a simple XML format
+    that is mostly human readable. The generation and parsing of the
+    various data types are done through the TypeConverter classes
     associated with the data types.
-    
+
     Example:
-    
+
     ... ado.net/XML headers & schema ...
     <resheader name="resmimetype">text/microsoft-resx</resheader>
     <resheader name="version">2.0</resheader>
     <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
     <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
     <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
     <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
         <value>[base64 mime encoded serialized .NET Framework object]</value>
     </data>
@@ -26,36 +26,36 @@
         <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
         <comment>This is a comment</comment>
     </data>
-                
-    There are any number of "resheader" rows that contain simple 
+
+    There are any number of "resheader" rows that contain simple
     name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
+
+    Each data row contains a name, and value. The row also contains a
+    type or mimetype. Type corresponds to a .NET class that support
+    text/value conversion through the TypeConverter architecture.
+    Classes that don't support this are serialized and stored with the
     mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
+
+    The mimetype is used for serialized objects, and tells the
+    ResXResourceReader how to depersist the object. This is currently not
     extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
+
+    Note - application/x-microsoft.net.object.binary.base64 is the format
+    that the ResXResourceWriter will generate, however the reader can
     read any of the formats listed below.
-    
+
     mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
+    value   : The object must be serialized with
             : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
             : and then encoded with base64 encoding.
     
     mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
+    value   : The object must be serialized with
             : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
             : and then encoded with base64 encoding.
 
     mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
+    value   : The object must be serialized into a byte array
             : using a System.ComponentModel.TypeConverter
             : and then encoded with base64 encoding.
     -->
@@ -117,26 +117,7 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <assembly alias="DevExpress.Data.v23.2" name="DevExpress.Data.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
-  <data name="btnGo.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi4z
-        LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
-        dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAK4CAAAC77u/
-        PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
-        IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
-        MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
-        Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg
-        MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLlllbGxvd3tmaWxsOiNGRkIxMTU7fQoJ
-        LlJlZHtmaWxsOiNEMTFDMUM7fQoJLkJsYWNre2ZpbGw6IzcyNzI3Mjt9CgkuQmx1ZXtmaWxsOiMxMTc3
-        RDc7fQoJLldoaXRle2ZpbGw6I0ZGRkZGRjt9CgkuR3JlZW57ZmlsbDojMDM5QzIzO30KCS5zdDB7b3Bh
-        Y2l0eTowLjc1O30KCS5zdDF7b3BhY2l0eTowLjU7fQoJLnN0MntvcGFjaXR5OjAuMjU7fQoJLnN0M3tm
-        aWxsOiNGRkIxMTU7fQo8L3N0eWxlPg0KICA8ZyBpZD0iRHJpbGxEb3duIj4NCiAgICA8cGF0aCBkPSJN
-        MjQsMThjMC03LjctNi4zLTE0LTE0LTE0QzYuNiw0LDMuNiw1LjIsMS4yLDcuMkw0LDEwYzEuNy0xLjMs
-        My43LTIsNi0yYzUuNSwwLDEwLDQuNSwxMCwxMGgtOGwxMCwxMGwxMC0xMCAgIEgyNHoiIGNsYXNzPSJC
-        bHVlIiAvPg0KICA8L2c+DQo8L3N2Zz4L
-</value>
-  </data>
+  <assembly alias="DevExpress.Data.v23.2" name="DevExpress.Data.v23.2, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
   <data name="btnImp.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi4z

+ 64 - 0
DW5S.DTO/PageQueryDto.cs

@@ -0,0 +1,64 @@
+using Microsoft.AspNetCore.DataProtection.KeyManagement;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DW5S.DTO
+{
+    /// <summary>
+    /// 分页查询参数
+    /// </summary>
+    public  class PageQueryDto
+    {
+        /// <summary>
+        /// 页数(从1开始)
+        /// </summary>
+        public int Page { get; set; }
+
+        /// <summary>
+        /// 每页显示条数
+        /// </summary>
+        public int CountPerPage { get; set; }
+    }
+
+    /// <summary>
+    /// 分页查询结果
+    /// </summary>
+    public abstract class PageData
+    {
+        /// <summary>
+        /// 记录总条数
+        /// </summary>
+        public long TotalCount { get; set; }
+
+        /// <summary>
+        /// 每页显示条数
+        /// </summary>
+        public int CountPerPage { get; set; }
+
+        /// <summary>
+        /// 总页数
+        /// </summary>
+        public int TotalPage => (int)(TotalCount / CountPerPage) + (TotalCount % CountPerPage == 0 ? 0 : 1);
+
+        /// <summary>
+        /// 当前页数(从1开始)
+        /// </summary>
+        public int Page { get; set; }
+    }
+
+    /// <summary>
+    /// 分页查询结果
+    /// </summary>
+    public class PageData<TEntity>:PageData
+    {
+
+        /// <summary>
+        /// 当前页数据
+        /// </summary>
+        public IEnumerable<TEntity> Data { get; set; }
+    }
+}

+ 1 - 0
DW5S.Entity/03.DW5S.Entity.csproj

@@ -15,6 +15,7 @@
 
 	<ItemGroup>
 		<ProjectReference Include="..\DW5S.Basic\01.DW5S.Basic.csproj" />
+		<ProjectReference Include="..\DW5S.DTO\02.DW5S.DTO.csproj" />
 	</ItemGroup>
 	<ItemGroup>
 		<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.20" />

+ 27 - 1
DW5S.Repostory/Repository/IRepository.cs

@@ -1,4 +1,5 @@
-using DW5S.Entity;
+using DW5S.DTO;
+using DW5S.Entity;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore.ChangeTracking;
 using Microsoft.EntityFrameworkCore.Query;
@@ -42,6 +43,9 @@ namespace DW5S.Repostory
         Task<bool> AnyAsync(Expression<Func<T, bool>> predicate = null);
 
         T MaxBy<TResult>(Expression<Func<T, TResult>> selector, Expression<Func<T, bool>> predicate = null);
+
+        Task<PageData<T>> GetPageData(PageQueryDto dto, IQueryable<T> queryable);
+
     }
 
     public class Repository<T, IDType> : IRepository<T, IDType> where T : BaseEntity<IDType>
@@ -66,6 +70,28 @@ namespace DW5S.Repostory
         {
             return await dbSet.ToListAsync();
         }
+        public async Task<PageData<T>> GetPageData(PageQueryDto dto,IQueryable<T> queryable)
+        {
+            if (dto.Page < 1) dto.Page = 1;
+            var count =await queryable.LongCountAsync();
+           
+            PageData<T> pageData = new PageData<T>()
+            {
+                 CountPerPage=dto.CountPerPage,
+                 TotalCount=count,
+            };
+            if (pageData.TotalPage < dto.Page)
+            {
+                dto.Page = pageData.TotalPage;//没有这么多页就查询最后一页数据
+            }
+            int skip = dto.CountPerPage * (dto.Page - 1);
+            queryable = queryable.Skip(skip).Take(dto.CountPerPage);
+            var data =await queryable.ToListAsync();
+            pageData.Page = dto.Page;
+            pageData.Data = data;
+            return pageData;
+
+        }
 
         public async Task<IEnumerable<T>> GetAllAsync<TKey>(Expression<Func<T, TKey>> keySelector = null, bool asc = true)
         {

+ 2 - 0
DW5S.Repostory/UnitOfWork.cs

@@ -10,6 +10,7 @@ namespace DW5S.Repostory
     public interface IUnitOfWork : IAsyncDisposable
     {
         IRepository<TEntity, int> Of<TEntity>() where TEntity : BaseEntity<int>;
+
         IRepository<TEntity, long> OfLong<TEntity>() where TEntity : BaseEntity<long>;
 
         IRepository<TEntity,IDType> OfType<TEntity, IDType>() where TEntity : BaseEntity<IDType>;
@@ -31,6 +32,7 @@ namespace DW5S.Repostory
             var reps = IocContainer.GetService<IRepository<TEntity,int>>(ctx);
             return reps;
         }
+
         public IRepository<TEntity, long> OfLong<TEntity>() where TEntity : BaseEntity<long>
         {
             //UnitOfWork中的DbContext必须和Repository中的DbContext是同一个对象