public IArasSetupConfig GetConfig(string env) { IArasConnectionConfig connectionConfig = GetArasConnectionConfig(env); IArasSetupConfig config = new ArasSetupConfig(connectionConfig) { DatabaseName = EnvNode.SelectSingleNode(XPATH_DATABASE_NAME).InnerText, SqlServer = EnvNode.SelectSingleNode(XPATH_DB_SERVER).InnerText, SqlCmd = EnvNode.SelectSingleNode(XPATH_SQLCMD).InnerText, BackupDir = EnvNode.SelectSingleNode(XPATH_BACKUP_DIR).InnerText }; return(config); }
public IArasSetupConfig Setup(string env) { IArasConnectionConfig connectionConfig = SetupConnection(env); IArasSetupConfig config = new ArasSetupConfig(connectionConfig); config.DatabaseName = EnvNode.SelectSingleNode(XPATH_DATABASE_NAME).InnerText; config.SqlServer = EnvNode.SelectSingleNode(XPATH_DB_SERVER).InnerText; config.SqlCmd = EnvNode.SelectSingleNode(XPATH_SQLCMD).InnerText; config.BackupDir = EnvNode.SelectSingleNode(XPATH_BACKUP_DIR).InnerText; string configValue; configValue = GetValueFromUserInput($"Set Database Name ({config.ArasDBName}):", config.ArasDBName); SaveToFile(EnvNode, Setting.DataBaseName, configValue); configValue = GetValueFromUserInput($"Set sqlcmd ({config.SqlCmd}):", config.SqlCmd); SaveToFile(EnvNode, Setting.SqlCmd, configValue); configValue = GetValueFromUserInput($"Set SQL Server ({config.SqlServer}):", config.SqlServer); SaveToFile(EnvNode, Setting.SqlServer, configValue); configValue = GetValueFromUserInput($"Set Backup Dir ({config.BackupDir}):", config.BackupDir); SaveToFile(EnvNode, Setting.DBBackupDir, configValue); config = this.GetConfig(env); return(config); }