From 7b60238359b94125d591678eff105ae2bf47843f Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 15 十一月 2019 13:16:21 +0800
Subject: [PATCH] 2019.11.15
---
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs | 96 ++++++++++++++++++++++++++++++++++-------------
1 files changed, 69 insertions(+), 27 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs
index 7b5c669..4efd8ca 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs
@@ -69,18 +69,43 @@
{
foreach (var curDoorLockUser in getDoorLockInfoList.PageData)
{
+ if (curDoorLockUser.DoorLockLocalUserId == null || curDoorLockUser.DoorLockLocalUserId == "")
+ {
+ continue;
+ }
if (doorLock.localDoorLockUserList.ContainsKey(int.Parse(curDoorLockUser.DoorLockLocalUserId)))
{
- doorLock.localDoorLockUserList.Remove(int.Parse(curDoorLockUser.DoorLockLocalUserId));
+ var doorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
+ doorLockObj.UserID = int.Parse(curDoorLockUser.DoorLockLocalUserId);
+ doorLockObj.UnlockType = curDoorLockUser.OpenLockMode;
+ doorLockObj.PrimaryId = curDoorLockUser.Id;
+ doorLockObj.EntryTime = curDoorLockUser.EntryTime;
+ doorLockObj.UserName = curDoorLockUser.UserIdRemarks;
+ doorLockObj.ConnectedAccount = curDoorLockUser.CloudAccountId;
+ doorLock.localDoorLockUserList[int.Parse(curDoorLockUser.DoorLockLocalUserId)] = doorLockObj;
}
- var doorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
- doorLockObj.UserID = int.Parse(curDoorLockUser.DoorLockLocalUserId);
- doorLockObj.UnlockType = curDoorLockUser.OpenLockMode;
- doorLockObj.PrimaryId = curDoorLockUser.Id;
- doorLockObj.EntryTime = curDoorLockUser.EntryTime;
- doorLockObj.UserName = curDoorLockUser.UserIdRemarks;
- doorLockObj.ConnectedAccount = curDoorLockUser.CloudAccountId;
- doorLock.localDoorLockUserList.Add(int.Parse(curDoorLockUser.DoorLockLocalUserId), doorLockObj);
+ else
+ {
+ if (curDoorLockUser.DoorLockLocalUserId != null)
+ {
+ //闂ㄩ攣涓病鏈夛紝浜戠鏈夌敤鎴稩D锛屽悗鍙板垹闄や簯绔繖浜汭D
+ 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.DoorLockLocalUserId;
+ deleteDoorLockData.PrimaryId = curDoorLockUser.Id;
+ deleteDoorLockData.DelDoorLockDelType = 2;
+ var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/DelDoorLock", deleteDoorLockData);
+ int i = 0;
+ }
+ }
}
}
else
@@ -88,6 +113,7 @@
Application.RunOnMainThread(() =>
{
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+ return;
});
}
}
@@ -168,9 +194,18 @@
SideslipFramelayout();
};
+ var btnLine = new Button
+ {
+ Y = midTopFrameLayout.Bottom,
+ Height = 1,
+ BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTitleLine,
+ };
+ this.midFrameLayout.AddChidren(btnLine);
+
bodyView = new VerticalScrolViewLayout()
{
Y = midTopFrameLayout.Bottom,
+ Height = Application.GetRealHeight(1921 - 184 - 115 - 1),
};
this.midFrameLayout.AddChidren(bodyView);
@@ -537,35 +572,42 @@
addLockInfo.EntryTime = curDoorLockUser.EntryTime;
var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/AddDoorLock", addLockInfo);
- if (result != null && result.StateCode == "Success")
+ if (result != null)
{
- //瀛樿处鎴蜂俊鎭�
- //var resultList1 = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetCloudLocalAccountlist(doorLock, curAccountId);
- //瀛橀棬閿佷俊鎭�
- var resultList = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetCloudLocalDoorLocklist(doorLock, curAccountId);
- var uList = new List<int> { };
- if (resultList != null)
+ if (result.StateCode == "Success")
{
- foreach (var a in resultList.Keys)
+ //瀛橀棬閿佷俊鎭�
+ var resultList = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetCloudLocalDoorLocklist(doorLock, curAccountId);
+ var uList = new List<int> { };
+ if (resultList != null)
{
- uList.Add(a);
+ foreach (var a in resultList.Keys)
+ {
+ uList.Add(a);
+ }
}
- }
- var d = uList.Find((value) => { return value == doorLock.doorLockProgrammingEventNotificationCommand.UserID; });
- if (d != null)
- {
- RefreshList();
- flMain.RemoveFromParent();
- bottomFrameLayout.RemoveAll();
+ var d = uList.Find((value) => { return value == curDoorLockUser.UserID; });
+ if (d != null)
+ {
+ RefreshList();
+ flMain.RemoveFromParent();
+ bottomFrameLayout.RemoveAll();
+ }
+ else
+ {
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+ }
}
else
{
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish);
+ flMain.RemoveFromParent();
+ bottomFrameLayout.RemoveAll();
}
}
else
{
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish);
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish);
flMain.RemoveFromParent();
bottomFrameLayout.RemoveAll();
}
--
Gitblit v1.8.0