wxr
2020-04-21 f718d23a262a5a8e1241fdeaeb4153399f95e79d
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,37 +35,65 @@
                        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);
            };
@@ -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();
@@ -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();
            };
        }
    }
}