Exemplo n.º 1
0
        public async void Intialize()
        {
            if (IsBusy)
            {
                return;
            }
            try
            {
                IsBusy = true;

                var wines = await WinesDb.GetAllWinesById(LockerMember.Id);

                if (!wines.Any())
                {
                    NoWinesFound = true;
                }
                else
                {
                    Wines.ReplaceRange(wines.Where(w => w.CheckedOutDate == null && (w.Quantity > 0)));
                    NoWinesFound = false;
                }
            }
            catch (Exception ex)
            {
                DependencyService.Get <ILogger>().Report(ex, "Method", "LoadWines");
                MessagingService.Current.SendMessage(MessageKeys.Error, ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Exemplo n.º 2
0
        public IActionResult WineList(int cost, int points)
        {
            var wineList = from wine in Wines.GetWineList()
                           where wine.Price <cost
                                             where wine.Points> points
                           select wine;

            return(View(wineList));
        }
Exemplo n.º 3
0
 void LoadWines()
 {
     Wines.Add(new Wine(1, "White Wine", "Model 2013", "$99", "4.5", "4.5", "img01.png"));
     Wines.Add(new Wine(2, "White Wine", "Model 2013", "$99", "4.5", "4.5", "img02.png"));
     Wines.Add(new Wine(3, "White Wine", "Model 2013", "$99", "4.5", "4.5", "img02.png"));
     Wines.Add(new Wine(4, "White Wine", "Model 2013", "$99", "4.5", "4.5", "img03.png"));
     Wines.Add(new Wine(5, "White Wine", "Model 2013", "$99", "4.5", "4.5", "img03.png"));
     Wines.Add(new Wine(6, "White Wine", "Model 2013", "$99", "4.5", "4.5", "img01.png"));
     Wines.Add(new Wine(7, "White Wine", "Model 2013", "$99", "4.5", "4.5", "img02.png"));
     Wines.Add(new Wine(8, "White Wine", "Model 2013", "$99", "4.5", "4.5", "img02.png"));
     Wines.Add(new Wine(9, "White Wine", "Model 2013", "$99", "4.5", "4.5", "img03.png"));
 }
Exemplo n.º 4
0
        public async Task Initialise()
        {
            var wines = await _wineService.GetWines();

            Wines.Clear();

            foreach (var wine in wines)
            {
                Wines.Add(new WineItemViewItem {
                    Name = wine.Name, Image = wine.ImagePath, Year = wine.VintageYear
                });
            }
        }
Exemplo n.º 5
0
 public bool CanDone()
 {
     return(_orderToFill.WinesCanFillOrder(SelectedWines) &&
            _orderToFill.RequiredWines.Count() == Wines.Count(p => p.IsSelected));
 }