From 7167334c0e89dd84827d59e726123d14776e3a09 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 16 六月 2020 11:14:13 +0800
Subject: [PATCH] 2020-06-16-1

---
 HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/ResidentialManagePageBLL.cs |  204 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 204 insertions(+), 0 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/ResidentialManagePageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/ResidentialManagePageBLL.cs
index 157af17..f97f544 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/ResidentialManagePageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/ResidentialManagePageBLL.cs
@@ -1,4 +1,6 @@
 锘縰sing System;
+using System.Collections.Generic;
+using HDL_ON.Entity;
 using Shared;
 
 namespace HDL_ON.UI
@@ -9,6 +11,141 @@
         {
             LoadEvent_SkipFloorsPage();
             LoadEvent_SkipRoomsPage();
+            LoadEvent_EditResidencName();
+            LoadEvent_EditResidencAddress();
+        }
+
+        /// <summary>
+        /// 鍔犺浇淇敼浣忓畢鍚嶇О浜嬩欢
+        /// </summary>
+        void LoadEvent_EditResidencName()
+        {
+            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
+            {
+                Action<string> callBack = (str) =>
+                {
+                    if (string.IsNullOrEmpty(str))
+                    {
+                        new Tip()
+                        {
+                            CloseTime = 3,
+                            Text = Language.StringByID(StringId.HouseNameCannotBeEmpty),
+                            Direction = AMPopTipDirection.None,
+                        }.Show(bodyView);
+                        return;
+                    }
+                    DB_ResidenceData.residenceData.residecenInfo.Name = str;
+
+                    var waitPage = new Loading();
+                    waitPage.Start(Language.StringByID(StringId.PleaseWait));
+                    new System.Threading.Thread(() =>
+                    {
+                        try
+                        {
+                            var responsePack = new DAL.Server.HttpServerRequest().EditResidenceInfo();
+
+                            if (responsePack.StateCode.ToUpper() == "SUCCESS")
+                            {
+                                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);
+            };
+            btnResidenceName.MouseUpEventHandler = eventHandler;
+            btnEditResidenceNameIcon.MouseUpEventHandler = eventHandler;
+        }
+        /// <summary>
+        /// 鍔犺浇淇敼浣忓畢鍦板潃浜嬩欢
+        /// </summary>
+        void LoadEvent_EditResidencAddress()
+        {
+            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
+            {
+                Action<string> callBack = (str) =>
+                {
+                    DB_ResidenceData.residenceData.residecenInfo.Address = str;
+                    var responsePack = new DAL.Server.HttpServerRequest().EditResidenceInfo();
+
+                    if (responsePack.StateCode.ToUpper() == "SUCCESS")
+                    {
+                        btnResidenceAddress.Text = str;
+                        OnAppConfig.Instance.SaveUserConfig();
+                    }
+                    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);
+                        });
+                    }
+                };
+               // new PublicAssmebly().LoadDialog_EditParater(StringId.ResidenceName, DB_ResidenceData.residenceData.residecenInfo.Name, callBack);
+            };
+            btnResidenceAddress.MouseUpEventHandler = eventHandler;
+            btnLocationAddressIcon.MouseUpEventHandler = eventHandler;
         }
 
         /// <summary>
@@ -24,6 +161,7 @@
             };
             floorManagementRow.MouseUpEventHandler = eventHandler;
             btnFloorManagementSkinIcon.MouseUpEventHandler = eventHandler;
+            btnFloorManagementTitle.MouseUpEventHandler = eventHandler;
         }
 
         /// <summary>
@@ -39,6 +177,72 @@
             };
             roomManagementRow.MouseUpEventHandler = eventHandler;
             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