HDL Home App 第二版本 旧平台金堂用 正在使用
xm
2019-11-21 ec35d79add60d1438dff5291389f7e69c579d9f9
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
@@ -47,7 +47,7 @@
        #region ◆ 变量申明__________________________
        ZigBee.Device.DoorLock doorLock;
        VerticalScrolViewLayout bodyView;
        VerticalRefreshLayout bodyView;
        Button currentMethod;// 当前选择的方式
        Shared.Phone.UserCenter.MemberInfoRes curAccountObj;
        Button entryStatusPic;
@@ -60,7 +60,6 @@
        {
            System.Threading.Tasks.Task.Run(async () =>
            {
                Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); });
                try
                {
                    var list = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockAllAcountUserlist(doorLock);
@@ -141,11 +140,22 @@
            {
                btnAddFrameLayout.Width = Application.GetRealWidth(72);
            }
            MidFrameLayoutContent();
            if (doorLock.IsFailedToGetDoorLockInfo[curAccountObj.SubAccountDistributedMark] == true)
            {
                CommonPage.Loading.Start("Loading...");
                ReadDoorLockUserInfo();
            }
            else
            {
                MidFrameLayoutContent();
                RefreshList();
            }
        }
        //中部布局
        void MidFrameLayoutContent()
        {
            #region 开锁方式UI
            var midTopFrameLayout = new FrameLayout()
            {
                Height = Application.GetRealHeight(115),
@@ -177,22 +187,33 @@
            };
            midTopFrameLayout.AddChidren(btnNext);
            btnNext.MouseUpEventHandler += (sender, e) =>
            {
                SideslipFramelayout();
            };
            var btnLine = new Button
            {
                Y = midTopFrameLayout.Bottom,
                Height = 1,
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTitleLine,
            };
            this.midFrameLayout.AddChidren(btnLine);
            #endregion
            entryStatusPic = new Button
            {
                X = Application.GetRealWidth(164),
                Y = Application.GetRealHeight(492),
                Height = Application.GetRealHeight(435),
                Width = Application.GetRealWidth(757),
                Y = Application.GetRealHeight(377),
                Visible = false,
                UnSelectedImagePath = "DoorLock/UnLockBlankPic.png",
            };
            this.midFrameLayout.AddChidren(entryStatusPic);
            #region 空图片
            btnPicTip = new Button
            {
                X = Application.GetRealWidth(397),
                Y = Application.GetRealHeight(1143 - 184),
                Height = Application.GetRealHeight(98 / 2),
                Y = Application.GetRealHeight(844),
                Text = Language.StringByID(R.MyInternationalizationString.NoPasswordInformation),
                TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
                Gravity = Gravity.CenterHorizontal,
@@ -204,41 +225,25 @@
            {
                X = Application.GetRealWidth(397),
                Y = btnPicTip.Bottom,
                Height = Application.GetRealHeight(98 / 2),
                Text = Language.StringByID(R.MyInternationalizationString.NoPasswordInformation1),
                TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
                Gravity = Gravity.CenterHorizontal,
                Visible = false,
            };
            this.midFrameLayout.AddChidren(btnPicTip1);
            #endregion
            var btnLine = new Button
            {
                Y = midTopFrameLayout.Bottom,
                Height = 1,
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTitleLine,
            };
            this.midFrameLayout.AddChidren(btnLine);
            bodyView = new VerticalScrolViewLayout()
            bodyView = new VerticalRefreshLayout()
            {
                Y = btnLine.Bottom,
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
            };
            this.midFrameLayout.AddChidren(bodyView);
            btnNext.MouseUpEventHandler += (sender, e) =>
            bodyView.BeginHeaderRefreshingAction += () =>
            {
                SideslipFramelayout();
            };
            if (doorLock.IsFailedToGetDoorLockInfo[curAccountObj.SubAccountDistributedMark] == true)
            {
                bodyView.BeginHeaderRefreshing();
                ReadDoorLockUserInfo();
            }
            else
            {
                RefreshList();
            }
                bodyView.EndHeaderRefreshing();
            };
        }
        /// <summary>
@@ -248,14 +253,10 @@
        /// <param name="key"></param>
        public void RefreshList()
        {
            if (doorLock.IsFailedToGetDoorLockInfo[curAccountObj.SubAccountDistributedMark] == true)
            {
                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                return;
            }
            this.midFrameLayout.RemoveAll();
            MidFrameLayoutContent();
            bodyView.RemoveAll();
            var curAccountDoorLockUserList = new Dictionary<int, ZigBee.Device.DoorLock.LocaDoorLockObj>();
            foreach (var curUserId in doorLock.localDoorLockUserList.Keys)
            {
                var curDoorLockUser = doorLock.localDoorLockUserList[curUserId];
@@ -275,244 +276,207 @@
                entryStatusPic.Visible = true;
                btnPicTip.Visible = true;
                btnPicTip1.Visible = true;
                entryStatusPic.Height = Application.GetRealHeight(435);
                entryStatusPic.Width = Application.GetRealHeight(757);
                btnPicTip.Height = Application.GetRealHeight(98 / 2);
                btnPicTip1.Height = Application.GetRealHeight(98 / 2);
                bodyView.Height = Application.GetRealHeight(0);
            }
            else
            {
                bodyView.Height = Application.GetRealHeight(1921 - 184 - 116);
                entryStatusPic.Visible = false;
                btnPicTip.Visible = false;
                btnPicTip1.Visible = false;
            }
            if (curAccountDoorLockUserList.Keys.Count == 0)
            {
                return;
            }
            bodyView.Height = curAccountDoorLockUserList.Keys.Count * Application.GetRealHeight(127 + 23);
            int i = 0;
            foreach (var curUserId in curAccountDoorLockUserList.Keys)
            {
                var curDoorLockUser = curAccountDoorLockUserList[curUserId];
                #region UI
                var rowFrameLayout = new RowLayout()
                entryStatusPic.Height = Application.GetRealHeight(0);
                entryStatusPic.Width = Application.GetRealHeight(0);
                btnPicTip.Height = Application.GetRealHeight(0);
                btnPicTip1.Height = Application.GetRealHeight(0);
                var frameLayoutRow = new FrameLayout()
                {
                    Height = Application.GetRealHeight(127 + 23),
                    X = Application.GetRealWidth(58),
                    Width = Application.GetRealWidth(965),
                    LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
                    Height = Application.GetMinRealAverage(0),
                    BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                };
                bodyView.AddChidren(rowFrameLayout);
                bodyView.AddChidren(frameLayoutRow);
                int i = 0;
                foreach (var curUserId in curAccountDoorLockUserList.Keys)
                {
                    var curDoorLockUser = curAccountDoorLockUserList[curUserId];
                    #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()
                {
                    Width = Application.GetRealWidth(81),
                    Height = Application.GetRealHeight(81),
                    X = Application.GetRealWidth(40),
                    Y = Application.GetRealHeight(49),
                };
                rowFrameLayout.AddChidren(btnPicFrameLayout);
                    var btnPicFrameLayout = new FrameLayout()
                    {
                        Width = Application.GetRealWidth(81),
                        Height = Application.GetRealHeight(81),
                        X = Application.GetRealWidth(40),
                        Y = Application.GetRealHeight(49),
                    };
                    rowFrameLayout.AddChidren(btnPicFrameLayout);
                var btnPic = new Button()
                {
                    Width = Application.GetRealWidth(84),
                    Height = Application.GetRealHeight(84),
                    UnSelectedImagePath = "DoorLock/DoorLockUserPic.png",
                };
                btnPicFrameLayout.AddChidren(btnPic);
                    var btnPic = new Button()
                    {
                        Width = Application.GetRealWidth(84),
                        Height = Application.GetRealHeight(84),
                        UnSelectedImagePath = "DoorLock/DoorLockUserPic.png",
                    };
                    btnPicFrameLayout.AddChidren(btnPic);
                var btnDoorlockUser = new EditText()
                {
                    Width = Application.GetRealWidth(1080 - 173),
                    Height = Application.GetRealHeight(60),
                    X = Application.GetRealWidth(173),
                    Y = Application.GetRealHeight(35),
                    TextSize = 14,
                    PlaceholderTextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
                    TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                    TextAlignment = TextAlignment.CenterLeft,
                };
                rowFrameLayout.AddChidren(btnDoorlockUser);
                    var btnDoorlockUser = new EditText()
                    {
                        Width = Application.GetRealWidth(1080 - 173),
                        Height = Application.GetRealHeight(60),
                        X = Application.GetRealWidth(173),
                        Y = Application.GetRealHeight(35),
                        TextSize = 14,
                        PlaceholderTextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
                        TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                        TextAlignment = TextAlignment.CenterLeft,
                    };
                    rowFrameLayout.AddChidren(btnDoorlockUser);
                var btnMember = new Button()
                {
                    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 btnMember = new Button()
                    {
                        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(1080 - 173),
                    Height = Application.GetRealHeight(49),
                    X = Application.GetRealWidth(173),
                    Y = Application.GetRealHeight(95),
                    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);
                #endregion
                #region 数据处理
                int currentIndex = i;
                if (currentIndex == curAccountDoorLockUserList.Keys.Count - 1)
                {
                    rowFrameLayout.LineColor = Shared.Common.ZigbeeColor.Current.XMWhite;
                }
                    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);
                    #endregion
                    #region 数据处理
                    int currentIndex = i;
                    if (currentIndex == curAccountDoorLockUserList.Keys.Count - 1)
                    {
                        rowFrameLayout.LineColor = Shared.Common.ZigbeeColor.Current.XMWhite;
                    }
                switch (curDoorLockUser.UnlockType)
                {
                    case 0:
                        if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                        {
                            btnDoorlockUser.Text = curDoorLockUser.UserName;
                        }
                        else
                        {
                            btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID;
                        }
                        break;
                    case 3:
                        if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                        {
                            btnDoorlockUser.Text = curDoorLockUser.UserName;
                        }
                        else
                        {
                            btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID;
                        }
                        break;
                    case 15:
                        if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                        {
                            btnDoorlockUser.Text = curDoorLockUser.UserName;
                        }
                        else
                        {
                            btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID;
                        }
                        break;
                }
                    switch (curDoorLockUser.UnlockType)
                    {
                        case 0:
                            if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                            {
                                btnDoorlockUser.Text = curDoorLockUser.UserName;
                            }
                            else
                            {
                                btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID;
                            }
                            break;
                        case 3:
                            if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                            {
                                btnDoorlockUser.Text = curDoorLockUser.UserName;
                            }
                            else
                            {
                                btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID;
                            }
                            break;
                        case 15:
                            if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                            {
                                btnDoorlockUser.Text = curDoorLockUser.UserName;
                            }
                            else
                            {
                                btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID;
                            }
                            break;
                    }
                if (curAccountObj.UserName == "" || curAccountObj.UserName == null)
                {
                    btnMember.Text = curAccountObj.Account;
                }
                else
                {
                    btnMember.Text = curAccountObj.UserName;
                }
                    if (curAccountObj.UserName == "" || curAccountObj.UserName == null)
                    {
                        btnMember.Text = curAccountObj.Account;
                    }
                    else
                    {
                        btnMember.Text = curAccountObj.UserName;
                    }
                Action<Shared.View> action = async (obj) =>
                 {
                     var refreshDoorLockData = new ZigBee.Device.DoorLock.RefreshDoorLockData();
                     if (UserCenterResourse.UserInfo.AuthorityNo != 1)
                    Action<Shared.View> action = async (obj) =>
                     {
                         refreshDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
                         refreshDoorLockData.IsOtherAccountCtrl = true;
                     }
                     if (doorLock.DeviceAddr != null)
                     {
                         refreshDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
                     }
                     refreshDoorLockData.OpenLockMode = curDoorLockUser.UnlockType;
                     refreshDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
                     refreshDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
                     refreshDoorLockData.UserIdRemarks = btnDoorlockUser.Text;
                     var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/UpdateDoorLock", refreshDoorLockData);
                     if (result != null)
                     {
                         if (result.StateCode == "Success")
                         var refreshDoorLockData = new ZigBee.Device.DoorLock.RefreshDoorLockData();
                         if (UserCenterResourse.UserInfo.AuthorityNo != 1)
                         {
                             if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
                             refreshDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
                             refreshDoorLockData.IsOtherAccountCtrl = true;
                         }
                         if (doorLock.DeviceAddr != null)
                         {
                             refreshDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
                         }
                         refreshDoorLockData.OpenLockMode = curDoorLockUser.UnlockType;
                         refreshDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
                         refreshDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
                         refreshDoorLockData.UserIdRemarks = btnDoorlockUser.Text;
                         var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/UpdateDoorLock", refreshDoorLockData);
                         if (result != null)
                         {
                             if (result.StateCode == "Success")
                             {
                                 doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
                                 var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
                                 localDoorLockObj.UserID = curDoorLockUser.UserID;
                                 localDoorLockObj.UnlockType = curDoorLockUser.UnlockType;
                                 localDoorLockObj.EntryTime = curDoorLockUser.EntryTime;
                                 localDoorLockObj.UserName = refreshDoorLockData.UserIdRemarks;
                                 localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark;
                                 doorLock.localDoorLockUserList.Add(curDoorLockUser.UserID, localDoorLockObj);
                                 RefreshList();
                                 if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
                                 {
                                     doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
                                     var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
                                     localDoorLockObj.UserID = curDoorLockUser.UserID;
                                     localDoorLockObj.UnlockType = curDoorLockUser.UnlockType;
                                     localDoorLockObj.EntryTime = curDoorLockUser.EntryTime;
                                     localDoorLockObj.UserName = refreshDoorLockData.UserIdRemarks;
                                     localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark;
                                     doorLock.localDoorLockUserList.Add(curDoorLockUser.UserID, localDoorLockObj);
                                     RefreshList();
                                 }
                             }
                             else
                             {
                                 new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                             }
                         }
                         else
                         {
                             new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                             new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                         }
                     }
                     else
                     {
                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                     }
                 };
                btnDoorlockUser.EditorEnterAction += action;
                     };
                    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) =>
                    btnDel.MouseUpEventHandler += (sender, e) =>
                    {
                        if (e1)
                        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) =>
                        {
                            var passData = doorLock.SetUserAccessData(curDoorLockUser.UserID, ZigBee.Device.DoorLock.AccessType.DelCurrentUser);
                            var resultData = await doorLock.DefaultControlAsync(passData);
                            if (resultData != null && resultData.defaultControlResponseData != null)
                            if (e1)
                            {
                                if (resultData.defaultControlResponseData.status == 0 || resultData.defaultControlResponseData.status == 2)
                                var passData = doorLock.SetUserAccessData(curDoorLockUser.UserID, ZigBee.Device.DoorLock.AccessType.DelCurrentUser);
                                var resultData = await doorLock.DefaultControlAsync(passData);
                                if (resultData != null && resultData.defaultControlResponseData != null)
                                {
                                    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();
                                                RefreshList();
                                            }
                                        }
                                        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)
                                    if (resultData.defaultControlResponseData.status == 0 || resultData.defaultControlResponseData.status == 2)
                                    {
                                        var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
                                        if (UserCenterResourse.UserInfo.AuthorityNo != 1)
@@ -535,15 +499,17 @@
                                                isSecondDel = false;
                                                if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
                                                {
                                                    doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
                                                    doorLock.localDoorLockAccountList.Remove(curDoorLockUser.ConnectedAccount);
                                                    var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
                                                    localDoorLockObj.UserID = curDoorLockUser.UserID;
                                                    doorLock.localDoorLockUserList.Remove(curUserId);
                                                    doorLock.ReSave();
                                                    RefreshList();
                                                }
                                            }
                                            else
                                            {
                                                //开关图标
                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                            }
                                        }
@@ -555,26 +521,71 @@
                                    }
                                    else
                                    {
                                        if (curDoorLockUser.UserID < 10)
                                        if (isSecondDel)
                                        {
                                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.OnlyBeDeletedOnTheDevice), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                            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);
                                                        RefreshList();
                                                    }
                                                }
                                                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
                                        {
                                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                            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);
                                }
                            }
                            else
                            {
                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
                            }
                        }
                        };
                    };
                };
                #endregion
                i++;
                    #endregion
                    i++;
                }
                frameLayoutRow.Height = i * Application.GetRealHeight(150);
            }
        }
@@ -761,266 +772,279 @@
            if (curAccountDoorLockUserList.Count == 0)
            {
                bodyView.Height = Application.GetRealHeight(0);
                entryStatusPic.Visible = true;
                btnPicTip.Visible = true;
                btnPicTip1.Visible = true;
                entryStatusPic.Height = Application.GetRealHeight(435);
                entryStatusPic.Width = Application.GetRealHeight(757);
                btnPicTip.Height = Application.GetRealHeight(98 / 2);
                btnPicTip1.Height = Application.GetRealHeight(98 / 2);
            }
            else
            {
                entryStatusPic.Visible = false;
                btnPicTip.Visible = false;
                btnPicTip1.Visible = false;
            }
            if (curAccountDoorLockUserList.Keys.Count == 0)
            {
                return;
            }
            int i = 0;
            foreach (var curUserId in curAccountDoorLockUserList.Keys)
            {
                var curDoorLockUser = curAccountDoorLockUserList[curUserId];
                if (curDoorLockUser.UnlockType != unlockMethod)
                entryStatusPic.Height = Application.GetRealHeight(0);
                entryStatusPic.Width = Application.GetRealHeight(0);
                btnPicTip.Height = Application.GetRealHeight(0);
                btnPicTip1.Height = Application.GetRealHeight(0);
                bodyView.Height = Application.GetRealHeight(1921 - 184 - 116);
                var frameLayoutRow = new FrameLayout()
                {
                    continue;
                }
                #region UI
                var rowFrameLayout = new RowLayout()
                {
                    Height = Application.GetRealHeight(127 + 23),
                    X = Application.GetRealWidth(58),
                    Width = Application.GetRealWidth(965),
                    LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
                    Height = Application.GetMinRealAverage(0),
                    BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                };
                bodyView.AddChidren(rowFrameLayout);
                var btnPicFrameLayout = new FrameLayout()
                bodyView.AddChidren(frameLayoutRow);
                int i = 0;
                foreach (var curUserId in curAccountDoorLockUserList.Keys)
                {
                    Width = Application.GetRealWidth(81),
                    Height = Application.GetRealHeight(81),
                    X = Application.GetRealWidth(40),
                    Y = Application.GetRealHeight(49),
                };
                rowFrameLayout.AddChidren(btnPicFrameLayout);
                var btnPic = new Button()
                {
                    Width = Application.GetRealWidth(84),
                    Height = Application.GetRealHeight(84),
                    UnSelectedImagePath = "DoorLock/DoorLockUserPic.png",
                };
                btnPicFrameLayout.AddChidren(btnPic);
                var btnDoorlockUser = new EditText()
                {
                    Width = Application.GetRealWidth(1080 - 173),
                    Height = Application.GetRealHeight(60),
                    X = Application.GetRealWidth(173),
                    Y = Application.GetRealHeight(35),
                    TextSize = 14,
                    PlaceholderTextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
                    TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                    TextAlignment = TextAlignment.CenterLeft,
                };
                rowFrameLayout.AddChidren(btnDoorlockUser);
                var btnMember = new Button()
                {
                    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(1080 - 173),
                    Height = Application.GetRealHeight(49),
                    X = Application.GetRealWidth(173),
                    Y = Application.GetRealHeight(95),
                    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);
                #endregion
                #region 数据处理
                int currentIndex = i;
                if (currentIndex == curAccountDoorLockUserList.Keys.Count - 1)
                {
                    rowFrameLayout.LineColor = Shared.Common.ZigbeeColor.Current.XMWhite;
                }
                switch (curDoorLockUser.UnlockType)
                {
                    case 0:
                        if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                        {
                            btnDoorlockUser.Text = curDoorLockUser.UserName;
                        }
                        else
                        {
                            btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID;
                        }
                        break;
                    case 3:
                        if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                        {
                            btnDoorlockUser.Text = curDoorLockUser.UserName;
                        }
                        else
                        {
                            btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID;
                        }
                        break;
                    case 15:
                        if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                        {
                            btnDoorlockUser.Text = curDoorLockUser.UserName;
                        }
                        else
                        {
                            btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID;
                        }
                        break;
                }
                if (curAccountObj.UserName == "" || curAccountObj.UserName == null)
                {
                    btnMember.Text = curAccountObj.Account;
                }
                else
                {
                    btnMember.Text = curAccountObj.UserName;
                }
                Action<Shared.View> action = async (obj) =>
                {
                    var refreshDoorLockData = new ZigBee.Device.DoorLock.RefreshDoorLockData();
                    if (UserCenterResourse.UserInfo.AuthorityNo != 1)
                    var curDoorLockUser = curAccountDoorLockUserList[curUserId];
                    if (curDoorLockUser.UnlockType != unlockMethod)
                    {
                        refreshDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
                        refreshDoorLockData.IsOtherAccountCtrl = true;
                        continue;
                    }
                    if (doorLock.DeviceAddr != null)
                    #region UI
                    var rowFrameLayout = new RowLayout()
                    {
                        refreshDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
                        Height = Application.GetRealHeight(127 + 23),
                        X = Application.GetRealWidth(58),
                        Y = i * Application.GetRealHeight(150),
                        Width = Application.GetRealWidth(965),
                        LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
                    };
                    frameLayoutRow.AddChidren(rowFrameLayout);
                    var btnPicFrameLayout = new FrameLayout()
                    {
                        Width = Application.GetRealWidth(81),
                        Height = Application.GetRealHeight(81),
                        X = Application.GetRealWidth(40),
                        Y = Application.GetRealHeight(49),
                    };
                    rowFrameLayout.AddChidren(btnPicFrameLayout);
                    var btnPic = new Button()
                    {
                        Width = Application.GetRealWidth(84),
                        Height = Application.GetRealHeight(84),
                        UnSelectedImagePath = "DoorLock/DoorLockUserPic.png",
                    };
                    btnPicFrameLayout.AddChidren(btnPic);
                    var btnDoorlockUser = new EditText()
                    {
                        Width = Application.GetRealWidth(1080 - 173),
                        Height = Application.GetRealHeight(60),
                        X = Application.GetRealWidth(173),
                        Y = Application.GetRealHeight(35),
                        TextSize = 14,
                        PlaceholderTextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
                        TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                        TextAlignment = TextAlignment.CenterLeft,
                    };
                    rowFrameLayout.AddChidren(btnDoorlockUser);
                    var btnMember = new Button()
                    {
                        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(1080 - 173),
                        Height = Application.GetRealHeight(49),
                        X = Application.GetRealWidth(173),
                        Y = Application.GetRealHeight(95),
                        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);
                    #endregion
                    #region 数据处理
                    int currentIndex = i;
                    if (currentIndex == curAccountDoorLockUserList.Keys.Count - 1)
                    {
                        rowFrameLayout.LineColor = Shared.Common.ZigbeeColor.Current.XMWhite;
                    }
                    refreshDoorLockData.OpenLockMode = curDoorLockUser.UnlockType;
                    refreshDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
                    refreshDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
                    refreshDoorLockData.UserIdRemarks = btnDoorlockUser.Text;
                    var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/UpdateDoorLock", refreshDoorLockData);
                    if (result != null)
                    switch (curDoorLockUser.UnlockType)
                    {
                        if (result.StateCode == "Success")
                        {
                            if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
                        case 0:
                            if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                            {
                                doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
                                var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
                                localDoorLockObj.UserID = curDoorLockUser.UserID;
                                localDoorLockObj.UnlockType = curDoorLockUser.UnlockType;
                                localDoorLockObj.EntryTime = curDoorLockUser.EntryTime;
                                localDoorLockObj.UserName = refreshDoorLockData.UserIdRemarks;
                                localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark;
                                doorLock.localDoorLockUserList.Add(curDoorLockUser.UserID, localDoorLockObj);
                                RefreshList();
                                btnDoorlockUser.Text = curDoorLockUser.UserName;
                            }
                            else
                            {
                                btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID;
                            }
                            break;
                        case 3:
                            if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                            {
                                btnDoorlockUser.Text = curDoorLockUser.UserName;
                            }
                            else
                            {
                                btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID;
                            }
                            break;
                        case 15:
                            if (curDoorLockUser.UserName != "" && curDoorLockUser.UserName != null)
                            {
                                btnDoorlockUser.Text = curDoorLockUser.UserName;
                            }
                            else
                            {
                                btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID;
                            }
                            break;
                    }
                    if (curAccountObj.UserName == "" || curAccountObj.UserName == null)
                    {
                        btnMember.Text = curAccountObj.Account;
                    }
                    else
                    {
                        btnMember.Text = curAccountObj.UserName;
                    }
                    Action<Shared.View> action = async (obj) =>
                    {
                        var refreshDoorLockData = new ZigBee.Device.DoorLock.RefreshDoorLockData();
                        if (UserCenterResourse.UserInfo.AuthorityNo != 1)
                        {
                            refreshDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
                            refreshDoorLockData.IsOtherAccountCtrl = true;
                        }
                        if (doorLock.DeviceAddr != null)
                        {
                            refreshDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint;
                        }
                        refreshDoorLockData.OpenLockMode = curDoorLockUser.UnlockType;
                        refreshDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString();
                        refreshDoorLockData.PrimaryId = curDoorLockUser.PrimaryId;
                        refreshDoorLockData.UserIdRemarks = btnDoorlockUser.Text;
                        var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/UpdateDoorLock", refreshDoorLockData);
                        if (result != null)
                        {
                            if (result.StateCode == "Success")
                            {
                                if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
                                {
                                    doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
                                    var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
                                    localDoorLockObj.UserID = curDoorLockUser.UserID;
                                    localDoorLockObj.UnlockType = curDoorLockUser.UnlockType;
                                    localDoorLockObj.EntryTime = curDoorLockUser.EntryTime;
                                    localDoorLockObj.UserName = refreshDoorLockData.UserIdRemarks;
                                    localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark;
                                    doorLock.localDoorLockUserList.Add(curDoorLockUser.UserID, localDoorLockObj);
                                    RefreshList();
                                }
                            }
                            else
                            {
                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                            }
                        }
                        else
                        {
                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                        }
                    }
                    else
                    {
                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                    }
                };
                btnDoorlockUser.EditorEnterAction += action;
                    };
                    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) =>
                    btnDel.MouseUpEventHandler += (sender, e) =>
                    {
                        if (e1)
                        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) =>
                        {
                            var passData = doorLock.SetUserAccessData(curDoorLockUser.UserID, ZigBee.Device.DoorLock.AccessType.DelCurrentUser);
                            var resultData = await doorLock.DefaultControlAsync(passData);
                            if (resultData != null && resultData.defaultControlResponseData != null)
                            if (e1)
                            {
                                if (resultData.defaultControlResponseData.status == 0)
                                var passData = doorLock.SetUserAccessData(curDoorLockUser.UserID, ZigBee.Device.DoorLock.AccessType.DelCurrentUser);
                                var resultData = await doorLock.DefaultControlAsync(passData);
                                if (resultData != null && resultData.defaultControlResponseData != null)
                                {
                                    var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
                                    if (UserCenterResourse.UserInfo.AuthorityNo != 1)
                                    if (resultData.defaultControlResponseData.status == 0)
                                    {
                                        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")
                                        var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData();
                                        if (UserCenterResourse.UserInfo.AuthorityNo != 1)
                                        {
                                            if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID))
                                            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")
                                            {
                                                doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID);
                                                var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
                                                localDoorLockObj.UserID = curDoorLockUser.UserID;
                                                doorLock.localDoorLockUserList.Remove(curUserId);
                                                RefreshList();
                                                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);
                                                    RefreshList();
                                                }
                                            }
                                            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
                                        {
                                            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);
                                            }
                                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                        }
                                    }
                                    else
                                    {
                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnDoorlockUser);
                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
                                    }
                                }
                                else
                                {
                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
                                }
                            }
                            else
                            {
                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel);
                            }
                        }
                        };
                    };
                };
                #endregion
                i++;
                    #endregion
                    i++;
                }
                frameLayoutRow.Height = i * Application.GetRealHeight(127 + 23);
            }
            bodyView.Height = i * Application.GetRealHeight(127 + 23);
        }
        /// <summary>