From 97903580743bf5bce52a99e0f1c031be5f8fb1e5 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 16 一月 2025 10:30:18 +0800
Subject: [PATCH] 工具条的审核和反审核状态控制
---
DevApp/Gs.DevApp/DevFrm/WOM/Frm_Womcaa.cs | 160 +++++++++++-----------------------------------------
1 files changed, 35 insertions(+), 125 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Womcaa.cs b/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Womcaa.cs
index 853b6ab..8f5bb0b 100644
--- a/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Womcaa.cs
+++ b/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Womcaa.cs
@@ -6,7 +6,6 @@
using System;
using System.Collections.Generic;
using System.Data;
-using System.Drawing;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -19,48 +18,30 @@
public Frm_Womcaa()
{
InitializeComponent();
- toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
- this.toolBarMenu1.btnJieAnClick += ToolBarMenu1_btnJieAnClick;
- this.toolBarMenu1.btnFjieAnClick += ToolBarMenu1_btnFjieAnClick;
- gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "fstatus", "", (value) =>
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
+ });
+ Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
+ {
+ getModel(value);
+ }, (value) =>
+ {
+ getPageList(this.pageBar1.CurrentPage);
+ });
getPageList(1);
pageBar1.PagerEvent += PageBar1_PagerEvent;
- Gs.DevApp.ToolBox.UtilityHelper.SetGridSear(gridView1);
- gridView1.CustomDrawRowIndicator += (s, e) =>
- {
- if (e.Info.IsRowIndicator && e.RowHandle >= 0)
- {
- e.Info.DisplayText = (e.RowHandle + 1).ToString();
- }
- };
- gridView1.CustomDrawEmptyForeground += (s, e) =>
- {
- string str = "鏆傛湭鏌ユ壘鍒板尮閰嶇殑鏁版嵁!";
- Font f = new Font("寰蒋闆呴粦", 16);
- Rectangle r = new Rectangle(gridView1.GridControl.Width / 2 - 100, e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5);
- e.Graphics.DrawString(str, f, Brushes.Gray, r);
- };
}
- private async void GridView1_ColumnFilterChanged(object sender, EventArgs e)
+ private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
- _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
- await Task.Delay(100);
+ Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
+ Task.Delay(100);
getPageList(1);
}
- /// <summary>
- /// 鍙屽嚮浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid");
- if (!string.IsNullOrEmpty(rowGuid))
- getModel(rowGuid, false, 999);
- }
/// <summary>
/// 鍒嗛〉浜嬩欢
/// </summary>
@@ -91,7 +72,6 @@
/// <param name="e"></param>
private void Frm_UpdateParent(object sender, UpdateParentEventArgs e)
{
-
_filterList = e.FilterList;
getPageList(1);
}
@@ -105,107 +85,34 @@
private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
{
if (xtraTabControl1.SelectedTabPageIndex == 1)
- getModel(lbGuid.Text.Trim(), false, 999);
+ getModel(lbGuid.Text.Trim());
else
{
- _filterList.Clear();
- if (gridView1.ActiveFilter.Count > 0)
- {
- gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
- gridView1.ActiveFilter.Clear();
- gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
- }
- getPageList(1);
+ //_filterList.Clear();
+ //if (gridView1.ActiveFilter.Count > 0)
+ //{
+ // gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
+ // gridView1.ActiveFilter.Clear();
+ // gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+ //}
+ //getPageList(1);
+ getPageList(this.pageBar1.CurrentPage);
}
}
- /// <summary>
- /// 淇敼浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
- {
- string rowGuid = "", rowName = "";
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_caa001, gridView1);
- if (string.IsNullOrEmpty(rowGuid))
- {
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
- return;
- }
- getModel(rowGuid, true, 1);
- }
- /// <summary>
- /// 鍙嶇粨妗�
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- /// <exception cref="NotImplementedException"></exception>
- private async void ToolBarMenu1_btnFjieAnClick(object sender, EventArgs e)
- {
-
- }
- /// <summary>
- /// 缁撴
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- /// <exception cref="NotImplementedException"></exception>
- private async void ToolBarMenu1_btnJieAnClick(object sender, EventArgs e)
- {
- toolBarMenu1.guidKey = "";
- string rowGuid, rowName;
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_caa001, gridView1);
- toolBarMenu1.guidKey = rowGuid;
- if (string.IsNullOrEmpty(rowGuid))
- {
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
- return;
- }
- if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎻愪氦妫�楠屽悧锛�"))
- return;
- UcLoading _loading = new UcLoading();
- var _obj = new
- {
- guid = rowGuid,
- };
- try
- {
- var strJson = await UtilityHelper.HttpPostAsync("",
- _webServiceName + "EditModelSubmit",
- JsonConvert.SerializeObject(_obj));
- var _rtn = UtilityHelper.ReturnToDynamic(strJson);
- MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnData.outMsg);
- if (_rtn.rtnCode > 0)
- {
- if (xtraTabControl1.SelectedTabPageIndex == 1)
- getModel(lbGuid.Text.Trim(), false, 999);
- else
- getPageList(1);
- }
- }
- catch (Exception ex)
- {
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
- }
- _loading.Stop();
-
- }
+
/// <summary>
///
/// </summary>
/// <param name="curPage">绗嚑椤�</param>
/// <param name="pageSize">姣忛〉鍑犳潯</param>
- private async void getPageList(int curPage)
+ private void getPageList(int curPage)
{
- UcLoading _loading = new UcLoading();
var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString());
string json = JsonConvert.SerializeObject(pgq);
try
{
- var strReturn = await UtilityHelper.HttpPostAsync("",
+ var strReturn = UtilityHelper.HttpPost("",
_webServiceName + "GetListPage", json);
ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn);
if (dd.rtnCode > 0)
@@ -217,6 +124,7 @@
{
gcMain.DataSource = dt;
gcMain.ForceInitialize();
+ gridView1.BestFitColumns();
}
else
UtilityHelper.SetDefaultTable(gcMain, gridView1);
@@ -234,16 +142,18 @@
{
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
- _loading.Stop();
+
}
- private void getModel(string strGuid, bool isEdit, int tabIdx)
+ private void getModel(string strGuid)
{
+ bool isEdit = false;
+ if (toolBarMenu1.currentAction == "add") return;
+ if (toolBarMenu1.currentAction == "edit") isEdit = true;
if (string.IsNullOrEmpty(strGuid))
{
ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
- UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
var _obj = new
{
guid = strGuid,//涓诲缓
@@ -271,6 +181,7 @@
gcMx1.BindingContext = new BindingContext();
gcMx1.DataSource = dt;
gcMx1.ForceInitialize();
+ gvMx1.BestFitColumns();
}
else
{
@@ -285,6 +196,5 @@
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
-
}
}
\ No newline at end of file
--
Gitblit v1.9.3