From aef56e88ed1faeaa221f36b462a1120d7960e2fa Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 22 十二月 2020 15:09:01 +0800
Subject: [PATCH] 2020-12-22-4

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs |   29 ++++++++++++++++++++---------
 1 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs
index 62f95ea..268dd0f 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs
@@ -160,7 +160,7 @@
                 this.AddChidren(fLayout);
                 AndOrMethod(fLayout, titleCondition.btnText);
             };
-            ///鏉′欢鐐瑰嚮浜嬩欢
+            ///鏉′欢娣诲姞鐐瑰嚮浜嬩欢
             addInputIcon.btnClick.MouseUpEventHandler += (sen, e) =>
             {
                 var addInputType = new AddInputType();
@@ -168,7 +168,7 @@
                 addInputType.Show();
                 MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
             };
-            ///鐩爣鐐瑰嚮浜嬩欢
+            ///鐩爣娣诲姞鐐瑰嚮浜嬩欢
             addOutputIcon.btnClick.MouseUpEventHandler += (sen, e) =>
             {
                 var addTarget = new AddTarget();
@@ -184,19 +184,21 @@
             ///淇濆瓨鐐瑰嚮浜嬩欢
             saveView.btnClick.MouseUpEventHandler += (sender, e) =>
             {
-
+                if (Logic.currlogic.input.Count == 0&& Logic.currlogic.output.Count == 0)
+                {
+                    new LogicView.TipPopView().TipBox(StringId.tip, StringId.conditioncNullOrtargetNull);
+                    return;
+                }
                 if (Logic.currlogic.input.Count == 0)
                 {
-                    new LogicView.TipPopView().FlashingBox("鏉′欢涓嶈兘涓虹┖");
+                    new LogicView.TipPopView().TipBox(StringId.tip, StringId.conditioncNull);
                     return;
                 }
                 if (Logic.currlogic.output.Count == 0)
                 {
-                    new LogicView.TipPopView().FlashingBox("鐩爣涓嶈兘涓虹┖");
+                    new LogicView.TipPopView().TipBox(StringId.tip, StringId.targetNull);
                     return;
                 }
-
-
                 Loading loading = new Loading();
                 this.AddChidren(loading);
                 HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null;
@@ -207,7 +209,7 @@
                     {
                         list.Add(logic.name);
                     }
-                    new LogicView.TipPopView().InputBox(StringId.editName, Logic.currlogic.name, StringId.nameNull, StringId.NameAlreadyExists, list, (logicName) =>
+                    new LogicView.TipPopView().InputBox(StringId.editName, InterfaceDsplaysLogic.GetLogicName(Logic.currlogic), StringId.nameNull, StringId.NameAlreadyExists, list, (logicName) =>
                     {
                         Logic.currlogic.name = logicName;
                         Logic.currlogic.sid = LogicMethod.NewSid();
@@ -256,6 +258,10 @@
                                         LogicMethod.RemoveAllView();
                                         MainView.MainShow();
                                     }
+                                    else if (responsePackNew != null && responsePackNew.Code == "14005")
+                                    {
+                                        new LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.gatewayNotOnline));
+                                    }
                                     else
                                     {
                                         new LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.saveFail));
@@ -292,7 +298,11 @@
                                     LogicMethod.RemoveAllView();
                                     MainView.MainShow();
                                 }
-                                else
+                                else if (responsePackNew != null && responsePackNew.Code == "14005")
+                                {
+                                    new LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.gatewayNotOnline));
+                                }
+                                else 
                                 {
                                     new LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.saveFail));
                                 }
@@ -623,6 +633,7 @@
 
             return stateList;
         }
+       
 
     }
 }

--
Gitblit v1.8.0