| | |
| | | DateTime cunIVDateTime; |
| | | #endregion |
| | | |
| | | /// <summary>
|
| | | /// UI显示
|
| | | /// <summary> |
| | | /// UI显示 |
| | | /// </summary> |
| | | public void Show() |
| | | { |
| | |
| | | delBackgroundFrameLayout.AddChidren(btnDelText); |
| | | |
| | | EventHandler<MouseEventArgs> eHandler2 = (sender2, e2) => |
| | | { |
| | | ClearEventHandler(btnDelText, dialog); |
| | | }; |
| | | { |
| | | var dialog1 = new Dialog { }; |
| | | var doorDialog = new Shared.Phone.UserCenter.DoorLock.DoorlockDialog(dialog1, Language.StringByID(R.MyInternationalizationString.Tip)); |
| | | doorDialog.Show(); |
| | | doorDialog.dialogMidFraFrameLayout.Width = Application.GetRealWidth(415); |
| | | doorDialog.dialogMidFraFrameLayout.Height = Application.GetRealHeight(58); |
| | | doorDialog.dialogMidFraFrameLayout.X = Application.GetRealWidth(190); |
| | | doorDialog.dialogMidFraFrameLayout.Y = Application.GetRealHeight(202); |
| | | doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText); |
| | | doorDialog.dialogMidText.Text = Language.StringByID(R.MyInternationalizationString.SureToDeleteTempPassword); |
| | | doorDialog.dialogMidText.TextSize = 14; |
| | | doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText); |
| | | doorDialog.dialogBtnConfirm.Text = Language.StringByID(R.MyInternationalizationString.Confrim); |
| | | doorDialog.dialogBtnCancel.MouseUpEventHandler += (sender1, e1) => |
| | | { |
| | | dialog.Close(); |
| | | dialog1.Close(); |
| | | }; |
| | | doorDialog.dialogBtnConfirm.MouseUpEventHandler += (sender1, e1) => |
| | | { |
| | | dialog.Close(); |
| | | dialog1.Close(); |
| | | ClearEventHandler(btnDelText, dialog1); |
| | | }; |
| | | }; |
| | | delBackgroundFrameLayout.MouseDownEventHandler += eHandler2; |
| | | btnDelIcon2.MouseDownEventHandler += eHandler2; |
| | | btnDelText.MouseDownEventHandler += eHandler2; |
| | |
| | | Text = Language.StringByID(R.MyInternationalizationString.ClickGenerate), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText, |
| | | TextSize = 12, |
| | | Visible = true, |
| | | Enable = true, |
| | | }; |
| | | topMidTopFrameLayout.AddChidren(topPic); |
| | | |
| | |
| | | { |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | btnFinifh.Enable = true; |
| | | topPic.Visible = true; |
| | | topPic.Enable = true; |
| | | } |
| | | else |
| | | { |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | btnFinifh.Enable = false; |
| | | topPic.Visible = false; |
| | | topPic.Enable = false; |
| | | } |
| | | if (string.IsNullOrEmpty(doorLock.LocalTempPassword)) |
| | | { |
| | |
| | | randomPassword.X = Application.GetRealWidth(215); |
| | | randomPassword.TextColor = Shared.Common.ZigbeeColor.Current.XMGray4; |
| | | Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.IsModify = true; |
| | | topPic.Visible = true; |
| | | topPic.Enable = true; |
| | | } |
| | | else |
| | | { |
| | | randomPassword.Text = doorLock.LocalTempPassword; |
| | | temPasswordVisiable.Visible = true; |
| | | |
| | | // topPic.Visible = false; |
| | | // topPic.Enable = false; |
| | | if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InTempPasswordVisiable) |
| | | { |
| | | randomPassword.SecureTextEntry = false; |
| | |
| | | btnNext.MouseDownEventHandler += hander; |
| | | } |
| | | |
| | | var modifyTempPasswordTip1 = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(49), |
| | | Y = Application.GetRealHeight(628), |
| | | TextID = R.MyInternationalizationString.ModifyTempPasswordTip1, |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, |
| | | TextSize = 12, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | bottomFrameLayout.AddChidren(modifyTempPasswordTip1); |
| | | |
| | | var modifyTempPasswordTip2 = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(49), |
| | | Y = modifyTempPasswordTip1.Bottom, |
| | | Radius = (uint)Application.GetRealHeight(120) / 2, |
| | | TextID = R.MyInternationalizationString.ModifyTempPasswordTip2, |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, |
| | | TextSize = 12, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | bottomFrameLayout.AddChidren(modifyTempPasswordTip2); |
| | | |
| | | btnFinifh = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(907), |
| | |
| | | }); |
| | | return; |
| | | } |
| | | if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateHour == 100) |
| | | { |
| | | //请设置生效时间; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip2), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | }); |
| | | return; |
| | | } |
| | | if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMonth == 0) |
| | | { |
| | | //请设置生效日期; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip3), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | }); |
| | | return; |
| | | } |
| | | if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateHour == 100) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip4), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | }); |
| | | return; |
| | | } |
| | | if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMonth == 0) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip5), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | }); |
| | | return; |
| | | } |
| | | //if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateHour == 100) |
| | | //{ |
| | | // //请设置生效时间; |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip2), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | // }); |
| | | // return; |
| | | //} |
| | | //if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMonth == 0) |
| | | //{ |
| | | // //请设置生效日期; |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip3), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | // }); |
| | | // return; |
| | | //} |
| | | //if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateHour == 100) |
| | | //{ |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip4), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | // }); |
| | | // return; |
| | | //} |
| | | //if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMonth == 0) |
| | | //{ |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip5), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | // }); |
| | | // return; |
| | | //} |
| | | |
| | | var dNow = DateTime.Now; |
| | | var validDateTime = new DateTime(dNow.Year, Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMonth, Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateDay, Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateHour, Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMinute, dNow.Second); |
| | |
| | | if (doorLock.tempPasswordObject != null) |
| | | { |
| | | var addDoorLockTempPasswordData = new ZigBee.Device.DoorLock.AddDoorLockTempPasswordData(); |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | | { |
| | | addDoorLockTempPasswordData.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); |
| | | addDoorLockTempPasswordData.IsOtherAccountCtrl = true; |
| | | } |
| | | addDoorLockTempPasswordData.TempPwd = doorLock.tempPasswordObject.TempPassword; |
| | | if (doorLock.DeviceAddr != null) |
| | | { |
| | |
| | | }); |
| | | return; |
| | | } |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;//XMUnSelect XMBlack |
| | | btnFinifh.Enable = false; |
| | | //btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;//XMUnSelect XMBlack |
| | | //btnFinifh.Enable = false; |
| | | Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.IsModify = false; |
| | | doorLock.LocalTempPassword = doorLock.tempPasswordObject.TempPassword; |
| | | TimeDateData(doorLock.tempPasswordObject.ValidTime, doorLock.tempPasswordObject.InValidTime); |
| | |
| | | return; |
| | | } |
| | | } |
| | | catch { } |
| | | catch (Exception ex) |
| | | { |
| | | var mess = ex.Message; |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | |
| | | if (resultData != null && resultData.defaultControlResponseData != null && resultData.defaultControlResponseData.status == 0) |
| | | { |
| | | var delDoorLockTempPasswordData = new ZigBee.Device.DoorLock.DelDoorLockTempPasswordData(); |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | | { |
| | | delDoorLockTempPasswordData.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); |
| | | delDoorLockTempPasswordData.IsOtherAccountCtrl = true; |
| | | } |
| | | if (doorLock.DeviceAddr != null) |
| | | { |
| | | delDoorLockTempPasswordData.LocalDoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; |
| | |
| | | doorLock.LocalTempPassword = ""; |
| | | TimeDateData(DateTime.Now, DateTime.Now, true); |
| | | Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InTempPasswordVisiable = false; |
| | | Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.IsModify = true; |
| | | } |
| | | else |
| | | { |
| | |
| | | try |
| | | { |
| | | var getDoorLockTempPasswordData = new ZigBee.Device.DoorLock.GetDoorLockTempPasswordData(); |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | | { |
| | | getDoorLockTempPasswordData.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); |
| | | getDoorLockTempPasswordData.IsOtherAccountCtrl = true; |
| | | } |
| | | if (doorLock.DeviceAddr != null) |
| | | { |
| | | getDoorLockTempPasswordData.LocalDoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; |