public RecipeViewModel( IRecipeRepo recipeRepo , IMvxShareTask shareTask , IMvxMessenger messenger) { _recipeRepo = recipeRepo; _shareTask = shareTask; _messenger = messenger; var isIdle = this.WhenAny(x => x.IsCountingDown, x => !x.Value); _addActivityCommand = ReactiveCommand.Create(() => AddActivity()); _openCommand = ReactiveCommand.Create(() => Open()); _resetTimersCommand = ReactiveCommand.Create(() => ResetTimers()); _saveCommand = ReactiveCommand.Create(() => Save()); _shareCommand = ReactiveCommand.Create(() => Share()); _token = messenger.SubscribeOnMainThread <LoadRecipeMessage>(OnLoadRecipe); int nr = new Random().Next(0, 200); LoadRecipe(new Recipe { Name = "Stampot #" + nr }); }
public CategoriesController(IGenericRepo <Category> genericRepo, IRecipeRepo genericRecipeRepo, IMapper mapper, ILogger <CategoriesController> logger, IMemoryCache memoryCache, IHubContext <RepoHub> hubContext) { // _context = context; //hier geen context meer bij een repo pattern. this.genericRepo = genericRepo; this.genericRecipeRepo = genericRecipeRepo; this.mapper = mapper; this.logger = logger; this.memoryCache = memoryCache; this.hubContext = hubContext; }
public CookbookViewModel( IRecipeRepo recipeRepo, IMvxMessenger messenger) { _recipeRepo = recipeRepo; _messenger = messenger; _openRecipeCommand = ReactiveCommand.Create <Recipe>((r) => OpenRecipe(r)); ShowAllRecipes(); }
public StockViewModel(IIngredientRepo ingredientRepo, Business.IProductRepo productRepo, IRecipeRepo recipeRepo) { _ingredientRepo = ingredientRepo; _recipeRepo = recipeRepo; _productRepo = productRepo; SetProductsToggledCommand = new RelayCommand(SetProductsToggled); SetIngredientsToggledCommand = new RelayCommand(SetIngredientsToggled); AddDataCommand = new RelayCommand(AddData); EditIngredientCommand = new RelayCommand <Ingredient>(EditIngredient, (_) => SelectedIngredient != null); EditProductCommand = new RelayCommand <Product>(EditProduct, (_) => SelectedProduct != null); DeleteIngredientCommand = new RelayCommand <Ingredient>(DeleteIngredient, (_) => SelectedIngredient != null); DeleteProductCommand = new RelayCommand <Product>(DeleteProduct, (_) => SelectedProduct != null); }
public TableAddSaleProductViewModel(Data.Occupancy occupancy, Data.SubCategory subCategory, IRecipeRepo recipeRepo, IIngredientRepo ingredientRepo, IProductRepo productRepo, IOccupanciesRepo iOccupanciesRepo, ObservableCollection <SuggestedProducts> suggestedProducts) { _suggestedProducts = suggestedProducts; _occupancy = occupancy; _iOccupanciesRepo = iOccupanciesRepo; _iRecipeRepo = recipeRepo; _iIngredientRepo = ingredientRepo; _iProductRepo = productRepo; SubCategory = subCategory; MinusAmountCommand = new RelayCommand(MinusAmount); PlusAmountCommand = new RelayCommand(PlusAmount); SetSelectedProductCommand = new RelayCommand <Business.Product>(SetSelectedProduct); AddSaleCommand = new RelayCommand(AddSale, CanAddSale); ViewBackCommand = new RelayCommand(ViewBack); }
/// <summary> /// Constructor to add a product. /// Initializes the commands, sets the repositories. /// </summary> /// <param name="categoryRepo"><inheritdoc cref="_categoryRepo"/></param> /// <param name="recipeRepo"><inheritdoc cref="_recipeRepo"/></param> /// <param name="ingredientRepo"><inheritdoc cref="_ingredientRepo"/></param> public StockAddOrEditProductViewModel(ICategoryRepo categoryRepo, IRecipeRepo recipeRepo, IIngredientRepo ingredientRepo) { ActionToTake = "add"; _categoryRepo = categoryRepo; _recipeRepo = recipeRepo; _ingredientRepo = ingredientRepo; IsProductNotSet = true; SelectedRecipeItem = new RecipeItem(); SelectedRecipeItem.Product = new Product(); DeleteRecipeItemCommand = new RelayCommand <RecipeItem>(DeleteRecipeItem, (r) => r != null); BackToStockCommand = new RelayCommand(BackToStock); AddProductCommand = new RelayCommand(AddProduct); AddRecipeItemCommand = new RelayCommand <RecipeItem>(AddRecipeItem, (_) => { if (RecipeItemCanBeAdded()) { return(true); } return(false); }); }
public RecipesController(IMapper mapper, IGenericRepo <Category> categoryRepo, IRecipeRepo recipeRepo) { this.mapper = mapper; this.categoryRepo = categoryRepo; this.recipeRepo = recipeRepo; }
public TandooriRecipeController(IRecipeRepo repository) { repo = repository; }
public RecipesController(ILogger <RecipesController> logger, IRecipeRepo recipeRepo) { _logger = logger; _recipeRepo = recipeRepo; }
public AdminManageRecipeServices(IRecipeRepo recipeRepository) { _recipeRepository = recipeRepository; }
public RecipesController(IRecipeRepo recipeRepo) { _recipeRepo = recipeRepo; }
//Recipe Service is dependent on the IRecipeRepo public RecipeService(IRecipeRepo recipeRepository, IUserRepo userRepository, IIngredientService ingredientService) { _recipeRepository = recipeRepository; _userRepository = userRepository; _ingredientService = ingredientService; }
public RecipeService(IRecipeRepo recipeRepo) { _RecipeRepo = recipeRepo; }
public ViewResult InsertPage(Recipe recipe) { IRecipeRepo.AddRecipe(recipe); return(View("DataPage", IRecipeRepo.Recipes)); }
public AdminController(IRecipeRepo repo) { repository = repo; }
public RecipeController(IRecipeRepo recipeRepo, IMapper mapper) { _repository = recipeRepo; _mapper = mapper; }