private void BtnSalvar_Click(object sender, EventArgs e) { if (IdMatPrima.Length == 0) { MessageBox.Show( "Favor realizar uma pesquisa!", "Atenção !", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (RadioSim.Checked == false && RadioNao.Checked == false) { MessageBox.Show( "Favor responder se deseja alterar produtos ja cadastrados!", "Atenção !", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (RadioSim.Checked) { CadastroMat.AtualizarTabelaCompleta(IdMatPrima, "MATERIAPRIMA", NumericValor.Value, TextCodigo.Text); CadastroMat.AtualizarMatPrima(TextDescricao.Text, NumericValor.Value, IdMatPrima, TextCodigo.Text); MessageBox.Show("Dados alterados com sucesso !", "Sucesso !", MessageBoxButtons.OK, MessageBoxIcon.Information); IdMatPrima = ""; TextDescricao.Text = ""; NumericValor.Value = 0; TextCodigo.Text = ""; } else { CadastroMat.AtualizarMatPrima(TextDescricao.Text, NumericValor.Value, IdMatPrima, TextCodigo.Text); MessageBox.Show("Dados alterados com sucesso !", "Sucesso !", MessageBoxButtons.OK, MessageBoxIcon.Information); IdMatPrima = ""; TextDescricao.Text = ""; NumericValor.Value = 0; TextCodigo.Text = ""; } }