| | |
| | | //new Alert ("", "请填写定时器名称!", "Close").Show (); |
| | | new Alert ("", "Please set name for the timer!", "Close").Show (); |
| | | return; |
| | | } else if (listTimer.Find ((obj) => obj.TimerName == timerTemp.TimerName) != null && !isEdit) {//2020-01-09 编辑的时候也提示重复名字 |
| | | //if (isEdit) { |
| | | |
| | | //} |
| | | new Alert ("", "The timer name already exists. Please change it before saving it.", "Close").Show (); |
| | | return; |
| | | } |
| | | //else if (listTimer.Find ((obj) => obj.TimerName == timerTemp.TimerName) != null && !isEdit) {//2020-01-09 编辑的时候也提示重复名字 |
| | | // //if (isEdit) { |
| | | |
| | | // //} |
| | | // new Alert ("", "The timer name already exists. Please change it before saving it.", "Close").Show (); |
| | | // return; |
| | | //} |
| | | |
| | | if (timerControlDeviceList.Count == 0) { |
| | | new Alert ("", "Please choose at least one device!", "Close").Show (); |
| | | return; |
| | | } |
| | | |
| | | var mTimer = listTimer.Find ((obj) => obj.TimerName == timerTemp.TimerName); |
| | | if (isEdit) { |
| | | if (mTimer != null && mTimer.Id != timerTemp.Id) { |
| | | new Alert ("", "The timer name already exists. Please change it before saving it.", "Close").Show (); |
| | | return; |
| | | } |
| | | } else { |
| | | if (mTimer != null) { |
| | | new Alert ("", "The timer name already exists. Please change it before saving it.", "Close").Show (); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | timerTemp.Periodicity = ""; |
| | | if (btnMonday.IsSelected == true && btnFriday.IsSelected == true && btnThursday.IsSelected == true && btnSunday.IsSelected == true && btnTuesday.IsSelected == true && btnSaturday.IsSelected == true && btnWednesday.IsSelected == true) { |
| | | timerTemp.TimerType = TimerType.EveryDay; |