public RecipeCreateSelectViewModel GetAll() { var ingRepo = new IngredientRepo(); var othRepo = new OthersRepo(); return(new RecipeCreateSelectViewModel(ingRepo.GetAll(), othRepo.GetAllMeasurements(), othRepo.GetAllBeerTypes())); }
public RecipeService() { rp = new RecipeRepo(); irp = new IngredientRepo(); mrp = new MemberRepo(); orp = new OthersRepo(); }
public int CheckAndCreateMeasurement(string MeasurementName) { var othRep = new OthersRepo(); var drivenM = othRep.GetMeasurementByName(MeasurementName); if (drivenM == null) { return(othRep.AddMeasurement(MeasurementName)); } return(drivenM.MeasurementTypeId); }
public int CheckAndCreateBeerType(string BeerTypeName) { var othRep = new OthersRepo(); var drivenBT = othRep.GetBeerTypetByName(BeerTypeName); if (drivenBT == null) { return(othRep.AddBeerType(BeerTypeName)); } return(drivenBT.BeerTypeId); }
public List <BeerType> GetBeerTypes() { var othRep = new OthersRepo(); return(othRep.GetAllBeerTypes()); }