Have a good afternoon.
I'm having trouble completing a task, which is as follows:
I have a customer registration, which when the user edits something from the register, when saving a screen is displayed, to indicate the reason for the change, but in this screen, you can not leave the reason blank, problem ..
I'm using IF to check if it's populated or not, but even if it falls on the else and displaying my warning message, it closes the screen and returns to the client's registration screen,
At the customer registration screen, clicking the save button executes the code:
else if (editar == 1)
{
Observacao_cliente obs = new Observacao_cliente(id_cliente); // verificar qual tipo de retorno para poder cadastrar a atualização.
if (obs.ShowDialog() == DialogResult.OK)
{
chek_new_cli = cadastro_bd.cadastro_cliente(editar, textBox13.Text, textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox15.Text, textBox16.Text, textBox6.Text, textBox9.Text, textBox10.Text, textBox11.Text, textBox12.Text, comboBox1.Text, bloq_v, textBox7.Text, textBox8.Text, textBox14.Text);
if (chek_new_cli > 0)
{
//inicia o cadastro no banco....
In the form of client_exception, clicking the save button executes the code:
private void button1_Click(object sender, EventArgs e) // botão salvar
{
if (comboBox1.Text != string.Empty && textBox2.Text != string.Empty)
{
check_salvar = cadastro.cadastro_obs_cliente(id_cliente, dateTimePicker1.Text, comboBox1.Text, textBox2.Text);
if (check_salvar > 0)
{
this.Close();
}
}
else
{
MessageBox.Show("O título e nem o motivo podem estar em branco!", "Observações Gerais", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}