| | |
| | | } |
| | | |
| | | Common.Logic.CurrentLogic.LogicName = name; |
| | | |
| | | bool succeed = false; |
| | | //判断是新添加逻辑(默认0)还是修改逻辑 |
| | | CommonPage.Loading.Start(); |
| | | if (Common.Logic.CurrentLogic.LogicId == 0) |
| | |
| | | var logicifon = await Send.AddModifyLogic(Common.Logic.CurrentLogic); |
| | | if (logicifon != null && logicifon.LogicId != 0) |
| | | { |
| | | succeed = true; |
| | | Common.Logic.CurrentLogic.LogicId = logicifon.LogicId; |
| | | Common.Logic.LogicList.Add(Common.Logic.CurrentLogic); |
| | | } |
| | |
| | | else |
| | | { |
| | | //发送修改逻辑命令 |
| | | Send.AddModifyLogic(Common.Logic.CurrentLogic); |
| | | var modlogic=Send.AddModifyLogic(Common.Logic.CurrentLogic); |
| | | //编辑默认成功(不考虑网络情况); |
| | | succeed = true; |
| | | } |
| | | |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | if (!succeed) { |
| | | //网关回复失败,不关闭界面,让它停留当前界面; |
| | | //(原因:考虑到失败重新编辑原来数据给用户带来了麻烦) |
| | | ///提示:添加自动化失败; |
| | | return; |
| | | } |
| | | UserView.HomePage.Instance.RemoveViewByTag("Logic"); |
| | | Category.Category.instance?.RefreshBodyView(); |
| | | |