From 6eb21769c74cfcd10084f73ff3f212355849a3c7 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期一, 17 五月 2021 15:00:13 +0800
Subject: [PATCH] 2021-5-17-2
---
HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs | 55 +++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 41 insertions(+), 14 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs
index 24724ca..442dae4 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs
@@ -61,12 +61,13 @@
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, Logic.currlogic.name, StringId.nameNull, StringId.NameAlreadyExists, list, (logicName,view
+ ) =>
{
btnAutomationName.Text = logicName;
Logic.currlogic.name = logicName;
- });
+ },()=> { });
};
nameView.btnClick.MouseUpEventHandler += editClick;
btnAutomationName.MouseUpEventHandler += editClick;
@@ -95,21 +96,47 @@
EventHandler<MouseEventArgs> delClick = (sender, e) =>
{
-
+ Loading loading = new Loading();
+ this.AddChidren(loading);
+ HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null;
new LogicView.TipPopView().TipBox(StringId.tip, StringId.delAutomation, () =>
{
- var responsePackNew= Send.delLogic(Logic.currlogic);
- if (responsePackNew.Code == "0")
+ loading.Start();
+ new System.Threading.Thread(() =>
{
- LogicMethod.RemoveAllView();
- Logic.LogicList.Remove(Logic.currlogic);
- MainView.MainShow();
- //鍙戦�佸垹闄ら�昏緫鍛戒护锛�
- }
- else
- {
- new LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.delFail));
- }
+ try
+ {
+ //鍙戦�佸垹闄ら�昏緫鍛戒护锛�
+ responsePackNew = Send.DelLogic(Logic.currlogic);
+
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ loading.Hide();
+ if (responsePackNew != null && responsePackNew.Code == "0")
+ {
+ LogicMethod.RemoveAllView();
+ Logic.LogicList.Remove(Logic.currlogic);
+ 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.delFail));
+ }
+ });
+ }
+
+ })
+ { IsBackground = true }.Start();
+
});
};
--
Gitblit v1.8.0