| | |
| | | { |
| | | DB_ResidenceData.Instance.CurrentRegion.debugPerm = !DB_ResidenceData.Instance.CurrentRegion.debugPerm; |
| | | btnCommissioningAuthoritySwitchIcon.IsSelected = DB_ResidenceData.Instance.CurrentRegion.debugPerm; |
| | | var waitPage = new Loading(); |
| | | bodyView.AddChidren(waitPage); |
| | | waitPage.Start(""); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | var pack = new DAL.Server.HttpServerRequest().ChangeResidenceDebugPerm(DB_ResidenceData.Instance.CurrentRegion.debugPerm); |
| | | if(pack != null) |
| | | try |
| | | { |
| | | if(pack.Code == DAL.Server.StateCode.SUCCESS) |
| | | var pack = new DAL.Server.HttpServerRequest().ChangeResidenceDebugPerm(DB_ResidenceData.Instance.CurrentRegion.debugPerm); |
| | | if (pack != null) |
| | | { |
| | | DB_ResidenceData.Instance.CurrentRegion.debugStatus = DB_ResidenceData.Instance.CurrentRegion.debugPerm ? "SECONDARY_DEBUGGIN" : "Delivered"; |
| | | Application.RunOnMainThread(() => { |
| | | bodyView.RemoveAll(); |
| | | LoadPage(); |
| | | }); |
| | | if (pack.Code == DAL.Server.StateCode.SUCCESS) |
| | | { |
| | | DB_ResidenceData.Instance.CurrentRegion.debugStatus = DB_ResidenceData.Instance.CurrentRegion.debugPerm ? "SECONDARY_DEBUGGIN" : "Delivered"; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | bodyView.RemoveAll(); |
| | | LoadPage(); |
| | | }); |
| | | } |
| | | } |
| | | }catch(Exception ex) |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Hide(); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |