public IngredientService(IIngredientRepo ingredientRepo, IMapper mapper, ILogger <IngredientService> logger, IUnitOfWork unitOfWork) { _ingredientRepo = ingredientRepo; _mapper = mapper; _logger = logger; _unitOfWork = unitOfWork; }
public DishService(IDishRepo dish, IIngredientRepo ingredient, ITagRepo tag, ApplicationDbContext context) { dishRepo = dish; ingredientRepo = ingredient; tagRepo = tag; dishRepo.Db = context; ingredientRepo.Db = context; tagRepo.Db = context; }
/// <summary> /// ViewModel accessed to add a new Ingredient to the database. /// </summary> /// <param name="ingredientRepo"><inheritdoc cref="_ingredientRepo"/></param> /// <param name="supplierRepo"><inheritdoc cref="_supplierRepo"/></param> public StockAddOrEditIngredientViewModel(IIngredientRepo ingredientRepo, ISupplierRepo supplierRepo) { _supplierRepo = supplierRepo; _ingredientRepo = ingredientRepo; AddIngredientCommand = new RelayCommand(AddIngredient, CanSave); AddSupplierCommand = new RelayCommand(AddSupplier); BackToStockCommand = new RelayCommand(BackToStock); Action = "add"; Ingredient = new Business.Ingredient(); }
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); }
public LocationController(ICustomerRepo customerRepo, ILocationRepo locationRepo, IOrderRepo orderRepo, ICupcakeRepo cupcakeRepo, IOrderItemRepo orderItemRepo, ILocationInventoryRepo locationInventoryRepo, IRecipeItemRepo recipeItemRepo, IIngredientRepo ingRepo, ILogger <LocationController> logger) { LocRepo = locationRepo; CustomerRepo = customerRepo; OrderRepo = orderRepo; CupcakeRepo = cupcakeRepo; OrderItemRepo = orderItemRepo; LocationInventoryRepo = locationInventoryRepo; RecipeItemRepo = recipeItemRepo; IngRepo = ingRepo; _logger = logger; }
/// <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 PizzaService(IPizzaRepo pizzaRepo, IIngredientRepo ingredientRepo, IMapper mapper) { _pizzaRepo = pizzaRepo; _ingredientRepo = ingredientRepo; _mapper = mapper; }
public IngredientService(IIngredientRepo ingredient) { ingredientRepo = ingredient; }
public IngredientServices(IIngredientRepo ingredientRepository) { _ingredientRepository = ingredientRepository; }
public IngredientsController(ILogger <IngredientsController> logger, IIngredientRepo ingredientRepo) { _logger = logger; _ingredientRepo = ingredientRepo; }
public IngredientService(IIngredientRepo ingredientRepo, IMapper mapper) { _ingredientRepo = ingredientRepo; _mapper = mapper; }