Example #1
0
        public async Task LoadSummaries()
        {
#if false
            var fuelings = new List <Fueling>();
            await LoadFuelings(GasTable, fuelings);

            var summary = App.Summary;
            foreach (var fueling in fuelings)
            {
                summary.Add(fueling);
            }
#else
            var ApiKey = Settings.ApiKey;
            await BasesTable.ForEach(async (rec) => {
                if (rec.BaseId != DataBase.BaseId)
                {
                    var dataBase = new AirBase(ApiKey, rec.BaseId);
                    await dataBase.Initialize();

                    var gasTable = new GasTable(dataBase);
                    await gasTable.Initialize();

                    await LoadSummaries(gasTable);
                }
            });
            await LoadSummaries(GasTable);
#endif
        }
Example #2
0
        public async Task Initialize()
        {
            var ApiKey = Settings.ApiKey;
            var BaseId = Settings.BaseId;

            DataBase = new AirBase(ApiKey, BaseId);
            await DataBase.Initialize();

            GasTable = new GasTable(DataBase);
            await GasTable.Initialize();

            BasesTable = new BasesTable(DataBase);
            await BasesTable.Initialize();
        }