From b8e94316e41eba72d927d5ca7d931b26139ee8ff Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 15 六月 2020 09:12:53 +0800
Subject: [PATCH] 20200612
---
HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/ResidentialManagePageBLL.cs | 153 +++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 123 insertions(+), 30 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/ResidentialManagePageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/ResidentialManagePageBLL.cs
index a678be5..ee8ce85 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/ResidentialManagePageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/ResidentialManagePageBLL.cs
@@ -24,7 +24,7 @@
{
Action<string> callBack = (str) =>
{
- if(string.IsNullOrEmpty(str))
+ if (string.IsNullOrEmpty(str))
{
new Tip()
{
@@ -35,39 +35,67 @@
return;
}
DB_ResidenceData.residenceData.residecenInfo.Name = str;
- var responsePack = new DAL.Server.HttpServerRequest().EditResidenceInfo();
- if (responsePack.StateCode == "Success")
+ var waitPage = new Loading();
+ waitPage.Start(Language.StringByID(StringId.PleaseWait));
+ new System.Threading.Thread(() =>
{
- btnResidenceName.Text = str;
- OnAppConfig.Instance.SaveUserConfig();
- }
- else
- {
- var tipStr = "Server erorr";
- switch (responsePack.StateCode)
+ try
{
- case "NoLogin":
- tipStr = Language.StringByID(StringId.InvalidLoginCertificate);
- break;
- case "ParameterOrEmpty":
+ var responsePack = new DAL.Server.HttpServerRequest().EditResidenceInfo();
- break;
- }
- Application.RunOnMainThread(() =>
- {
- //鎻愮ず鍘熷洜
- var tip = new Tip()
+ if (responsePack.StateCode.ToUpper() == "SUCCESS")
{
- Text = tipStr,
- CloseTime = 3,
- Direction = AMPopTipDirection.None
- };
- tip.Show(bodyView);
- });
- }
+ Application.RunOnMainThread(() =>
+ {
+ //MainPage.LoginUser.regionList.Find((obj) => obj.Name == btnResidenceName.Text.Trim()).Name = str;
+ btnResidenceName.Text = str;
+ upateResidenceName();
+ });
+ DB_ResidenceData.residenceData.residecenInfo.Name = str;
+ DB_ResidenceData.residenceData.SaveResidenceData();
+ }
+ else
+ {
+ var tipStr = "Server erorr";
+ switch (responsePack.StateCode)
+ {
+ case "NoLogin":
+ tipStr = Language.StringByID(StringId.InvalidLoginCertificate);
+ break;
+ case "ParameterOrEmpty":
+
+ break;
+ }
+ Application.RunOnMainThread(() =>
+ {
+ //鎻愮ず鍘熷洜
+ var tip = new Tip()
+ {
+ Text = tipStr,
+ CloseTime = 3,
+ Direction = AMPopTipDirection.None
+ };
+ tip.Show(bodyView);
+ });
+ }
+
+ }
+ catch (Exception ex)
+ {
+ MainPage.Log($"update user name error : {ex.Message}");
+ }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ waitPage.Hide();
+ });
+ }
+ })
+ { IsBackground = true }.Start();
};
- new PublicAssmebly().LoadDialog_EditParater(StringId.ResidenceName, DB_ResidenceData.residenceData.residecenInfo.Name, callBack);
+ new PublicAssmebly().LoadDialog_EditParater(StringId.ResidenceName, DB_ResidenceData.residenceData.residecenInfo.Name, callBack,StringId.HouseNameCannotBeEmpty,0,new List<string>());
};
btnResidenceName.MouseUpEventHandler = eventHandler;
btnEditResidenceNameIcon.MouseUpEventHandler = eventHandler;
@@ -84,7 +112,7 @@
DB_ResidenceData.residenceData.residecenInfo.Address = str;
var responsePack = new DAL.Server.HttpServerRequest().EditResidenceInfo();
- if (responsePack.StateCode == "Success")
+ if (responsePack.StateCode.ToUpper() == "SUCCESS")
{
btnResidenceAddress.Text = str;
OnAppConfig.Instance.SaveUserConfig();
@@ -114,7 +142,7 @@
});
}
};
- new PublicAssmebly().LoadDialog_EditParater(StringId.ResidenceName, DB_ResidenceData.residenceData.residecenInfo.Name, callBack);
+ new PublicAssmebly().LoadDialog_EditParater(StringId.ResidenceName, DB_ResidenceData.residenceData.residecenInfo.Name, callBack,StringId.HouseAddressCannotBeEmpty,0,new List<string>());
};
btnResidenceAddress.MouseUpEventHandler = eventHandler;
btnLocationAddressIcon.MouseUpEventHandler = eventHandler;
@@ -151,5 +179,70 @@
btnRoomManagementSkinIcon.MouseUpEventHandler = eventHandler;
btnRoomManagementTitle.MouseUpEventHandler = eventHandler;
}
+
+ /// <summary>
+ /// 寮�鍏充綇瀹呰皟璇曟潈闄�
+ /// </summary>
+ void LoadEvent_ChangeDebugPrivilege()
+ {
+ btnCommissioningAuthoritySwitchIcon.MouseUpEventHandler = (sender, e) =>
+ {
+ var debugPrivilege = btnCommissioningAuthoritySwitchIcon.IsSelected = !btnCommissioningAuthoritySwitchIcon.IsSelected;
+ //if (debugPrivilege)
+ //{
+ //}
+ //var waitPage = new Loading();
+ //waitPage.Start(Language.StringByID(StringId.PleaseWait));
+ //new System.Threading.Thread(() =>
+ //{
+ // try
+ // {
+ // var responsePack = new DAL.Server.HttpServerRequest().EditResidenceInfo();
+ // if (responsePack.DB_ResidenceData.residenceData.residecenInfo
+ // {
+ // Application.RunOnMainThread(() =>
+ // {
+ // });
+ // }
+ // else
+ // {
+ // var tipStr = "Server erorr";
+ // switch (responsePack.StateCode)
+ // {
+ // case "NoLogin":
+ // tipStr = Language.StringByID(StringId.InvalidLoginCertificate);
+ // break;
+ // case "ParameterOrEmpty":
+ // break;
+ // }
+ // Application.RunOnMainThread(() =>
+ // {
+ // //鎻愮ず鍘熷洜
+ // var tip = new Tip()
+ // {
+ // Text = tipStr,
+ // CloseTime = 3,
+ // Direction = AMPopTipDirection.None
+ // };
+ // tip.Show(bodyView);
+ // });
+ // }
+
+ // }
+ // catch (Exception ex)
+ // {
+ // MainPage.Log($"update user name error : {ex.Message}");
+ // }
+ // finally
+ // {
+ // Application.RunOnMainThread(() =>
+ // {
+ // waitPage.Hide();
+ // });
+ // }
+ //})
+ //{ IsBackground = true }.Start();
+ };
+ }
}
}
--
Gitblit v1.8.0