Esempio n. 1
0
 async void LoadList()
 {
     _users            = (await UserDataStore.GetItemsAsync(true)).Where(c => !c.Name.Equals("Storage")).ToList();
     _ingredientCounts = (await IngredientCountDataStore.GetItemsAsync(true))
                         .OrderBy(c => DateTime.Parse(c.Date)).ToList();
     _ingredients  = (await IngredientDataStore.GetItemsAsync(true)).ToList();
     _records      = (await RecordDataStore.GetItemsAsync(true)).ToList();
     _avtomats     = (await AvtomatDataStore.GetItemsAsync(true)).ToList();
     _userAvtomats = (await UserAvtomatDataStore.GetItemsAsync(true)).ToList();
 }
Esempio n. 2
0
        private async void LoadData()
        {
            _ingredientCounts = (await IngredientCountDataStore.GetItemsAsync(true)).ToList();
            _ingredients      = (await IngredientDataStore.GetItemsAsync(true)).ToList();
            _records          = (await RecordDataStore.GetItemsAsync(true)).ToList();
            _users            = (await UserDataStore.GetItemsAsync(true)).ToList();

            var strgusr = _users.FirstOrDefault(c => c.Name.Equals("Storage"));

            if (strgusr == null)
            {
                _storageUser = new User()
                {
                    Id = Guid.NewGuid().ToString(), Name = "Storage"
                };
                await UserDataStore.AddItemAsync(_storageUser);
            }
            else
            {
                _storageUser = strgusr;
            }
        }
Esempio n. 3
0
 async void LoadIngredientsCount(DateTime startDate, DateTime endDate)
 {
     _ingredientCounts = (await IngredientCountDataStore.GetItemsAsync(true)).Where(c => DateTime.Parse(c.Date) >= startDate && DateTime.Parse(c.Date) <= endDate)
                         .OrderBy(c => DateTime.Parse(c.Date)).ThenBy(c => c.User).ToList();
 }