public static void InitializeSetting() { if (db.HasTable("setting")) { return; } var record = new Setting { RdpOption = new RdpOption(), }; var sql = SqliteAccessor.GetCreateTableSQL("setting", record); db.ExecuteNonQuery(sql); db.ToDictionary(record, out var dic); db.Upsert("setting", dic); }
public static void InitializeAccount() { if (db.HasTable("account")) { return; } var record = new Account { Name = @"administrator", Password = @"password", }; var sql = SqliteAccessor.GetCreateTableSQL("account", record); db.ExecuteNonQuery(sql); db.ToDictionary(record, out var dic); db.Upsert("account", dic); }
public static void InitializeEnvironment() { if (db.HasTable("environment")) { return; } var accounts = (IEnumerable <Account>)SelectAccounts(); var record = new Environment { HostName = @"localhost", ConnectionAddress = @"127.0.0.1", OsType = OperatingSystemType.Windows, AccountGuid = accounts.First().Guid, }; var sql = SqliteAccessor.GetCreateTableSQL("environment", record); db.ExecuteNonQuery(sql); db.ToDictionary(record, out var dic); db.Upsert("environment", dic); }