From 17c8d94258154ab2e9f6d2cf821202c873b9f118 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 16 十二月 2020 15:39:15 +0800
Subject: [PATCH] 22222
---
HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPageBLL.cs | 286 ++++++++++++++++++++++++++++----------------------------
1 files changed, 143 insertions(+), 143 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPageBLL.cs
index 0c37300..eba16f4 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPageBLL.cs
@@ -24,127 +24,7 @@
{
if (titleId == StringId.PermissionToUse)//浠庝釜浜轰腑蹇冭繘鍏ュ崟鐙垎浜�
{
- new Thread(() =>
- {
- try
- {
- bool result = false;
- Action act = () => { };
- Application.RunOnMainThread(() =>
- {
- act = new PublicAssmebly().TipLoadingMsgDialog(Language.StringByID(StringId.SavingPleaseWait));
- });
-
- //1.绠$悊鎴块棿鍒嗕韩
- if (funs_New != null && funs_New.Count > 0)
- {
- //鍒嗕韩璁惧澶т簬0
- var success = ShareRoom();
- if (success)
- {
- Utlis.WriteLine("娣诲姞鎴块棿鍒嗕韩鎴愬姛");
- }
- else
- {
- Utlis.WriteLine("娣诲姞鎴块棿鍒嗕韩澶辫触");
- }
- }
- else
- {
- var success = DeleteShareRoom();
- if (success)
- {
- Utlis.WriteLine("鍒犻櫎鎴块棿鍒嗕韩鎴愬姛");
- }
- else
- {
- Utlis.WriteLine("鍒犻櫎鎴块棿鍒嗕韩澶辫触");
- }
- }
-
- //2.鎵归噺鍒犻櫎鍒嗕韩
- var deleteShareObj = new DeleteShareObj()
- {
- shareDatas = funs_Del,
- homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID,
- };
- LoadMethod_DelSharedData(deleteShareObj);
-
- //3.鎵归噺涓婁紶
- var funs_NeedAdd = new List<ShareData>();
- foreach (var f in funs_New)
- {
- var sd = funs.Find((obj) => obj.shareTypeId == f.shareTypeId);
- //濡傛灉璇ュ姛鑳藉凡缁忓垎浜紝涓嶇敤鍒嗕韩
- if (null == sd)
- {
- funs_NeedAdd.Add(f);
-
- }
- }
-
- List<string> childAccountIds = new List<string>();
- childAccountIds.Add(memberInfo.childAccountId);
- var addShareObj = new AddShareObj()
- {
- shareDatas = funs_NeedAdd,
- childAccountIds = childAccountIds,
- homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID,
- };
- result = LoadMethod_AddShareData(addShareObj);
-
- if (!result)
- {
- Application.RunOnMainThread(() =>
- {
- new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.FunctionSharingFailed), true);
- });
- }
-
-
- Application.RunOnMainThread(() =>
- {
- act();
- });
- if (result)
- {
- //4.1绠$悊鏈�缁堢殑鍒嗕韩鍒楄〃
- var funs_final = new List<ShareData>();
- funs_final.AddRange(funs);
- //4.2绉婚櫎鍒犻櫎鐨�
- foreach (var share_d in funs_Del)
- {
- var sd = funs_final.Find((obj) => obj.shareTypeId == share_d.shareTypeId);
- //濡傛灉璇ュ姛鑳藉凡缁忓垎浜紝涓嶇敤鍒嗕韩
- if (null != sd)
- {
- funs_final.Remove(share_d);
- }
- }
- //4.3娣诲姞鏂板鐨�
- funs_final.AddRange(funs_NeedAdd);
-
- Application.RunOnMainThread(() =>
- {
- new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.FunctionSharingSucceeded), true);
- memberInfo.CurResidenceShareDate = funs_final;
- });
- Thread.Sleep(1600);
- Application.RunOnMainThread(() =>
- {
- //MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 1);
- MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
- refreshFunctionCount?.Invoke(funs_New.Count.ToString());
- });
- }
- }
- catch { }
- finally
- {
-
- }
- })
- { IsBackground = true }.Start();
+ UploadShareDeviceList();
}
else
{
@@ -156,6 +36,133 @@
//MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
}
};
+ }
+
+ /// <summary>
+ /// 绠$悊璁惧鍒嗕韩
+ /// 2020-12-08 1.澧炲姞鍒嗕韩璁惧鐨勬椂鍊欙紝鍒ゆ柇褰撳墠鎴块棿鍒嗕韩璁惧鎬绘暟锛屼粠鑰屽喅瀹氭槸鍚﹂渶瑕佸鍔犳垨鑰呯Щ闄ゆ埧闂村垎浜�
+ /// </summary>
+ void UploadShareDeviceList()
+ {
+ new Thread(() =>
+ {
+ try
+ {
+ bool result = false;
+ Action act = () => { };
+ Application.RunOnMainThread(() =>
+ {
+ act = new PublicAssmebly().TipLoadingMsgDialog(Language.StringByID(StringId.SavingPleaseWait));
+ });
+
+ //1.绠$悊鏈�缁堝睘浜庢埧闂寸殑鍒嗕韩
+ if (funs_New != null && funs_New.Count > 0)
+ {
+ //鏈�缁堝睘浜庢埧闂寸殑鍒嗕韩澶т簬0
+ var success = ShareRoom();
+ if (success)
+ {
+ Utlis.WriteLine("娣诲姞鎴块棿鍒嗕韩鎴愬姛");
+ }
+ else
+ {
+ Utlis.WriteLine("娣诲姞鎴块棿鍒嗕韩澶辫触");
+ }
+ }
+ else
+ {
+ var success = DeleteShareRoom();
+ if (success)
+ {
+ Utlis.WriteLine("鍒犻櫎鎴块棿鍒嗕韩鎴愬姛");
+ }
+ else
+ {
+ Utlis.WriteLine("鍒犻櫎鎴块棿鍒嗕韩澶辫触");
+ }
+ }
+
+ //2.鎵归噺鍒犻櫎鍒嗕韩
+ var deleteShareObj = new DeleteShareObj()
+ {
+ shareDatas = funs_Del,
+ homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
+ };
+ LoadMethod_DelSharedData(deleteShareObj);
+
+ //3.鎵归噺涓婁紶
+ var funs_NeedAdd = new List<ShareData>();
+ foreach (var f in funs_New)
+ {
+ var sd = funs.Find((obj) => obj.shareTypeId == f.shareTypeId);
+ //濡傛灉璇ュ姛鑳藉凡缁忓垎浜紝涓嶇敤鍒嗕韩
+ if (null == sd)
+ {
+ funs_NeedAdd.Add(f);
+ }
+ }
+ //3.1 鎻愪氦璇锋眰
+ List<string> childAccountIds = new List<string>();
+ childAccountIds.Add(memberInfo.childAccountId);
+ var addShareObj = new AddShareObj()
+ {
+ shareDatas = funs_NeedAdd,
+ childAccountIds = childAccountIds,
+ homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
+ };
+ result = LoadMethod_AddShareData(addShareObj);
+
+ if (!result)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.FunctionSharingFailed), true);
+ });
+ }
+
+ Application.RunOnMainThread(() =>
+ {
+ act();
+ });
+ if (result)
+ {
+ //4.1绠$悊鏈�缁堢殑鍒嗕韩鍒楄〃
+ var funs_final = new List<ShareData>();
+ funs_final.AddRange(funs);
+ //4.2绉婚櫎鍒犻櫎鐨�
+ foreach (var share_d in funs_Del)
+ {
+ var sd = funs_final.Find((obj) => obj.shareTypeId == share_d.shareTypeId);
+ //濡傛灉璇ュ姛鑳藉凡缁忓垎浜紝涓嶇敤鍒嗕韩
+ if (null != sd)
+ {
+ funs_final.Remove(share_d);
+ }
+ }
+ //4.3娣诲姞鏂板鐨�
+ funs_final.AddRange(funs_NeedAdd);
+
+ Application.RunOnMainThread(() =>
+ {
+ new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.FunctionSharingSucceeded), true);
+ memberInfo.CurResidenceShareDate = funs_final;
+ });
+ Thread.Sleep(1600);
+ Application.RunOnMainThread(() =>
+ {
+ //MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 1);
+ MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
+ refreshFunctionCount?.Invoke(funs_New.Count.ToString());
+ });
+ }
+ }
+ catch { }
+ finally
+ {
+
+ }
+ })
+ { IsBackground = true }.Start();
}
/// <summary>
@@ -202,7 +209,8 @@
bool ShareRoom()
{
var roomList = new List<ShareData>();
- roomList.Add(new ShareData() {
+ roomList.Add(new ShareData()
+ {
shareType = ShareType.ROOM.ToString(),
shareTypeId = room.roomId
});
@@ -211,7 +219,7 @@
var addShareObj = new AddShareObj()
{
childAccountIds = childAccountIds,
- homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID,
+ homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
shareDatas = roomList
};
var responePack = new HttpServerRequest().AddShareData(addShareObj);
@@ -241,7 +249,7 @@
var deleteShareObj = new DeleteShareObj()
{
shareDatas = roomList,
- homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID,
+ homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
};
var responePack = new HttpServerRequest().DeleteShareData(deleteShareObj);
if (responePack.Code != StateCode.SUCCESS)
@@ -254,22 +262,13 @@
}
}
- ///// <summary>
- ///// 鏇存柊鍏变韩鏁版嵁
- ///// </summary>
- //bool EditShareData(ShareData sd)
- //{
- // var responePack = new HttpServerRequest().EditShareData(sd);
- // if (responePack.Code == StateCode.SUCCESS)
- // {
- // return true;
- // }
- // else
- // {
- // return false;
- // }
- //}
-
+ /// <summary>
+ /// LoadMethod_SharedDataChange
+ /// </summary>
+ /// <param name="btnChoose"></param>
+ /// <param name="btn2"></param>
+ /// <param name="btn3"></param>
+ /// <param name="function"></param>
void LoadMethod_SharedDataChange(Button btnChoose, Button btn2, FrameLayout btn3, Function function)
{
EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
@@ -295,7 +294,7 @@
{
var newSd = new ShareData();
newSd.shareTypeId = function.deviceId;
-
+
funs_New.Add(newSd);
}
btnChooseAll.IsSelected = true;
@@ -335,6 +334,7 @@
btn2.MouseUpEventHandler = eventHandler;
btn3.MouseUpEventHandler = eventHandler;
}
+
/// <summary>
/// 鍏ㄩ�夋寜閽偣鍑讳簨浠�
/// </summary>
@@ -347,7 +347,7 @@
funs_New = new List<ShareData>();
if (btnChooseAll.IsSelected)
{
- foreach(var f in room.GetRoomFunctions(false))
+ foreach (var f in room.GetRoomFunctions(false))
{
var ssdd = new ShareData();
ssdd.shareTypeId = f.deviceId;
@@ -356,7 +356,7 @@
}
else
{
- foreach(var f in room.GetRoomFunctions(false))
+ foreach (var f in room.GetRoomFunctions(false))
{
var sd = funs.Find((obj) => obj.shareTypeId == f.deviceId);
if (sd != null)
--
Gitblit v1.8.0