Пример #1
0
        public TestData()
        {
            //EntryOwner.AccountType = Models.AccountType.Testing;
#if UseTestData
            genTestEntries();
#endif

#if PREPOPULATE
            var lookup = Data.HealthStats.Database.LookupEntryOwner("Mark");
            if (lookup == null)
            {
                EntryOwner           = new Models.EntryOwner();
                EntryOwner.OwnerName = "Mark";
                SeedData();  // uncomment the start of this line after generating the initialization code
                var setting = Data.HealthStats.Database.LookupSetting(Constants.TestDataStored);
                if (setting == null)
                {
                    Data.HealthStats.Database.CreateOrUpdateEntryOwnerAsync(EntryOwner);
                    var newSetting = new Models.StoredSetting()
                    {
                        SettingName = Constants.TestDataStored, SettingValue = "true"
                    };
                    //Data.BloodSugarsDatabase.Database.
                }
                else if (setting == false)
                {
                    Data.HealthStats.Database.CreateOrUpdateEntryOwnerAsync(EntryOwner);
                }
            }
            else
            {
                EntryOwner = lookup;
            }
#endif
        }
Пример #2
0
        internal static StoredSetting[] GetStoredSettings()
        {
            var settings = new StoredSetting[]
            {
                new StoredSetting()
                {
                    SettingName = Constants.TestDataStored, SettingValue = "false"
                },
                new StoredSetting()
                {
                    SettingName = Constants.ActiveOwnerName, SettingValue = string.Empty
                }
            };

            return(settings);
            //throw new NotImplementedException();
        }