黄学彪
2019-12-30 3dcbd186c42c598c0c08d1cd37034cf2baa09e54
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
@@ -46,7 +46,7 @@
        #region ◆ 变量申明__________________________
        ZigBee.Device.DoorLock doorLock;//当前门锁
        VerticalRefreshLayout bodyView;//刷新View
        VerticalListRefreshControl  bodyView;//刷新View
        Button currentMethod;// 当前选择的方式
        Shared.Phone.UserCenter.MemberInfoRes curAccountObj;//当前账户
        Button entryStatusPic;
@@ -176,8 +176,9 @@
                Y = Application.GetRealHeight(35),
                X = Application.GetRealWidth(812 - 100),
                TextAlignment = TextAlignment.CenterRight,
                TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText,
                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                TextSize = 12,
                IsBold =true,
            };
            midTopFrameLayout.AddChidren(btnAllMethod);
            // 类型区分 
@@ -226,10 +227,10 @@
            this.midFrameLayout.AddChidren(btnLine);
            #endregion
            bodyView = new VerticalRefreshLayout()
            bodyView = new VerticalListRefreshControl(29)
            {
                Y = btnLine.Bottom,
                Height = Application.GetRealHeight(1921 - 184 - 116),
                Height = Application.GetRealHeight(1921 - 184 - 116),
            };
            this.midFrameLayout.AddChidren(bodyView);
            bodyView.BeginHeaderRefreshingAction += () =>
@@ -237,7 +238,7 @@
                bodyView.BeginHeaderRefreshing();
                ReadDoorLockUserInfo();
            };
            BlankPicUI();
            BlankPicUI();
        }
        /// <summary>
@@ -269,18 +270,19 @@
                Gravity = Gravity.CenterHorizontal,
                Visible = false,
                Y = Application.GetRealHeight(844),
                TextSize = 12,
            };
            blankFrameLayout.AddChidren(btnPicTip);
            btnPicTip1 = new Button
            {
                X = Application.GetRealWidth(397),
                Y = btnPicTip.Bottom,
                X = Application.GetRealWidth(397),
                Y = Application.GetRealHeight(844+49),
                Text = Language.StringByID(R.MyInternationalizationString.NoPasswordInformation1),
                TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
                Gravity = Gravity.CenterHorizontal,
                Visible = false,
                BackgroundColor = 0xff00ff00,
                Visible = true,
                TextSize =12,
            };
            blankFrameLayout.AddChidren(btnPicTip1);
        }
@@ -332,13 +334,7 @@
                entryStatusPic.Width = Application.GetRealHeight(0);
                btnPicTip.Height = Application.GetRealHeight(0);
                btnPicTip1.Height = Application.GetRealHeight(0);
                blankFrameLayout.Height = Application.GetRealHeight(0);
                var frameLayoutRow = new FrameLayout()
                {
                    Height = Application.GetMinRealAverage(0),
                    BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                };
                bodyView.AddChidren(frameLayoutRow);
                blankFrameLayout.Height = Application.GetRealHeight(0);
                int i = 0;
                foreach (var curUserId in curAccountDoorLockUserList.Keys)
@@ -369,69 +365,177 @@
                    }
                    #region UI
                    var rowFrameLayout = new RowLayout()
                    {
                        Height = Application.GetRealHeight(127 + 23),
                        X = Application.GetRealWidth(58),
                        Y = i * Application.GetRealHeight(150),
                        Width = Application.GetRealWidth(965),
                        LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
                        BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                    };
                    frameLayoutRow.AddChidren(rowFrameLayout);
                    var btnPicFrameLayout = new FrameLayout()
                    var rowFrameLayout = new RowLayoutControl(bodyView.rowSpace / 2);
                    rowFrameLayout.BackgroundColor = ZigbeeColor.Current.XMWhite;
                    bodyView.AddChidren(rowFrameLayout);
                    rowFrameLayout.frameTable.UseClickStatu = false;
                    var btnicon = rowFrameLayout.frameTable.AddLeftIcon();
                    btnicon.UnSelectedImagePath = "DoorLock/DoorLockUserPic.png";
                    //上面门锁用户名称一行
                    //rowFrameLayout.frameTable.AddTopView("", 800);
                    var memberText = "";
                    if (curAccountObj.UserName == "" || curAccountObj.UserName == null)
                    {
                        Width = Application.GetRealWidth(81),
                        Height = Application.GetRealHeight(81),
                        X = Application.GetRealWidth(40),
                        Y = Application.GetRealHeight(49),
                    };
                    rowFrameLayout.AddChidren(btnPicFrameLayout);
                    var btnPic = new Button()
                        memberText = curAccountObj.Account;
                    }
                    else
                    {
                        Width = Application.GetRealWidth(84),
                        Height = Application.GetRealHeight(84),
                        UnSelectedImagePath = "DoorLock/DoorLockUserPic.png",
                    };
                    btnPicFrameLayout.AddChidren(btnPic);
                        memberText = curAccountObj.UserName;
                    }
                    //成员一行
                    var btnaa = rowFrameLayout.frameTable.AddBottomView(memberText, 800);
                    var btnDoorlockUser = new EditText()
                    {
                        Width = Application.GetRealWidth(1080 - 173),
                        Width = Application.GetRealWidth(800),
                        Height = Application.GetRealHeight(60),
                        X = Application.GetRealWidth(173),
                        Y = Application.GetRealHeight(35),
                        X = btnaa.X,
                        Y = rowFrameLayout.chidrenYaxis + Application.GetRealHeight(12),
                        TextSize = 14,
                        PlaceholderTextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
                        TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                        TextAlignment = TextAlignment.CenterLeft,
                    };
                    rowFrameLayout.AddChidren(btnDoorlockUser);
                    var btnMember = new Button()
                    rowFrameLayout.frameTable.AddChidren(btnDoorlockUser, ChidrenBindMode.NotBind);
                    rowFrameLayout.frameTable.AddBottomLine();
                    var btndelete = rowFrameLayout.AddDeleteControl();
                    btndelete.ButtonClickEvent += (sender, e) =>
                    {
                        Width = Application.GetRealWidth(1080 - 173),
                        Height = Application.GetRealHeight(49),
                        X = Application.GetRealWidth(173),
                        Y = Application.GetRealHeight(95),
                        TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
                        TextSize = 14,
                        TextAlignment = TextAlignment.CenterLeft,
                    };
                    rowFrameLayout.AddChidren(btnMember);
                    var btnDel = new Button()
                    {
                        Width = Application.GetRealWidth(184),
                        Text = Language.StringByID(R.MyInternationalizationString.DelBindDevice),
                        TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                        TextSize = 12,
                        TextAlignment = TextAlignment.Center,
                        BackgroundColor = Shared.Common.ZigbeeColor.Current.XMDel,
                    };
                    rowFrameLayout.AddRightView(btnDel);
                        var dialog = new Dialog { };
                        var doorDialog = new Shared.Phone.UserCenter.DoorLock.DoorlockDialog(dialog, Language.StringByID(R.MyInternationalizationString.Tip));
                        doorDialog.Show();
                        doorDialog.dialogMidFraFrameLayout.Height = Application.GetRealHeight(58);
                        doorDialog.dialogMidFraFrameLayout.X = Application.GetRealWidth(0);
                        doorDialog.dialogMidFraFrameLayout.Y = Application.GetRealHeight(202);
                        doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText);
                        doorDialog.dialogMidText.Text = Language.StringByID(R.MyInternationalizationString.SureToDelUnlockMethod);
                        doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText);
                        doorDialog.dialogBtnConfirm.Text = Language.StringByID(R.MyInternationalizationString.DoorlockConfirm);
                        doorDialog.dialogBtnCancel.MouseUpEventHandler += (sender1, e1) =>
                        {
                            dialog.Close();
                        };
                        doorDialog.dialogBtnConfirm.MouseUpEventHandler += async (sender1, e1) =>
                        {
                            try
                            {
                                CommonPage.Loading.Start("");
                                var passData = doorLock.SetUserAccessData(curDoorLockUser.UserID, ZigBee.Device.DoorLock.AccessType.DelCurrentUser);
                                var resultData = await doorLock.DefaultControlAsync(passData);
                                if (resultData != null && resultData.defaultControlResponseData != null)
                                {
                                    if (resultData.defaultControlResponseData.status == 0 || resultData.defaultControlResponseData.status == 2)
                                    {
                                        var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
                                        if (UserCenterResourse.UserInfo.AuthorityNo != 1)
                                        {
                                            deleteDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
                                            deleteDoorLockData.IsOtherAccountCtrl = true;
                                        }
                                        if (doorLock.DeviceAddr != null)
                                        {
                                            deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
                                        }
                                        deleteDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
                                        deleteDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
                                        deleteDoorLockData.DelDoorLockDelType = 2;
                                        var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/DelDoorLock", deleteDoorLockData);
                                        if (result != null)
                                        {
                                            if (result.StateCode == "Success")
                                            {
                                                isSecondDel = false;
                                                if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
                                                {
                                                    doorLock.localDoorLockAccountList.Remove(curDoorLockUser.ConnectedAccount);
                                                    var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
                                                    localDoorLockObj.UserID = curDoorLockUser.UserID;
                                                    doorLock.localDoorLockUserList.Remove(curUserId);
                                                    doorLock.ReSave();
                                                    TypeRefresh();
                                                }
                                            }
                                            else
                                            {
                                                //开关图标
                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                            }
                                        }
                                        else
                                        {
                                            isSecondDel = true;
                                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                        }
                                    }
                                    else
                                    {
                                        if (isSecondDel)
                                        {
                                            var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
                                            if (UserCenterResourse.UserInfo.AuthorityNo != 1)
                                            {
                                                deleteDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
                                                deleteDoorLockData.IsOtherAccountCtrl = true;
                                            }
                                            if (doorLock.DeviceAddr != null)
                                            {
                                                deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
                                            }
                                            deleteDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
                                            deleteDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
                                            deleteDoorLockData.DelDoorLockDelType = 2;
                                            var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/DelDoorLock", deleteDoorLockData);
                                            if (result != null)
                                            {
                                                if (result.StateCode == "Success")
                                                {
                                                    isSecondDel = false;
                                                    if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
                                                    {
                                                        doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
                                                        var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
                                                        localDoorLockObj.UserID = curDoorLockUser.UserID;
                                                        doorLock.localDoorLockUserList.Remove(curUserId);
                                                        TypeRefresh();
                                                    }
                                                }
                                                else
                                                {
                                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                                }
                                            }
                                            else
                                            {
                                                isSecondDel = true;
                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                            }
                                        }
                                        else
                                        {
                                            if (curDoorLockUser.UserID < 10)
                                            {
                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.OnlyBeDeletedOnTheDevice), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                            }
                                            else
                                            {
                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
                                }
                                dialog.Close();
                            }
                            catch { }
                            finally
                            {
                                CommonPage.Loading.Hide();
                            }
                        };
                    };
                    #endregion
                    #region 数据处理
@@ -475,14 +579,6 @@
                            break;
                    }
                    if (curAccountObj.UserName == "" || curAccountObj.UserName == null)
                    {
                        btnMember.Text = curAccountObj.Account;
                    }
                    else
                    {
                        btnMember.Text = curAccountObj.UserName;
                    }
                    Action<Shared.View> action = async (obj) =>
                     {
@@ -530,152 +626,147 @@
                     };
                    btnDoorlockUser.EditorEnterAction += action;
                    btnDel.MouseUpEventHandler += (sender, e) =>
                    {
                        var alert = new Alert(Language.StringByID(R.MyInternationalizationString.Tip), Language.StringByID(R.MyInternationalizationString.SureToDelUnlockMethod),
                                                      Language.StringByID(R.MyInternationalizationString.Cancel), Language.StringByID(R.MyInternationalizationString.Confrim));
                        alert.Show();
                        alert.ResultEventHandler += async (sender1, e1) =>
                        {
                            if (e1)
                            {
                                try
                                {
                                    CommonPage.Loading.Start("");
                                    var passData = doorLock.SetUserAccessData(curDoorLockUser.UserID, ZigBee.Device.DoorLock.AccessType.DelCurrentUser);
                                    var resultData = await doorLock.DefaultControlAsync(passData);
                                    if (resultData != null && resultData.defaultControlResponseData != null)
                                    {
                                        if (resultData.defaultControlResponseData.status == 0 || resultData.defaultControlResponseData.status == 2)
                                        {
                                            var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
                                            if (UserCenterResourse.UserInfo.AuthorityNo != 1)
                                            {
                                                deleteDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
                                                deleteDoorLockData.IsOtherAccountCtrl = true;
                                            }
                                            if (doorLock.DeviceAddr != null)
                                            {
                                                deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
                                            }
                                            deleteDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
                                            deleteDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
                                            deleteDoorLockData.DelDoorLockDelType = 2;
                                            var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/DelDoorLock", deleteDoorLockData);
                                            if (result != null)
                                            {
                                                if (result.StateCode == "Success")
                                                {
                                                    isSecondDel = false;
                                                    if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
                                                    {
                                                        doorLock.localDoorLockAccountList.Remove(curDoorLockUser.ConnectedAccount);
                                                        var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
                                                        localDoorLockObj.UserID = curDoorLockUser.UserID;
                                                        doorLock.localDoorLockUserList.Remove(curUserId);
                                                        doorLock.ReSave();
                                                        TypeRefresh();
                                                    }
                                                }
                                                else
                                                {
                                                    //开关图标
                                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                                }
                                            }
                                            else
                                            {
                                                isSecondDel = true;
                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                            }
                                        }
                                        else
                                        {
                                            if (isSecondDel)
                                            {
                                                var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
                                                if (UserCenterResourse.UserInfo.AuthorityNo != 1)
                                                {
                                                    deleteDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
                                                    deleteDoorLockData.IsOtherAccountCtrl = true;
                                                }
                                                if (doorLock.DeviceAddr != null)
                                                {
                                                    deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
                                                }
                                                deleteDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
                                                deleteDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
                                                deleteDoorLockData.DelDoorLockDelType = 2;
                                                var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/DelDoorLock", deleteDoorLockData);
                                                if (result != null)
                                                {
                                                    if (result.StateCode == "Success")
                                                    {
                                                        isSecondDel = false;
                                                        if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
                                                        {
                                                            doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
                                                            var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
                                                            localDoorLockObj.UserID = curDoorLockUser.UserID;
                                                            doorLock.localDoorLockUserList.Remove(curUserId);
                                                            TypeRefresh();
                                                        }
                                                    }
                                                    else
                                                    {
                                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                                    }
                                                }
                                                else
                                                {
                                                    isSecondDel = true;
                                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                                }
                                            }
                                            else
                                            {
                                                if (curDoorLockUser.UserID < 10)
                                                {
                                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.OnlyBeDeletedOnTheDevice), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                                }
                                                else
                                                {
                                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                                }
                                            }
                                        }
                                    }
                                    else
                                    {
                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
                                    }
                                }
                                catch { }
                                finally
                                {
                                    CommonPage.Loading.Hide();
                                }
                            }
                        };
                    };
                    //btnDel.MouseUpEventHandler += (sender, e) =>
                    //{
                    //var dialog = new Dialog { };
                    //var doorDialog = new Shared.Phone.UserCenter.DoorLock.DoorlockDialog(dialog, Language.StringByID(R.MyInternationalizationString.Tip));
                    //doorDialog.Show();
                    //doorDialog.dialogMidFraFrameLayout.Height = Application.GetRealHeight(58);
                    //doorDialog.dialogMidFraFrameLayout.X = Application.GetRealWidth(0);
                    //doorDialog.dialogMidFraFrameLayout.Y = Application.GetRealHeight(202);
                    //doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText);
                    //doorDialog.dialogMidText.Text = Language.StringByID(R.MyInternationalizationString.SureToDelUnlockMethod);
                    //doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText);
                    //doorDialog.dialogBtnConfirm.Text = Language.StringByID(R.MyInternationalizationString.DoorlockConfirm);
                    //doorDialog.dialogBtnCancel.MouseUpEventHandler += (sender1, e1) =>
                    //{
                    //    dialog.Close();
                    //};
                    //doorDialog.dialogBtnConfirm.MouseUpEventHandler += async (sender1, e1) =>
                    //{
                    //    try
                    //    {
                    //        CommonPage.Loading.Start("");
                    //        var passData = doorLock.SetUserAccessData(curDoorLockUser.UserID, ZigBee.Device.DoorLock.AccessType.DelCurrentUser);
                    //        var resultData = await doorLock.DefaultControlAsync(passData);
                    //        if (resultData != null && resultData.defaultControlResponseData != null)
                    //        {
                    //            if (resultData.defaultControlResponseData.status == 0 || resultData.defaultControlResponseData.status == 2)
                    //            {
                    //                var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
                    //                if (UserCenterResourse.UserInfo.AuthorityNo != 1)
                    //                {
                    //                    deleteDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
                    //                    deleteDoorLockData.IsOtherAccountCtrl = true;
                    //                }
                    //                if (doorLock.DeviceAddr != null)
                    //                {
                    //                    deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
                    //                }
                    //                deleteDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
                    //                deleteDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
                    //                deleteDoorLockData.DelDoorLockDelType = 2;
                    //                var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/DelDoorLock", deleteDoorLockData);
                    //                if (result != null)
                    //                {
                    //                    if (result.StateCode == "Success")
                    //                    {
                    //                        isSecondDel = false;
                    //                        if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
                    //                        {
                    //                            doorLock.localDoorLockAccountList.Remove(curDoorLockUser.ConnectedAccount);
                    //                            var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
                    //                            localDoorLockObj.UserID = curDoorLockUser.UserID;
                    //                            doorLock.localDoorLockUserList.Remove(curUserId);
                    //                            doorLock.ReSave();
                    //                            TypeRefresh();
                    //                        }
                    //                    }
                    //                    else
                    //                    {
                    //                        //开关图标
                    //                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                    //                    }
                    //                }
                    //                else
                    //                {
                    //                    isSecondDel = true;
                    //                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                    //                }
                    //            }
                    //            else
                    //            {
                    //                if (isSecondDel)
                    //                {
                    //                    var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
                    //                    if (UserCenterResourse.UserInfo.AuthorityNo != 1)
                    //                    {
                    //                        deleteDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
                    //                        deleteDoorLockData.IsOtherAccountCtrl = true;
                    //                    }
                    //                    if (doorLock.DeviceAddr != null)
                    //                    {
                    //                        deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
                    //                    }
                    //                    deleteDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
                    //                    deleteDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
                    //                    deleteDoorLockData.DelDoorLockDelType = 2;
                    //                    var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/DelDoorLock", deleteDoorLockData);
                    //                    if (result != null)
                    //                    {
                    //                        if (result.StateCode == "Success")
                    //                        {
                    //                            isSecondDel = false;
                    //                            if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
                    //                            {
                    //                                doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
                    //                                var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
                    //                                localDoorLockObj.UserID = curDoorLockUser.UserID;
                    //                                doorLock.localDoorLockUserList.Remove(curUserId);
                    //                                TypeRefresh();
                    //                            }
                    //                        }
                    //                        else
                    //                        {
                    //                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                    //                        }
                    //                    }
                    //                    else
                    //                    {
                    //                        isSecondDel = true;
                    //                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                    //                    }
                    //                }
                    //                else
                    //                {
                    //                    if (curDoorLockUser.UserID < 10)
                    //                    {
                    //                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.OnlyBeDeletedOnTheDevice), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                    //                    }
                    //                    else
                    //                    {
                    //                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                    //                    }
                    //                }
                    //            }
                    //        }
                    //        else
                    //        {
                    //            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
                    //        }
                    //        dialog.Close();
                    //    }
                    //    catch { }
                    //    finally
                    //    {
                    //        CommonPage.Loading.Hide();
                    //    }
                    //};
                    //};
                    #endregion
                    i++;
                }
                //遮挡RowLayout多余的线条
                for (int j = 0; j < curAccountDoorLockUserList.Keys.Count; j++)
                {
                    var frameLayoutRowLineHide = new FrameLayout()
                    {
                        Height = 10,
                        Width = Application.GetRealWidth(173),
                        X = Application.GetRealWidth(58),
                        Y = (j + 1) * Application.GetRealHeight(150)-5,
                        BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                    };
                    frameLayoutRow.AddChidren(frameLayoutRowLineHide);
                }
                frameLayoutRow.Height = i * Application.GetRealHeight(150);
                //bodyView.AdjustRealHeight(Application.GetRealHeight(23));
            }
        }
@@ -726,7 +817,7 @@
                {
                    Width = Application.GetRealWidth(81),
                    Height = Application.GetRealHeight(81),
                    Y = Application.GetRealHeight(55),
                    Y = Application.GetRealHeight(35),
                };
                rowFrameLayout.AddChidren(btnAllMethod);
@@ -735,7 +826,7 @@
                    Width = Application.GetRealWidth(311),
                    Height = Application.GetRealHeight(58),
                    X = Application.GetRealWidth(92),
                    Y = Application.GetRealHeight(69),
                    Y = Application.GetRealHeight(49),
                    TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
                    TextSize = 14,
                    TextAlignment = TextAlignment.CenterLeft,
@@ -760,6 +851,7 @@
                        doorLock.ReSave();
                        btnAllMethod.IsSelected = true;
                        oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                        oldbuttonText.IsBold = true;
                        TypeRefresh();
                    }
                    dialog.Close();
@@ -796,6 +888,7 @@
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    btnMethodText.IsBold = true;
                    oldbutton = btnAllMethod;
                    oldbuttonText = btnMethodText;
                }
@@ -803,6 +896,7 @@
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    btnMethodText.IsBold = true;
                    oldbutton = btnAllMethod;
                    oldbuttonText = btnMethodText;
                }
@@ -810,6 +904,7 @@
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    btnMethodText.IsBold = true;
                    oldbutton = btnAllMethod;
                    oldbuttonText = btnMethodText;
                }
@@ -817,6 +912,7 @@
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    btnMethodText.IsBold = true;
                    oldbutton = btnAllMethod;
                    oldbuttonText = btnMethodText;
                }
@@ -824,6 +920,7 @@
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    btnMethodText.IsBold = true;
                    oldbutton = btnAllMethod;
                    oldbuttonText = btnMethodText;
                }