private void TestButton_Click(object sender, EventArgs e) { this.cmd.Command = CommandTextBox.Text; this.cmd.Connection = ConnectionComboBox.Text; this.cmd.Description = DescriptionTextBox.Text; this.cmd.SqlCommandText = SqlRichTextBox.Text; this.cmd.ToAddress = "*****@*****.**"; this.cmd.CommandType = CommandType.MailCommand; MailCommandExecutor.Execute(this.cmd); MessageBox.Show("Command Excuted and Result Mail Send To [email protected]"); }
private void TestToolStripButton_Click(object sender, EventArgs e) { if (MailCommandDataGridView.SelectedRows.Count == 0) { return; } DataGridViewRow row = MailCommandDataGridView.SelectedRows[0]; MailCommand cmd = new MailCommand(); cmd.Command = row.Cells["colCommand"].Value.ToString(); cmd.Connection = row.Cells["colConnection"].Value.ToString(); cmd.Description = row.Cells["colDescription"].Value.ToString(); cmd.SqlCommandText = row.Cells["colSqlCommandText"].Value.ToString(); cmd.CommandType = CommandType.MailCommand; cmd.ToAddress = "*****@*****.**"; MailCommandExecutor.Execute(cmd); MessageBox.Show("Command Excuted and Result Mail Send To [email protected]"); }