| | |
| | | { |
| | | Action<string> callBack = (str) => |
| | | { |
| | | if(string.IsNullOrEmpty(str)) |
| | | if (string.IsNullOrEmpty(str)) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | 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); |
| | | }; |
| | |
| | | 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(); |
| | |
| | | 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(); |
| | | }; |
| | | } |
| | | } |
| | | } |