public AddFlowerViewModel() { flowerTypeRepository = new FlowerTypeRepository(); flowerRepository = new FlowerRepository(); flowerTypes = flowerTypeRepository.Gets(); flowers = flowerRepository.Gets(); flowerType = new FlowerType(); flower = new Flower(); AddFlower = new Command(Insert); }
public FlowerTypeAndFlowerMasterDetailViewModel() { flowerTypeRepository = new FlowerTypeRepository(); flowerRepository = new FlowerRepository(); FlowerTypes = new ObservableCollection <FlowerType>(); FlowerTypes = flowerTypeRepository.Gets(); if (FlowerTypes.Count > 0) { FlowerTypeSelected = FlowerTypes[0]; } }
void LoadData() { flowerTypeRepository = new FlowerTypeRepository(); flowerRepository = new FlowerRepository(); flowerTypeWithFlowers = new ObservableCollection <FlowerTypeWithFlower>(); ObservableCollection <FlowerType> list = flowerTypeRepository.Gets(); foreach (FlowerType item in list) { FlowerTypeWithFlower temp = new FlowerTypeWithFlower(); temp.FlowerType = item; temp.Flowers = flowerRepository.GetsByTypeId(item.Id); flowerTypeWithFlowers.Add(temp); } }
void LoadFlowerTypes() { flowerTypes = flowerTypeRepository.Gets(); }