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;

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

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

            var basesTable = new BasesTable(CurrentDb);
            await basesTable.Initialize();

            await basesTable.ForEach((rec) => {
                if (rec.BaseId != CurrentDb.BaseId)
                {
                    BaseIds.Add(rec.BaseId);
                }
            },
                                     sortField : BaseRecord.START_DATE
                                     );

            BaseIds.Add(CurrentDb.BaseId);
        }
Example #3
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();
        }