From 4653dfad25810d9365e1be43df791df12de0a872 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期五, 27 十一月 2020 17:51:57 +0800 Subject: [PATCH] 2020-11-27-4 --- HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs | 94 ++++++++++++---------------------------------- 1 files changed, 25 insertions(+), 69 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs index 0526ac0..17a2403 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs @@ -17,14 +17,23 @@ this.BackgroundColor = CSS.CSS_Color.viewMiddle; LogicView.TopView topView = new LogicView.TopView(); + topView.setBtn.Visible = true; this.AddChidren(topView.FLayoutView()); topView.clickBackBtn.MouseUpEventHandler += (e, sen) => { RemoveFromParent(); }; - topView.topNameBtn.TextID = StringId.newAutomation; + if (string.IsNullOrEmpty(Logic.currlogic.sid)) + { + topView.topNameBtn.TextID = StringId.newAutomation; + } + else + { + topView.topNameBtn.TextID = StringId.editAutomation; + } + topView.setBtn.MouseUpEventHandler += (sender,e) => { }; - VerticalScrolViewLayout viewLayout = new VerticalScrolViewLayout + VerticalScrolViewLayout viewLayout = new VerticalScrolViewLayout { Y = Application.GetRealHeight(64), Width = Application.GetRealWidth(LogicView.TextSize.view375), @@ -132,15 +141,21 @@ this.AddChidren(saveView.FLayoutView()); saveView.btnClick.MouseUpEventHandler += (sender, e) => { - Logic.LogicList.Add(Logic.currlogic); + if (string.IsNullOrEmpty(Logic.currlogic.sid)) + { + Logic.currlogic.sid = LogicMethod.NewSid(); + Logic.LogicList.Add(Logic.currlogic); + } + else + { + + } LogicMethod.RemoveAllView(); MainView.MainShow(); - + //鍙戦�佹柊鍔犱慨鏀归�昏緫鍛戒护锛� }; //saveView.frameLayout.Y = this.Height - saveView.frameLayout.Height; #endregion - - } /// <summary> @@ -259,7 +274,7 @@ //纭畾淇濆瓨 dateView.btnConfirm.MouseUpEventHandler += (sender3, e3) => { - if (weekName == Language.StringByID(StringId.monthly)|| weekName!= Language.StringByID(StringId.weekly)) { + if (weekName == Language.StringByID(StringId.monthly)|| weekName== Language.StringByID(StringId.weekly)) { //鎻愮ず锛氳繕鏈�� return; @@ -404,7 +419,7 @@ } Logic.currlogic.cycle.type = "week"; Logic.currlogic.cycle.value = weekList; - button.Text = GetWeekString(weekList); + button.Text = MainView.GetWeekString(weekList); fLayout.RemoveFromParent(); }; @@ -503,70 +518,11 @@ } Logic.currlogic.cycle.type = "mon"; Logic.currlogic.cycle.value = monList; - button.Text = GetMonString(monList); + button.Text = MainView.GetMonString(monList); fLayout.RemoveFromParent(); }; } - /// <summary> - /// 鑾峰彇鏄熸湡鐨勫瓧绗︿覆 - /// </summary> - /// <param name="weekList"></param> - /// <returns></returns> - public string GetWeekString(List<string> weekList) - { - string weekTextName = ""; - if (weekList.Contains("0")) - { - weekTextName += Language.StringByID(StringId.monday) + ","; - } - if (weekList.Contains("1")) - { - weekTextName += Language.StringByID(StringId.tuesday) + ","; - } - if (weekList.Contains("2")) - { - weekTextName += Language.StringByID(StringId.wednesday) + ","; - } - if (weekList.Contains("3")) - { - weekTextName += Language.StringByID(StringId.thursday) + ","; - } - if (weekList.Contains("4")) - { - weekTextName += Language.StringByID(StringId.friday) + ","; - } - if (weekList.Contains("5")) - { - weekTextName += Language.StringByID(StringId.saturday) + ","; - } - if (weekList.Contains("6")) - { - weekTextName += Language.StringByID(StringId.sunday) + ","; - } - if (weekTextName == "") - { - return ""; - } - return weekTextName.TrimEnd(','); - } - /// <summary> - /// 鑾峰彇姣忔湀鐨勫瓧绗︿覆 - /// </summary> - /// <param name="monList"></param> - /// <returns></returns> - public string GetMonString(List<string> monList) - { - string monTextName = Language.StringByID(StringId.monthly); - - for (int i = 1; i < 32; i++) - { - if (monList.Contains(i.ToString())) - { - monTextName += i.ToString() + ","; - } - } - return monTextName.TrimEnd(','); - } + } } -- Gitblit v1.8.0