| | |
| | | |
| | | //布防功能 |
| | | iniDefenseView(); |
| | | |
| | | #if DEBUG |
| | | //告警目标 |
| | | iniAlarmView(); |
| | | #endif |
| | | |
| | | #region 底部区域 |
| | | var bottomView = new FrameLayout() |
| | |
| | | |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (string.IsNullOrEmpty( securityAlarm.name )) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | | Text = "请输入安防名称", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | |
| | | if (securityAlarm.input.Count == 0) |
| | | { |
| | | var tip = new Tip() |
| | |
| | | tip.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (securityAlarm.output.Count == 0) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | | Text = "请选择告警目标", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | |
| | | return; |
| | | } |
| | | //if (securityAlarm.output.Count == 0) |
| | | //{ |
| | | // var tip = new Tip() |
| | | // { |
| | | // Text = "请选择告警目标", |
| | | // CloseTime = 3, |
| | | // Direction = AMPopTipDirection.None |
| | | // }; |
| | | // tip.Show(MainPage.BaseView); |
| | | // return; |
| | | //} |
| | | |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(); |
| | |
| | | var code = securityAlarm.SaveInfo(); |
| | | if (code == StateCode.SUCCESS) |
| | | { |
| | | SecurityCenter.Security.GetSecurityAlarmList(); |
| | | Common.ApiUtlis.Ins.GetSecurityList(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | this.RemoveFromParent(); |
| | |
| | | { |
| | | foreach (var target in securityAlarm.input) |
| | | { |
| | | inputTargetView.AddChidren(new InputRow(target.GetFunction().name, target.GetFunction().GetRoomListName(),target.StateText())); |
| | | if (target.GetFunction() != null) |
| | | { |
| | | inputTargetView.AddChidren(new InputRow(target.GetFunction().name, target.GetFunction().GetRoomListName(), target.StateText())); |
| | | } |
| | | } |
| | | inputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.input.Count); |
| | | //if (outputTargetView != null) |
| | |
| | | btnDeploymentName.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加安防 |
| | | /// </summary> |
| | | void LoadEvent_AddDefense() |
| | | { |
| | | var responsePack = new HttpServerRequest().AddSecurity(new List<SecurityAlarm>() { securityAlarm}); |
| | | if (responsePack.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | this.RemoveFromParent(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(responsePack.Code); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | Button btnState = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(369), |
| | | Width = Application.GetRealWidth(360), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |