private DBHelper() { var sqlconnection = DependencyService.Get <ISQLite>().GetConnection(); SettingsSchemaDB = new SettingsSchemaDB(sqlconnection); KeyProfitWordDB = new KeyProfitWordDB(sqlconnection); SMSDB = new SMSDB(sqlconnection); UserDB = new UserDB(sqlconnection); AddressesDB = new AddressesDB(sqlconnection); }
public void SetDefaultUser() { var res = GetDefaultUser(); if (res != null && res.SettingsSchemaId != 0) { return; } if (res == null) { res = new UserModel() { Name = "Evgen", Language = "en-US" }; } var schema = new SettingsSchemaDB(sqlconnection).GetDefaultScheme(); res.SettingsSchemaId = schema.Id; sqlconnection.Insert(res); }