예제 #1
0
        private async Task Initialize()
        {
            var recipes = await _recipeDataService.GetRecipes();

            _barrelStorages = await _barrelStorageDataService.GetBarrelStorages();

            RecipesCollection        = new ObservableCollection <Recipe>(recipes);
            BarrelStoragesCollection = new ObservableCollection <BarrelStorage>(_barrelStorages);
        }
예제 #2
0
        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;
        }
예제 #3
0
 private void LoadAllRecipes(object obj)
 {
     Recipes = new ObservableCollection <Recipe>(_dataService.GetRecipes());
 }