コード例 #1
0
        private void cmdSave_Click(object sender, EventArgs e)
        {
            if (tBackupSetName.Text.Trim() == "")
            {
                MessageBox.Show("Please enter a backup set name.", "Add Backup Set", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (cbServerAlias.Text.Trim() == "")
            {
                MessageBox.Show("Please select a server alias for this backup set.", "Add Backup Set", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            using (DataStuff sn = new DataStuff())
            {
                sn.SaveBackupSet(tBackupSetName.Text, tBackupSetDescription.Text, UserID, cbServerAlias.Text, "Y");
                NewBackupSetName = tBackupSetName.Text;

                MessageBox.Show("Backup set saved.", "Add Backup Set", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
        }