lu
2025-04-14 ecb7a60de1639f520712ce95f99414b0dd2c9713
DevApp/Gs.DevApp/UserControl/ShowLogcs.cs
@@ -1,43 +1,28 @@
using DevExpress.XtraEditors;
using Gs.DevApp.Entity;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Gs.DevApp.UserControl
{
    public partial class ShowLogcs : DevExpress.XtraEditors.XtraForm
    {
        public ShowLogcs()
        public string guidKey;
        public ShowLogcs(string _guidKey)
        {
            this.guidKey = _guidKey;
            InitializeComponent();
            getPageList(1, UtilityHelper.GetPageSize());
            pageBar1.PagerEvent += PageBar1_PagerEvent;
            gridView1.IndicatorWidth = 50;
            gridView1.CustomDrawRowIndicator += (s, e) =>
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, null, "", (value) =>
            {
                if (e.Info.IsRowIndicator && e.RowHandle >= 0)
                    e.Info.DisplayText = (e.RowHandle + 1).ToString();
            };
            }, null, false);
            getPageList(1, UtilityHelper.GetPageSize());
        }
        /// <summary>
        ///     分页事件
        /// </summary>
        /// <param name="curPage"></param>
        /// <param name="pageSize"></param>
        private void PageBar1_PagerEvent(int curPage, int pageSize)
        {
            getPageList(curPage, pageSize);
        }
        /// <summary>
        /// </summary>
@@ -46,7 +31,8 @@
        private void getPageList(int curPage, int pageSize)
        {
            var _sbSqlWhere = new StringBuilder();
            var pgq = new PageQueryModel(curPage, pageSize, "OPERATION_TIME",
            _sbSqlWhere.Append(" and ABT_GUID='" + this.guidKey + "'");
            var pgq = new PageQueryModel(curPage, 999999, "OPERATION_TIME",
                "desc", "", _sbSqlWhere.ToString());
            var json = JsonConvert.SerializeObject(pgq);
            try
@@ -60,12 +46,7 @@
                    gcMain.BindingContext = new BindingContext();
                    gcMain.DataSource = dt;
                    gcMain.ForceInitialize();
                    int dddd = dd.rtnData.pages;//总页
                    pageBar1.TotalPages = dddd;
                    pageBar1.RecordCount = dd.rtnData.total;//记录总数
                    pageBar1.CurrentPage = curPage;//当前页
                    pageBar1.RowsCount = pageSize;//每页显示
                    pageBar1.setTxt();
                    gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
                }
                else
                {