From 566686416af3fb9cc8bf25a547dae45721c43c3d Mon Sep 17 00:00:00 2001 From: cdk <2441919651@qq.com> Date: 星期四, 07 八月 2025 16:17:44 +0800 Subject: [PATCH] 调整查询功能 --- DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesItemsShow.cs | 50 ++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 42 insertions(+), 8 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesItemsShow.cs b/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesItemsShow.cs index 8bab744..5c8091b 100644 --- a/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesItemsShow.cs +++ b/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesItemsShow.cs @@ -1,15 +1,9 @@ -锘縰sing DevExpress.XtraEditors; +锘縰sing DevExpress.XtraRichEdit.Fields; 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; +using System.Text.RegularExpressions; namespace Gs.DevApp.DevFrm.BasicData { @@ -25,12 +19,52 @@ this.btnSave.Click += BtnSave_Click; } + /// <summary> + /// 楠岃瘉瓒呴噰鐜囪緭鍏ュ�� + /// </summary> + private bool ValidateLossPercent() + { + if (txt_lossPercent.EditValue == null || string.IsNullOrWhiteSpace(txt_lossPercent.Text)) + { + txt_lossPercent.EditValue = 0.0; + return true; + } + + if (double.TryParse(txt_lossPercent.EditValue.ToString(), out double value)) + { + if (value < 0.0 || value > 1.0) + { + MsgHelper.Warning("瓒呴噰鐜囧繀椤诲湪0鍒�1涔嬮棿锛�"); + txt_lossPercent.Focus(); + return false; + } + + // 鏍煎紡鍖栨樉绀猴紝淇濈暀閫傚綋鐨勫皬鏁颁綅鏁� + txt_lossPercent.EditValue = Math.Round(value, 4); + return true; + } + else + { + MsgHelper.Warning("璇疯緭鍏ユ湁鏁堢殑鏁板瓧锛�"); + txt_lossPercent.EditValue = 0.0; + txt_lossPercent.Focus(); + return false; + } + } + private void BtnSave_Click(object sender, EventArgs e) { + // 淇濆瓨鍓嶉獙璇佽秴閲囩巼 + if (!ValidateLossPercent()) + { + return; + } + var _obj = new { guidList = this.guidList, bz10 = txt_day.Value, + percent = txt_lossPercent.EditValue }; try { -- Gitblit v1.9.3