From 387e438278a3815e76e0f4e3e029d47717f00723 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期五, 14 二月 2025 12:58:27 +0800
Subject: [PATCH] 报工
---
DevApp/Gs.DevApp/DevFrm/Sys/Frm_PrintInfo.cs | 90 +++++++++++++++++++++++++-------------------
1 files changed, 51 insertions(+), 39 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Sys/Frm_PrintInfo.cs b/DevApp/Gs.DevApp/DevFrm/Sys/Frm_PrintInfo.cs
index 56f3a00..b803afd 100644
--- a/DevApp/Gs.DevApp/DevFrm/Sys/Frm_PrintInfo.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Sys/Frm_PrintInfo.cs
@@ -7,6 +7,7 @@
using System.Collections.Generic;
using System.Data;
using System.Net;
+using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -27,28 +28,27 @@
this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
- gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (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);
}
private async void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
- _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
+ Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
await 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>
@@ -90,8 +90,7 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnEscClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(pageBar1.CurrentPage);
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
}
/// <summary>
@@ -119,8 +118,11 @@
ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(1);
+ if (xtraTabControl1.SelectedTabPageIndex == 0)
+ { }
+ else
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
+ getPageList(this.pageBar1.CurrentPage);
}
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
}
@@ -138,17 +140,18 @@
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>
@@ -165,7 +168,15 @@
ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
- getModel(rowGuid, true, 1);
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ {
+ getModel(lbGuid.Text.Trim());
+ }
+ else
+ {
+ UtilityHelper.ChangeEnableByControl(panel1.Controls, true);
+ }
}
/// <summary>
/// 鏂板浜嬩欢
@@ -174,9 +185,9 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnAddClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 1);
lbGuid.Text = "";
- UtilityHelper.CleanValueByControl(this.panel1.Controls, true);
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
+ UtilityHelper.CleanValueByControl(panel1.Controls, true);
}
/// <summary>
@@ -205,13 +216,7 @@
txt_port.Focus();
return;
}
- try
- {
- IPAddress.Parse(txt_ip.Text);
- }
- catch
- {
- txt_ip.Text = "";
+ if (!validateIpAddress(txt_ip.Text.Trim())) {
MessageBox.Show("璇疯緭鍏ユ纭殑IP鍦板潃");
txt_ip.Focus();
return;
@@ -291,14 +296,16 @@
/// <param name="strGuid">涓婚敭</param>
/// <param name="isEdit">鏄惁鍙紪杈�</param>
/// <param name="tabIdx">閫夐」鍗″簭鍙�</param>
- 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,//涓诲缓
@@ -321,5 +328,10 @@
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
+ private bool validateIpAddress(string ip)
+ {
+ string pattern = @"^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$";
+ return Regex.IsMatch(ip, pattern);
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.3