From 620d0b409c3fb3294978b45ae16423e5dcc59f7a Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期一, 02 十二月 2024 16:55:08 +0800
Subject: [PATCH] 1
---
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs | 119 +++++++++++++++++++++++++++++------------------------------
1 files changed, 59 insertions(+), 60 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs
index a1e2cfd..2b46c9a 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs
@@ -1,11 +1,13 @@
using Gs.DevApp.DevFrm.QC.Models;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
+using Gs.DevApp.UserControl;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
+using System.Threading.Tasks;
using System.Windows.Forms;
namespace Gs.DevApp.DevFrm.QC
@@ -24,12 +26,15 @@
this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
-
toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
-
gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
- getPageList(1, UtilityHelper.GetPageSize());
+ gridView1.FocusedRowChanged += (s, e) =>
+ {
+ UtilityHelper.SetCheckIco(s, picCheckBox, this, "status", "");
+ };
+ getPageList(1);
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridSear(gridView1);
pageBar1.PagerEvent += PageBar1_PagerEvent;
gridView1.CustomDrawRowIndicator += (s, e) =>
{
@@ -47,44 +52,23 @@
};
_setIno();
}
+ private async void GridView1_ColumnFilterChanged(object sender, EventArgs e)
+ {
+ _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
+ await Task.Delay(100);
+ getPageList(1);
+ }
private void _setIno()
{
this.txt_itemId.KeyFile = "id";
- this.txt_suppNo.KeyFile = "suppNo";
+ this.txt_suppId.KeyFile = "id";
txt_itemId.EditChanged += (s, e) =>
{
txt_itemNo.Text = this.txt_itemId.GetCode();
- var ItemId = this.txt_itemId.GetId();
- var ItemName = this.txt_itemId.GetName();
- GetCount(ItemId, ItemName);
+ //var ItemId = this.txt_itemId.GetId();
+ //var ItemName = this.txt_itemId.GetName();
+ //GetCount(ItemId, ItemName);
};
- }
-
- private void GetCount(string ItemId,string ItemName)
- {
- //string rowGuid = "", rowName = "";
- //(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_itemNo, gridView1);
- //if (string.IsNullOrEmpty(rowGuid))
- //{
- // ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
- // return;
- //}
-
- try
- {
- string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetCount", JsonConvert.SerializeObject(ItemId));
- ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
- if (_rtn.rtnCode > 0)
- {
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- MsgHelper.Warning("鎻愮ず锛�"+ ItemName+"杩欎釜鐗╂枡宸茬粡缁存姢浜嗗厤妫�鏁版嵁");
- }
-
- }
- catch (Exception ex)
- {
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
- }
}
/// <summary>
/// 鍙屽嚮浜嬩欢
@@ -104,7 +88,7 @@
/// <param name="pageSize"></param>
private void PageBar1_PagerEvent(int curPage, int pageSize)
{
- getPageList(curPage, pageSize);
+ getPageList(curPage);
}
/// <summary>
/// 鏌ヨ浜嬩欢
@@ -113,7 +97,10 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e)
{
- Gs.DevApp.UserControl.ShowFilter frm = new Gs.DevApp.UserControl.ShowFilter(gridView1.Columns, _filterList);
+ gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
+ gridView1.ActiveFilter.Clear();
+ gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+ var frm = new ShowFilter(gridView1.Columns, _filterList);
frm.UpdateParent += Frm_UpdateParent;
frm.ShowDialog();
}
@@ -125,7 +112,7 @@
private void Frm_UpdateParent(object sender, UpdateParentEventArgs e)
{
_filterList = e.FilterList;
- getPageList(1, pageBar1.RowsCount);
+ getPageList(1);
}
/// <summary>
@@ -164,7 +151,7 @@
if (_rtn.rtnCode > 0)
{
UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(1, UtilityHelper.GetPageSize());
+ getPageList(1);
}
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
}
@@ -181,8 +168,20 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(1, UtilityHelper.GetPageSize());
+
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ getModel(lbGuid.Text.Trim(), false, 999);
+ else
+ {
+ _filterList.Clear();
+ if (gridView1.ActiveFilter.Count > 0)
+ {
+ gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
+ gridView1.ActiveFilter.Clear();
+ gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+ }
+ getPageList(1);
+ }
}
/// <summary>
/// 淇敼浜嬩欢
@@ -210,7 +209,6 @@
UtilityHelper.JumpToTab(xtraTabControl1, 1);
lbGuid.Text = "";
UtilityHelper.CleanValueByControl(this.panel1.Controls, true);
-
txt_createBy.Enabled = false;
txt_createDate.Enabled = false;
txt_lastupdateBy.Enabled = false;
@@ -218,7 +216,6 @@
txt_checkUser.Enabled = false;
txt_checkDate.Enabled = false;
txt_status.Enabled = false;
-
}
/// <summary>
/// 淇濆瓨浜嬩欢
@@ -229,7 +226,7 @@
{
toolBarMenu1.isSetBtn = false;
string _ItemId = txt_itemId.GetId();
- string _suppNo = txt_suppNo.GetCode();
+ string _suppNo = txt_suppId.GetId();
if (string.IsNullOrEmpty(_ItemId))
{
Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鐗╂枡锛�");
@@ -239,7 +236,7 @@
if (string.IsNullOrEmpty(_suppNo))
{
Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨渚涘簲鍟嗭紒");
- txt_suppNo.Focus();
+ txt_suppId.Focus();
return;
}
var _obj = new MesQaMj
@@ -247,7 +244,7 @@
Guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
ItemId = Convert.ToInt32(_ItemId),
ItemNo = txt_itemId.GetCode(),
- SuppNo= _suppNo,
+ SuppId = _suppNo,
};
try
{
@@ -272,31 +269,32 @@
/// </summary>
/// <param name="curPage">绗嚑椤�</param>
/// <param name="pageSize">姣忛〉鍑犳潯</param>
- private void getPageList(int curPage, int pageSize)
+ private async void getPageList(int curPage)
{
- System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
- foreach (FilterEntity itm in _filterList)
- {
- _sbSqlWhere.Append(" and " + itm.fileId + itm.fileOper + "'" + itm.fileValue + "'");
- }
- PageQueryModel pgq = new PageQueryModel(curPage, pageSize, "create_date", "asc", "", _sbSqlWhere.ToString());
+ UcLoading _loading = new UcLoading();
+ var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+ PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "a.create_date", "asc", "", _sbSqlWhere.ToString());
string json = JsonConvert.SerializeObject(pgq);
try
{
- string strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json);
+ var strReturn = await UtilityHelper.HttpPostAsync("", _webServiceName + "GetListPage", json);
ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn);
if (dd.rtnCode > 0)
{
DataTable dt = dd.rtnData.list;
gcMain.BindingContext = new BindingContext();
- gcMain.DataSource = dt;
- gcMain.ForceInitialize();
- int dddd = dd.rtnData.pages;//鎬婚〉
- pageBar1.TotalPages = dddd;
- pageBar1.RecordCount = dd.rtnData.total;//璁板綍鎬绘暟
+ gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
+ if (dt.Rows.Count > 0)
+ {
+ gcMain.DataSource = dt;
+ gcMain.ForceInitialize();
+ }
+ else
+ UtilityHelper.SetDefaultTable(gcMain, gridView1);
+ gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+ pageBar1.TotalPages = dd.rtnData.pages;//鎬婚〉
pageBar1.CurrentPage = curPage;//褰撳墠椤�
- pageBar1.RowsCount = pageSize;//姣忛〉鏄剧ず
- pageBar1.setTxt();
+ pageBar1.RecordCount = dd.rtnData.total;//鎬昏褰曟暟
}
else
{
@@ -307,6 +305,7 @@
{
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
+ _loading.Stop();
}
/// <summary>
///
--
Gitblit v1.9.3