private async Task Initialize() { var recipes = await _recipeDataService.GetRecipes(); _barrelStorages = await _barrelStorageDataService.GetBarrelStorages(); RecipesCollection = new ObservableCollection <Recipe>(recipes); BarrelStoragesCollection = new ObservableCollection <BarrelStorage>(_barrelStorages); }
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; }
private void LoadAllRecipes(object obj) { Recipes = new ObservableCollection <Recipe>(_dataService.GetRecipes()); }