From 650fe9e42e3de66be29769da72cc755273246dd9 Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期五, 12 九月 2025 16:23:04 +0800 Subject: [PATCH] 更新优化代码 --- DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectCodeShow.cs | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectCodeShow.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectCodeShow.cs index f2a9ec3..0687463 100644 --- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectCodeShow.cs +++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesDefectCodeShow.cs @@ -1,10 +1,10 @@ 锘縰sing Gs.DevApp.Entity; using Gs.DevApp.ToolBox; -using MES.Service.Modes; using Newtonsoft.Json; using System; using System.Data; using System.Text; +using Gs.DevApp.DevFrm.QC.Models; namespace Gs.DevApp.DevFrm.QC @@ -59,19 +59,19 @@ { if (string.IsNullOrEmpty(txt_defectCode.Text)) { - Gs.DevApp.ToolBox.MsgHelper.ShowInformation("缂栧彿涓嶈兘涓虹┖锛�"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("缂栧彿涓嶈兘涓虹┖锛�"); txt_defectCode.Focus(); return; } if (txt_sType.SelectedIndex <= 0) { - Gs.DevApp.ToolBox.MsgHelper.ShowInformation("绫诲瀷涓嶈兘涓虹┖锛�"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("绫诲瀷涓嶈兘涓虹┖锛�"); txt_sType.Focus(); return; } if (string.IsNullOrEmpty(txt_defectName.Text)) { - Gs.DevApp.ToolBox.MsgHelper.ShowInformation("鍚嶇О涓嶈兘涓虹┖锛�"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("鍚嶇О涓嶈兘涓虹┖锛�"); txt_defectName.Focus(); return; } @@ -89,16 +89,19 @@ { string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj)); ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); - ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); + if (_rtn.rtnCode > 0) { + ToolBox.MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg); UpdateParent?.Invoke(this, new UpdateParentEventArgs { StringSingle = "" }); Close(); } + else + ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg); } catch (Exception ex) { - ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message); } } @@ -155,11 +158,11 @@ txt_defectCode.Text = dy.maxNo; } else - ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); + ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg); } catch (Exception ex) { - ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message); } } } -- Gitblit v1.9.3