public async Task Initialize() { var reestrs = await _reestrDataService.GetReestrsByDate(DateTime.Now); ReestrSetting = await _reestrSettingDataService.GetReestrSetting(); MessageBus.Current.SendMessage(ReestrSetting.CurrentRecipe); var data = reestrs.Select(z => new ReestrObject(z)).ToArray(); FillCollection(data); }
private async Task Initialize() { var rs = await _reestrSettingDataService.GetReestrSetting(); var collection = await _recipeDataService.GetRecipes(); var customers = await _customerDataService.GetCustomers(); var barrelNumber = await _barrelStorageDataService.GetLastBarrelNumber(rs.CurrentRecipe); RecipesCollection = new ObservableCollection <Recipe>(collection); CustomersCollection = new ObservableCollection <Customer>(customers); ReestrSetting = rs ?? new ReestrSetting(); SelectedRecipe = RecipesCollection.FirstOrDefault(x => x.Id == ReestrSetting.RecipeId); SelectedCustomer = CustomersCollection.FirstOrDefault(x => x.Id == ReestrSetting.CustomerId); ReestrSetting.InitialBarrelNumber = barrelNumber + 1; }