old mode 100644
new mode 100755
| | |
| | | var systeMinute = DateTime.Now.Minute;//获取分钟 |
| | | int systemHourIndex = 0; |
| | | int systeMinuteIndex = 0; |
| | | for (int i = 0; i < timePointView.GethIntList0().Count; i++) |
| | | for (int i = 0; i < timePointView.GethIntList().Count; i++) |
| | | { |
| | | var currhour = timePointView.GethIntList0()[i]; |
| | | var currhour = timePointView.GethIntList()[i]; |
| | | if (systemHour == currhour) |
| | | { |
| | | systemHourIndex = i; |
| | |
| | | int hIndex = timePointView.GetValueIndex(timeValue, 0, 1, timePointView.GethIntList()); |
| | | int mIndex = timePointView.GetValueIndex(timeValue, 1, 0, timePointView.GetmIntList()); |
| | | //更新初始状态 |
| | | timePointView.mUIPickerView.setCurrentItems(hIndex - 1, mIndex, 0); |
| | | timePointView.mUIPickerView.setCurrentItems(hIndex, mIndex, 0); |
| | | timepoint = timeValue; |
| | | } |
| | | } |
| | |
| | | Button btnStartTimeText = new Button |
| | | { |
| | | TextSize = LogicView.TextSize.text12, |
| | | Width = Application.GetRealWidth(32 + 3), |
| | | Width = Application.GetRealWidth(32 + 3+20), |
| | | Height = Application.GetRealHeight(17), |
| | | TextColor = CSS.CSS_Color.textCancelColor, |
| | | Y = Application.GetRealHeight(17), |
| | | X = Application.GetRealWidth(260), |
| | | X = Application.GetRealWidth(260-20), |
| | | Tag = "0", |
| | | }; |
| | | startTimeView.frameLayout.AddChidren(btnStartTimeText); |
| | |
| | | Button btnEndTimeText = new Button |
| | | { |
| | | TextSize = LogicView.TextSize.text12, |
| | | Width = Application.GetRealWidth(32 + 3), |
| | | Width = Application.GetRealWidth(32 + 3+20), |
| | | Height = Application.GetRealHeight(17), |
| | | TextColor = CSS.CSS_Color.textCancelColor, |
| | | Y = Application.GetRealHeight(17), |
| | | X = Application.GetRealWidth(260), |
| | | X = Application.GetRealWidth(260-20), |
| | | Tag = "0", |
| | | }; |
| | | endTimeView.frameLayout.AddChidren(btnEndTimeText); |
| | |
| | | //确定点击事件 |
| | | timeHorizonView.btnConfirm.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | if (btnStartTimeText.Tag.ToString() == "0"&& btnEndTimeText.Tag.ToString() == "0") |
| | | { |
| | | //提示:时间未设置,请设置时间。 |
| | | new LogicView.TipPopView().TipBox(StringId.tip, StringId.timeNoSet); |
| | | return; |
| | | } |
| | | |
| | | if (btnStartTimeText.Tag.ToString() == "0") |
| | | { |
| | | //提示:请选中开始时间 |
| | | //提示:开始时间未设置,请设置开始时间。 |
| | | new LogicView.TipPopView().TipBox(StringId.tip,StringId.setStartTime); |
| | | return; |
| | | } |
| | | if (btnEndTimeText.Tag.ToString() == "0") |
| | | { |
| | | //提示:请选中结束时间 |
| | | //提示:结束时间未设置,请设置结束时间。 |
| | | new LogicView.TipPopView().TipBox(StringId.tip, StringId.setEndTime); |
| | | return; |
| | | } |
| | | if (btnStartTimeText.Tag.ToString() == btnEndTimeText.Tag.ToString()) |
| | | { |
| | | //提示:时间一样的 |
| | | //提示:开始时间和结束时间不能一样。 |
| | | new LogicView.TipPopView().TipBox(StringId.tip, StringId.unlikeTime); |
| | | return; |
| | | } |
| | | if (int.Parse(btnStartTimeText.Tag.ToString()) > int.Parse(btnEndTimeText.Tag.ToString())) |
| | | { |
| | | //提示:开始时间不能大于结束时间 |
| | | //提示:开始时间不能大于结束时间。 |
| | | new LogicView.TipPopView().TipBox(StringId.tip, StringId.startTimeLessThanEndTime); |
| | | return; |
| | | } |
| | | |
| | |
| | | LogicMethod.dictionary(dic, "key", "timesection"); |
| | | LogicMethod.dictionary(dic, "comparator", "="); |
| | | LogicMethod.dictionary(dic, "data_type", "string"); |
| | | LogicMethod.dictionary(dic, "value", btnStartTimeText.Text + "~" + btnEndTimeText.Text); |
| | | LogicMethod.dictionary(dic, "value", btnStartTimeText.Text + "-" + btnEndTimeText.Text); |
| | | inputTime.condition.Add(dic); |
| | | if (edit) |
| | | { |
| | |
| | | foreach (var dic in dicList) |
| | | { |
| | | string value = dic["value"]; |
| | | string startTime = value.Split('~')[0]; |
| | | string endtTime = value.Split('~')[1]; |
| | | string startTime = value.Split('-')[0]; |
| | | string endtTime = value.Split('-')[1]; |
| | | btnStartTimeText.Text = startTime; |
| | | btnStartTimeText.Tag = int.Parse(startTime.Split(':')[0]) * 60 + int.Parse(startTime.Split(':')[1]); |
| | | btnEndTimeText.Text = endtTime; |
| | |
| | | var systeMinute = DateTime.Now.Minute;//获取分钟 |
| | | int systemHourIndex = 0; |
| | | int systeMinuteIndex = 0; |
| | | for (int i = 0; i < timePointView.GethIntList0().Count; i++) |
| | | for (int i = 0; i < timePointView.GethIntList().Count; i++) |
| | | { |
| | | var currhour = timePointView.GethIntList0()[i]; |
| | | var currhour = timePointView.GethIntList()[i]; |
| | | if (systemHour == currhour) |
| | | { |
| | | systemHourIndex = i; |
| | |
| | | int hourIndex = timePointView.GetValueIndex(timepoint, 0, 1, timePointView.GethIntList()); |
| | | int minuteIndex = timePointView.GetValueIndex(timepoint, 1, 0, timePointView.GetmIntList()); |
| | | //更新状态 |
| | | timePointView.mUIPickerView.setCurrentItems(hourIndex - 1, minuteIndex, 0); |
| | | timePointView.mUIPickerView.setCurrentItems(hourIndex, minuteIndex, 0); |
| | | } |
| | | |
| | | //选中时间回调方法,时间变化一次回调一次 |