From 2584f0a0e06963dad1a0a296ec1d81db40a52192 Mon Sep 17 00:00:00 2001 From: hanqiangqiang <1364346467@qq.com> Date: Thu, 29 Jun 2023 08:43:14 +0800 Subject: [PATCH] =?UTF-8?q?[UI.Client]=20=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2Coating=E6=97=A0=E8=AE=B0=E5=BD=95=EF=BC=8C?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HistoryData/HistoryCoatingSqlHelp.cs | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/MECF.Framework.UI.Client/TrayThickness/HistoryData/HistoryCoatingSqlHelp.cs b/MECF.Framework.UI.Client/TrayThickness/HistoryData/HistoryCoatingSqlHelp.cs index 7de4375..c4c5cd5 100644 --- a/MECF.Framework.UI.Client/TrayThickness/HistoryData/HistoryCoatingSqlHelp.cs +++ b/MECF.Framework.UI.Client/TrayThickness/HistoryData/HistoryCoatingSqlHelp.cs @@ -52,7 +52,7 @@ namespace MECF.Framework.UI.Client.TrayThickness.HistoryData $"or ring_outer_number = '{name}'"; var dtAll = QueryDataClient.Instance.Service.QueryData(cmdAllName); - if (dtAll.Rows.Count != 0) + if (dtAll !=null && dtAll.Rows.Count != 0) { for (int i = 0; i < dtAll.Rows.Count; i++) { @@ -104,6 +104,9 @@ namespace MECF.Framework.UI.Client.TrayThickness.HistoryData try { var dt = QueryDataClient.Instance.Service.QueryData(cmd);//只能界面用 + if (dt == null || dt.Rows.Count == 0) + return null; + for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i].ItemArray.Length != 0) @@ -140,6 +143,10 @@ namespace MECF.Framework.UI.Client.TrayThickness.HistoryData try { var dt = QueryDataClient.Instance.Service.QueryData(cmd);//只能界面用 + + if (dt == null || dt.Rows.Count == 0) + return null; + for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i].ItemArray.Length != 0) @@ -174,14 +181,10 @@ namespace MECF.Framework.UI.Client.TrayThickness.HistoryData string tray_numbers = ""; string sSql = $"select * from tray_thickness_data where tray_guid like '{tray_guid}'"; DataSet ds = DB.ExecuteDataset(sSql); - if (ds == null) - { + if (ds == null || ds.Tables[0].Rows.Count == 0) return false; - } - if (ds.Tables[0].Rows.Count == 0) - { - return false; - } + + tray_numbers = "'" + ds.Tables[0].Rows[0]["tray_number"].ToString() + "','" + ds.Tables[0].Rows[0]["tray_inner_number"].ToString() + "','" + ds.Tables[0].Rows[0]["ring_inner_number"].ToString() + "','" + ds.Tables[0].Rows[0]["ring_outer_number"].ToString() + "'"; @@ -208,9 +211,8 @@ namespace MECF.Framework.UI.Client.TrayThickness.HistoryData string sSql = $"select * from pm_thickness_data where pm_guid like '{pmName}' "; DataSet ds = DB.ExecuteDataset(sSql); if (ds == null || ds.Tables[0].Rows.Count==0) - { return false; - } + pm_Cmd = $"'{ds.Tables[0].Rows[0]["pm_minor_cycle"].ToString()}','{ds.Tables[0].Rows[0]["pm_major_cycle"].ToString()}'"; @@ -237,6 +239,9 @@ namespace MECF.Framework.UI.Client.TrayThickness.HistoryData { string sSql = $"select * from tray_thickness_data where tray_guid like '{tray_guid}'"; DataSet ds = DB.ExecuteDataset(sSql); + if (ds == null || ds.Tables[0].Rows.Count == 0) + return false; + string cmd = "select tray_coating_thickness , tray_max_thickness,tray_label from tray_thickness_main where "; cmd += $"tray_number='{ds.Tables[0].Rows[0]["tray_number"].ToString()}' " + $"or tray_number = '{ds.Tables[0].Rows[0]["tray_inner_number"].ToString()}' " + @@ -248,9 +253,8 @@ namespace MECF.Framework.UI.Client.TrayThickness.HistoryData ds = DB.ExecuteDataset(cmd+ timeCmd); if (ds == null || ds.Tables[0].Rows.Count == 0) - { return false; - } + for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { double coating = double.Parse( ds.Tables[0].Rows[i]["tray_coating_thickness"].ToString()); @@ -280,6 +284,10 @@ namespace MECF.Framework.UI.Client.TrayThickness.HistoryData { string sSql = $"select * from pm_thickness_data where pm_guid like '{pmId}'"; DataSet ds = DB.ExecuteDataset(sSql); + if (ds == null || ds.Tables[0].Rows.Count == 0) + return false; + + string cmd = "select pm_coating_thickness , pm_max_thickness,pm_label from pm_thickness_main where "; cmd += $"pm_cycle='{ds.Tables[0].Rows[0]["pm_minor_cycle"].ToString()}' " + $"or pm_cycle = '{ds.Tables[0].Rows[0]["pm_major_cycle"].ToString()}'"; @@ -289,9 +297,8 @@ namespace MECF.Framework.UI.Client.TrayThickness.HistoryData ds = DB.ExecuteDataset(cmd + timeCmd); if (ds == null || ds.Tables[0].Rows.Count == 0) - { return false; - } + for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { double coating = double.Parse(ds.Tables[0].Rows[i]["pm_coating_thickness"].ToString());