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

            return(View(flowers));
        }