Exemplo n.º 1
0
 public FoodsController(IFoodRepository foodRepository, IMapper mapper, IUnitOfWork <ICommunityDbContext> unitOfWork, IDomainNotificationHandler domainNotificationHandler, IMediator mediator, ILogger <FoodsController> logger)
     : base(domainNotificationHandler, mediator, logger)
 {
     _foodRepository = foodRepository;
     _mapper         = mapper;
     _unitOfWork     = unitOfWork;
 }
Exemplo n.º 2
0
 public FoodController(IFoodRepository foodRepository, IUserRepository userRepository,
                       IWaterRepository waterRepository)
 {
     this.foodRepository  = foodRepository;
     this.userRepository  = userRepository;
     this.waterRepository = waterRepository;
 }
Exemplo n.º 3
0
        public LogDayViewModel(IFoodRepository foodRepository)
        {
            FoodRepository = foodRepository;

            Title = "";
            Items = new ObservableCollection <FoodDayGroup>();

            Date = DateTime.MinValue;

            BreakFast = new FoodDayGroup("Ontbijt", MealType.BreakFast);
            Items.Add(BreakFast);

            Lunch = new FoodDayGroup("Lunch", MealType.Lunch);
            Items.Add(Lunch);

            Diner = new FoodDayGroup("Diner", MealType.Diner);
            Items.Add(Diner);

            Snack = new FoodDayGroup("Snack", MealType.Snack);
            Items.Add(Snack);

            InitDayCommand   = new Command(async() => await ExecuteDayCommand());
            LoadItemsCommand = new Command(async() => await ExecuteLoadItemsCommand());

            MessagingCenter.Subscribe <LogAddToDayPage, FoodPerDay>(this, "AddItem", async(obj, item) =>
            {
                var newItem = item as FoodPerDay;

                await FoodRepository.SaveFoodForDay(newItem);
            });
        }
Exemplo n.º 4
0
 public OrderController(IOrderRepository orderRepository, IMenuItemRepository menuItemRepository, IFoodRepository foodRepository, IConfiguration configuration)
 {
     this._orderRepository    = orderRepository;
     this._menuItemRepository = menuItemRepository;
     this._foodRepository     = foodRepository;
     this._configuration      = configuration;
 }
Exemplo n.º 5
0
 public FoodController(IFoodFactory foodFactory, IMealFactory mealFactory, IFoodRepository repository, IMealRepository mealRepository)
 {
     this.repository = repository;
     this.mealRepository = mealRepository;
     this.foodFactory = foodFactory;
     this.mealFactory = mealFactory;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Constructor
 /// Initialized the repositories needed for all functions needed for controller
 /// </summary>
 /// <param name="recipeRepository">creates recipe repository through dependency injection</param>
 /// <param name="foodRepository">>creates food repository through dependency injection</param>
 /// <param name="ingredientRepository">>creates ingredient repository through dependency injection</param>
 /// <param name="pantryRepository">>creates pantry repository through dependency injection</param>
 public RecipeController(IRecipeRepository recipeRepository, IFoodRepository foodRepository, IIngredientRepository ingredientRepository, IPantryRepository pantryRepository)
 {
     this.ingredientRepository = ingredientRepository;
     this.recipeRepository     = recipeRepository;
     this.foodRepository       = foodRepository;
     this.pantryRepository     = pantryRepository;
 }
 public FoodsController(IFoodRepository foodRepository, IFoodListRepository foodListRepository,
                        IRandomNumberGenerator randomNumberGenerator)
 {
     _foodRepository        = foodRepository;
     _foodListRepository    = foodListRepository;
     _randomNumberGenerator = randomNumberGenerator;
 }
Exemplo n.º 8
0
        public LogAddViewModel(IFoodRepository foodRepository, FoodPerDay entry)
        {
            FoodRepository = foodRepository;
            Item           = entry;

            SelectableFoods = new ObservableCollection <Food>();

            MealTypes = new ObservableCollection <MealTypeItem>();
            MealTypes.Add(new MealTypeItem()
            {
                MealType = MealType.BreakFast, Name = "Ontbijt"
            });
            MealTypes.Add(new MealTypeItem()
            {
                MealType = MealType.Lunch, Name = "Lunch"
            });
            MealTypes.Add(new MealTypeItem()
            {
                MealType = MealType.Diner, Name = "Diner"
            });
            MealTypes.Add(new MealTypeItem()
            {
                MealType = MealType.Snack, Name = "Tussendoor"
            });

            SelectedMealType = MealTypes.First(f => f.MealType == entry.MealType);
        }
Exemplo n.º 9
0
 public ActiveStudent(ISettings settings, IStudentRepository studentRepository, IFoodRepository foodRepository, Lazy <IReserveLogRepository> reserveLogRepository)
 {
     _reserveLogRepository = reserveLogRepository;
     _foodRepository       = foodRepository;
     _settings             = settings;
     _studentRepository    = studentRepository;
 }
Exemplo n.º 10
0
 public CheckoutController(IOrderRepository orderRepository, IUserOrderRepository userOrderRepository, IOrderDetailRepository orderDetailRepository, IFoodRepository foodRepository)
 {
     _orderRepository       = orderRepository;
     _userOrderRepository   = userOrderRepository;
     _orderDetailRepository = orderDetailRepository;
     _foodRepository        = foodRepository;
 }
Exemplo n.º 11
0
 public UnitOfWork(FoodContext context, IFoodRepository foodRepository, IFoodCategoryRepository foodCategoryRepository,IPresetMealRepository presetMealRepository)
 {
     Context = context;
     FoodRepository = foodRepository;
     FoodCategoryRepository = foodCategoryRepository;
     PresetMealRepository = presetMealRepository;
 }
Exemplo n.º 12
0
 public FoodService()
 {
     if (Repository == null)
     {
         Repository = new FoodRepository();
     }
 }
Exemplo n.º 13
0
 public MealController(IFoodRepository foodRepository, IIngestionRepository ingestionRepository, IOneDayFoodRepository oneDayFoodRepository, IWeightOfFoodRepository weightOfFoodRepository)
 {
     _foodRepository         = foodRepository;
     _ingestionRepository    = ingestionRepository;
     _oneDayFoodRepository   = oneDayFoodRepository;
     _weightOfFoodRepository = weightOfFoodRepository;
 }
Exemplo n.º 14
0
        public MainWindow()
        {
            InitializeComponent();

            builder = new ContainerBuilder();
            builder.RegisterModule(new DataModule("ExamDiaryDB_AndrianovaConnectionString"));

            builder.RegisterType <EFContext>().As <IEFContext>();
            builder.RegisterType <FoodRepository>().As <IFoodRepository>();
            builder.RegisterType <MyPlateRepository>().As <IMyPlateRepository>();
            builder.RegisterType <PlateFoodRecordRepository>().As <IPlateFoodRecordRepository>();
            Container = builder.Build();

            foodRep    = Container.Resolve <IFoodRepository>();
            myplateRep = Container.Resolve <IMyPlateRepository>();
            platefoodrecordRepositoryRep = Container.Resolve <IPlateFoodRecordRepository>();

            if (checkNet() == true)
            {
                ProductComboBox.ItemsSource = GetData();
                List <Food> list = GetData();
                foreach (var p in list)
                {
                    foodlist.Add(p);
                }
                MealTimePicker.SelectedDate = DateTime.Now;
            }
            else
            {
                MessageBox.Show("Невозможно открыть программу! Отсутствует подключение к сети Интернет!");
                System.Windows.Application.Current.Shutdown();
            }
        }
 public IngredientsController(IProductRepository repository, IFoodRepository foodRepository,
                              IHubContext <FoodHub> hubContext)
 {
     _repository     = repository;
     _foodRepository = foodRepository;
     _hubContext     = hubContext;
 }
Exemplo n.º 16
0
        public CartService(IFoodRepository foodRepository, IUserRepository userRepository, DtoModelMapper dtoModelMapper)
        {
            _userRepository = userRepository;
            _foodRepository = foodRepository;

            _dtoModelMapper = dtoModelMapper;
        }
Exemplo n.º 17
0
 public FoodController(IFoodRepository food, ILogger <FoodController> logger, IMapper mapper, IUrlHelper urlHelper)
 {
     _food      = food;
     _mapper    = mapper;
     _logger    = logger;
     _urlHelper = urlHelper;
 }
Exemplo n.º 18
0
        public CartService()
        {
            _userRepository = new UserRepository(DataStore.Instance.State.Users);
            _foodRepository = new FoodRepository(DataStore.Instance.State.Foods);

            _dtoModelMapper = new DtoModelMapper();
        }
Exemplo n.º 19
0
        public DetalesAndRecommendationsWindow(SqlDateTime t)
        {
            InitializeComponent();
            _t = t;

            builder = new ContainerBuilder();
            builder.RegisterModule(new DataModule("ExamDiaryDB_AndrianovaConnectionString"));

            builder.RegisterType <EFContext>().As <IEFContext>();
            builder.RegisterType <FoodRepository>().As <IFoodRepository>();
            builder.RegisterType <MyPlateRepository>().As <IMyPlateRepository>();
            builder.RegisterType <PlateFoodRecordRepository>().As <IPlateFoodRecordRepository>();
            Container = builder.Build();

            foodRep    = Container.Resolve <IFoodRepository>();
            myplateRep = Container.Resolve <IMyPlateRepository>();
            platefoodrecordRepositoryRep = Container.Resolve <IPlateFoodRecordRepository>();


            YourHeightTextBox.Text = user._Height.ToString();
            YourWeightTextBox.Text = user._Weight.ToString();
            YourAgeTextBox.Text    = user._Age.ToString();
            YourCcal.Text          = user._Ccal.ToString();
            if (user._Gender == true)
            {
                radioButtonFemale.IsChecked = true;
            }
            else
            {
                radioButtonMale.IsChecked = true;
            }
        }
        /// <summary>
        /// Counstructor
        /// </summary>
        /// <param name="fastFoodDbContext">FastFoodDbContext - Injection</param>
        /// <param name="foodRepository">FoodRepository - Injection</param>
        /// <param name="paymentRepository">PaymentRepository - Injection</param>
        /// <param name="userRepository">UserRepository - Injection</param>
        /// <param name="paymentMethodRepository">PaymentMethodRepository - Injection</param>
        /// <param name="sentEmailRepository">SentEmailRepository - Injection</param>
        /// <param name="sentMessageRepository">SentMessageRepository - Injection</param>
        /// <param name="authorizationRepository">AuthorizationRepository - Injection</param>
        public UnitOfWork
        (
            FastFoodDbContext fastFoodDbContext,
            IFoodRepository foodRepository,
            IPaymentRepository paymentRepository,
            IUserRepository userRepository,
            IPaymentMethodRepository paymentMethodRepository,
            ISentEmailRepository sentEmailRepository,
            ISentMessageRepository sentMessageRepository,
            IAuthorizationRepository authorizationRepository
        )
        {
            _fastFoodDbContext = fastFoodDbContext;

            FoodRepository          = foodRepository;
            PaymentRepository       = paymentRepository;
            UserRepository          = userRepository;
            PaymentMethodRepository = paymentMethodRepository;
            SentEmailRepository     = sentEmailRepository;
            SentMessageRepository   = sentMessageRepository;
            AuthorizationRepository = authorizationRepository;

            // Setup the DbContext
            FoodRepository.DbContext          = _fastFoodDbContext;
            PaymentRepository.DbContext       = _fastFoodDbContext;
            UserRepository.DbContext          = _fastFoodDbContext;
            PaymentMethodRepository.DbContext = _fastFoodDbContext;
            SentEmailRepository.DbContext     = _fastFoodDbContext;
            SentMessageRepository.DbContext   = _fastFoodDbContext;
            AuthorizationRepository.DbContext = _fastFoodDbContext;
        }
Exemplo n.º 21
0
 public MealService(IFoodRepository foodRepository, IMealRepository mealRepository,
                    IUserRepository userRepository, IUnitOfWork unitOfWork)
 {
     this.unitOfWork     = unitOfWork;
     this.foodRepository = foodRepository;
     this.mealRepository = mealRepository;
     this.userRepository = userRepository;
 }
Exemplo n.º 22
0
        public StatsViewModel(IOrderService orderService, IFoodRepository foodRepository)
        {
            var orders = orderService.GetPastOrders().Result;

            _orderedFood = orders.Select(order => foodRepository.GetFoodInfo(order.FoodId)).ToList();
            CalculateSpendStats();
            CalculateHealthStats();
        }
Exemplo n.º 23
0
 public RestaurantsController(IFoodTypeRepository foodType, IFoodCategoryRepository foodCategory, IRestaurantRepository restaurant, IRestaurantFoodRepository restaurantFood, IFoodRepository food)
 {
     _foodType       = foodType;
     _foodCategory   = foodCategory;
     _restaurant     = restaurant;
     _restaurantFood = restaurantFood;
     _food           = food;
 }
 public FoodsController(IUrlHelper urlHelper, IFoodRepository foodRepository,
                        IHubContext <FoodHub> hubContext, IHttpContextAccessor accessor)
 {
     _foodRepository = foodRepository;
     _hubContext     = hubContext;
     _urlHelper      = urlHelper;
     _accessor       = accessor;
 }
Exemplo n.º 25
0
 public MealCommandHandler(IMealRepository mealRepository, IFoodRepository foodRepository, IMapper mapper, IIdentityService identityService, IMediator mediator, IUnitOfWork <ICommunityDbContext> unitOfWork, ILogger <MealCommandHandler> logger)
     : base(identityService, mediator, unitOfWork, logger)
 {
     _mealRepository   = mealRepository;
     _foodRepository   = foodRepository;
     _mapper           = mapper;
     _currentProfileId = GetCurrentProfileId();
 }
Exemplo n.º 26
0
 public FoodService(IFoodRepository foodRepository,
                    ILogger <FoodService> logger,
                    IMapper mapper)
 {
     _foodRepository = foodRepository;
     _logger         = logger;
     _mapper         = mapper;
 }
Exemplo n.º 27
0
 public FoodsController(
     IUrlHelper urlHelper,
     IFoodRepository foodRepository,
     IMapper mapper)
 {
     _foodRepository = foodRepository;
     _mapper         = mapper;
     _urlHelper      = urlHelper;
 }
Exemplo n.º 28
0
 public FoodService(IFoodRepository foodRepository,
                    IMessageHandler feedbackHandler, IMessageSerializer messageSerializer,
                    IQueryHelper queryHelper)
 {
     _foodRepository      = foodRepository;
     this.FeedbackHandler = feedbackHandler;
     _messageSerializer   = messageSerializer;
     _queryHelper         = queryHelper;
 }
Exemplo n.º 29
0
 public SesshinService(ISesshinRepository sesshinRepository,
                       IFoodRepository foodRepository,
                       IDayOfSesshinRepository dayOfSesshinRepository,
                       IUnitOfWork unitOfWork)
     : base(sesshinRepository, unitOfWork)
 {
     _foodRepository         = foodRepository;
     _dayOfSesshinRepository = dayOfSesshinRepository;
 }
 public FoodItemsController(
     IFoodRepository foodRepository,
     IHubContext <ChatHub> hubContext,
     IMapper mapper)
 {
     _foodRepository = foodRepository;
     _chatHubContext = hubContext;
     _mapper         = mapper;
 }
Exemplo n.º 31
0
 public DietService(
     IFoodRepository foodRepository,
     IPlanRepository planRepository,
     IProfileRepository profileRepository)
 {
     this.foodRepository    = foodRepository;
     this.planRepository    = planRepository;
     this.profileRepository = profileRepository;
 }
Exemplo n.º 32
0
 public FoodManager(IFoodRepository foodRepository,
                    IRestaurantRepository restaurantRepository,
                    IUserRepository userRepository,
                    IHttpContextAccessor httpContext)
 {
     this.foodRepository       = foodRepository;
     this.restaurantRepository = restaurantRepository;
     this.userRepository       = userRepository;
     this.httpContext          = httpContext;
 }
Exemplo n.º 33
0
        public Food RetrieveCompleteFood(int id, IFoodRepository repository)
        {
            //retrieve from cache
            Food food = FoodClient.RetrieveCompleteFood(id);
            if (food == null)
            {
                //retrieve from database
                food = repository.RetrieveCompleteFood(id);
                //save to cache
                FoodClient.SaveCompleteFood(food, id);
            }

            return food;
        }
Exemplo n.º 34
0
        public IList<Food> RetrieveFoods(IFoodRepository repository)
        {
            //retrieve from cache
            IList<Food> foods = FoodClient.RetrieveFoods();
            if (foods == null)
            {
                //retrieve from database
                foods = repository.RetrieveFoods();
                //save to cache
                FoodClient.SaveFoods(foods);
            }

            return foods;
        }
Exemplo n.º 35
0
 public CartController(IFoodRepository repository)
 {
     _repository = repository;
 }
 public NavigationController(IFoodRepository repository)
 {
     this._repository = repository;
 }
 public FoodItemsController(IFoodRepository foodRepository, IConnectionManager connectionManager, ITimerService timerService)
 {
     _foodRepository = foodRepository;
     _coolMessageHubContext = connectionManager.GetHubContext<CoolMessagesHub>();
     timerService.TimerElapsed += _timerService_TimerElapsed;
 }
 public FoodLogic(IUnitOfWork unit, IFoodRepository repo, ITeamLogic teamLogic)
 {
     this.Unit = unit;
     this.Repo = repo;
     this.TeamLogic = teamLogic;
 }