public AddFlowerViewModel() { flowerTypeRepository = new FlowerTypeRepository(); flowerRepository = new FlowerRepository(); flowerTypes = flowerTypeRepository.Gets(); flowers = flowerRepository.Gets(); flowerType = new FlowerType(); flower = new Flower(); AddFlower = new Command(Insert); }
void GetFlowersByTypeId() { if (SelectedFlowerType != null && SelectedFlowerType.Id > 0) { Flowers = flowerRepository.GetsByTypeId(SelectedFlowerType.Id); } else { Flowers = flowerRepository.Gets(); } }
public ViewResult Index() { var flowers = flowerRepository.Gets(); return(View(flowers)); }