/// <summary> /// /// </summary> /// <returns></returns> internal MSSQLDatabaseBackup.MSSQLDatabaseBackupConfig Save() { MSSQLDatabaseBackup.MSSQLDatabaseBackupConfig config = new MSSQLDatabaseBackup.MSSQLDatabaseBackupConfig(); if (string.IsNullOrEmpty(tbServer.Text)) { throw new Exception("You have to specify a database server"); } config.Server = tbServer.Text; if (string.IsNullOrEmpty(tbUsername.Text)) { throw new Exception("You have to specify a database username"); } config.Username = tbUsername.Text; if (string.IsNullOrEmpty(tbPassword.Text)) { throw new Exception("You have to specify a database password"); } config.Password = tbPassword.Text; config.IsLocalServer = cbIsLocalServer.Checked; if (!config.IsLocalServer) { if (string.IsNullOrEmpty(tbRemoteTempDir.Text)) { throw new Exception("You have to specify a remote TEMP-directory"); } config.RemoteTempDir = tbRemoteTempDir.Text; } config.LocalTempDirectory = tbLocalTempDir.Text; if (string.IsNullOrEmpty(config.LocalTempDirectory)) { throw new Exception("You have to specify a local TEMP-directory"); } config.Databases = new List <string>(); foreach (string db in cblDatabases.CheckedItems) { config.Databases.Add(db); } config.CompressFiles = cbCompress.Checked; config.AddDateToFilename = cbAddDateToFilename.Checked; return(config); }
/// <summary> /// Initializes a new instance of the <b>MSSQLDatabaseBackupConfigGUI</b> class. /// </summary> /// <param name="config"></param> public MSSQLDatabaseBackupConfigGUI(MSSQLDatabaseBackup.MSSQLDatabaseBackupConfig config) { InitializeComponent(); Config = config ?? new MSSQLDatabaseBackup.MSSQLDatabaseBackupConfig(); }