Пример #1
0
        public RecipeCreateSelectViewModel GetAll()
        {
            var ingRepo = new IngredientRepo();
            var othRepo = new OthersRepo();

            return(new RecipeCreateSelectViewModel(ingRepo.GetAll(), othRepo.GetAllMeasurements(), othRepo.GetAllBeerTypes()));
        }
Пример #2
0
 public RecipeService()
 {
     rp  = new RecipeRepo();
     irp = new IngredientRepo();
     mrp = new MemberRepo();
     orp = new OthersRepo();
 }
Пример #3
0
        public int CheckAndCreateMeasurement(string MeasurementName)
        {
            var othRep  = new OthersRepo();
            var drivenM = othRep.GetMeasurementByName(MeasurementName);

            if (drivenM == null)
            {
                return(othRep.AddMeasurement(MeasurementName));
            }
            return(drivenM.MeasurementTypeId);
        }
Пример #4
0
        public int CheckAndCreateBeerType(string BeerTypeName)
        {
            var othRep   = new OthersRepo();
            var drivenBT = othRep.GetBeerTypetByName(BeerTypeName);

            if (drivenBT == null)
            {
                return(othRep.AddBeerType(BeerTypeName));
            }
            return(drivenBT.BeerTypeId);
        }
Пример #5
0
        public List <BeerType> GetBeerTypes()
        {
            var othRep = new OthersRepo();

            return(othRep.GetAllBeerTypes());
        }