|
|
|
|
|
|
|
|
private bool initializedBcTypes;
|
|
|
private bool initializedBcTypes;
|
|
|
private bool initializedBrands;
|
|
|
private bool initializedBrands;
|
|
|
private bool initializedSearchServices;
|
|
|
private bool initializedSearchServices;
|
|
|
private bool firstActivation;
|
|
|
|
|
|
public bool FirstActivation { get => firstActivation; }
|
|
|
|
|
|
private ColorItem[] colors;
|
|
|
private ColorItem[] colors;
|
|
|
private BicycleType[] bicycleTypes;
|
|
|
private BicycleType[] bicycleTypes;
|
|
|
private Brand[] brands;
|
|
|
private Brand[] brands;
|
|
|
|
|
|
|
|
|
this.bicycleRestService = _bicycleRestService;
|
|
|
this.bicycleRestService = _bicycleRestService;
|
|
|
this.i18n = _i18n;
|
|
|
this.i18n = _i18n;
|
|
|
this.onlineStatusProvider = _onlineStatusProvider;
|
|
|
this.onlineStatusProvider = _onlineStatusProvider;
|
|
|
this.firstActivation = true;
|
|
|
|
|
|
this.brands = Defaults.GetBrandDefaults(i18n).ToArray();
|
|
|
this.brands = Defaults.GetBrandDefaults(i18n).ToArray();
|
|
|
this.colors = Defaults.GetColorDefaults(i18n).ToArray();
|
|
|
this.colors = Defaults.GetColorDefaults(i18n).ToArray();
|
|
|
this.bicycleTypes = Defaults.GetBicycleTypeDefaults(i18n).ToArray();
|
|
|
this.bicycleTypes = Defaults.GetBicycleTypeDefaults(i18n).ToArray();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async Task SynchronizeMasterdata() {
|
|
|
public async Task SynchronizeMasterdata() {
|
|
|
if (onlineStatusProvider.Online) {
|
|
|
if (onlineStatusProvider.Online) {
|
|
|
try {
|
|
|
|
|
|
await SynchronizeColors();
|
|
|
|
|
|
await SynchronizeBcTypes();
|
|
|
|
|
|
await SynchronizeBrands();
|
|
|
|
|
|
await SynchronizeSearchServices();
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
this.firstActivation = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
await SynchronizeColors();
|
|
|
|
|
|
await SynchronizeBcTypes();
|
|
|
|
|
|
await SynchronizeBrands();
|
|
|
|
|
|
await SynchronizeSearchServices();
|
|
|
} else {
|
|
|
} else {
|
|
|
throw new Exception("No internet connection available!");
|
|
|
throw new Exception("No internet connection available!");
|
|
|
}
|
|
|
}
|