Exemplo n.º 1
0
        public void AddFlower(Flower flower)
        {
            if (flower == null)
            {
                throw new ArgumentException($"Flower cannot be empty", nameof(flower));
            }

            Flowers.Add(flower);
        }
Exemplo n.º 2
0
        private void ReloadFlowers(List<Flower> flowers)
        {
            Flowers.Clear();
            foreach (var flower in flowers)
            {
                Flowers.Add(new FlowerItemViewModel
                {
                    Description = flower.Description,
                    FlowerId = flower.FlowerId,
                    Price = flower.Price,
                });

            }
        }
Exemplo n.º 3
0
 private void ReloadFlowers(List <Flower> flowers)
 {
     Flowers.Clear();
     //foreach (var flower in flowers)
     foreach (var flower in flowers.OrderBy(f => f.Description))
     {
         Flowers.Add(new FlowerItemViewModel
         {
             Description  = flower.Description,
             FlowerId     = flower.FlowerId,
             Price        = flower.Price,
             Image        = flower.Image,
             IsActive     = flower.IsActive,
             LastPurchase = flower.LastPurchase,
             Observation  = flower.Observation,
         });
     }
 }
Exemplo n.º 4
0
        private void OnAdd()
        {
            bool exists = false;

            foreach (Flower flower in Flowers)
            {
                if (flower.NameOfFlower.Equals(_enteredFlower))
                {
                    exists = true;
                    break;
                }
            }
            if (!exists)
            {
                Flowers.Add(new Flower {
                    NameOfFlower = _enteredFlower
                });
                EnteredFlower = string.Empty;
            }
        }
Exemplo n.º 5
0
 public void AddFlower(Flower flower)
 {
     Flowers.Add(flower);
 }
Exemplo n.º 6
0
 public void AddFlower(Flower f)
 {
     Flowers.Add(f);
 }
Exemplo n.º 7
0
 public void Add(Flower flower)
 {
     Flowers.Add(flower);
     Price += flower.Price;
 }