Ejemplo n.º 1
0
 public static ShoppingList GetShoppingList(int id, string name, int addedBy, ShoppingListStatus status = ShoppingListStatus.Active)
 {
     return(new ShoppingList
     {
         Id = id,
         AddDate = DateTime.Now,
         AddedById = addedBy,
         Status = status,
         Name = name
     });
 }
Ejemplo n.º 2
0
        private void SwitchTabs(ShoppingListStatus status)
        {
            if (status == ShoppingListStatus.Active && ShowActive)
            {
                return;
            }

            if (status == ShoppingListStatus.Closed && ShowClosed)
            {
                return;
            }

            ShowActive = !ShowActive;
            ShowClosed = !ShowClosed;

            SwitchTabsStyles(ShowActive, ActiveTabPanel, ActiveTabLabel);
            SwitchTabsStyles(ShowClosed, ClosedTabPanel, ClosedTabLabel);
        }
 public async Task <IList <ShoppingList> > GetAllShoppingListWithProductsAsync(ShoppingListStatus status)
 {
     return(status == ShoppingListStatus.Active
                         ? await _shoppingListDao.GetActiveShoppingListAsync()
                         : await _shoppingListDao.GetClosedShoppingListAsync());
 }
Ejemplo n.º 4
0
        public async Task <IList <ShoppingListVm> > GetAllShoppingListWithProductsAsync(ShoppingListStatus status)
        {
            var shoppingList = await _shoppingListRepository.GetAllShoppingListWithProductsAsync(status);

            var products = await _shoppingListRepository.GetAllProductsAsync();

            return(shoppingList.Select(x => new ShoppingListVm(x)).ToList());
        }
 public GroupedShoppingLists(IGrouping <ShoppingListStatus, ShoppingList> group) : base(group)
 {
     ShoppingListStatus = group.Key;
 }