private void bb_novoProprietario_Click(object sender, EventArgs e) { if (CamadaNegocio.ConfigGer.TCN_CadParamGer.BuscaVlBool("ST_CADCLFOR_RESUMIDO", null)) { using (TFCadCliforResumido fClifor = new TFCadCliforResumido()) { if (fClifor.ShowDialog() == DialogResult.OK) { if (fClifor.rClifor != null) { try { TCN_CadClifor.Gravar(fClifor.rClifor, null); cd_proprietario.Text = fClifor.rClifor.Cd_clifor; nm_proprietario.Text = fClifor.rClifor.Nm_clifor; cd_endproprietario_Leave(sender, new EventArgs()); } catch (Exception ex) { MessageBox.Show(ex.Message.Trim(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } } else { using (TFClifor fClifor = new TFClifor()) { if (fClifor.ShowDialog() == DialogResult.OK) { if (fClifor.rClifor != null) { try { TCN_CadClifor.Gravar(fClifor.rClifor, null); cd_proprietario.Text = fClifor.rClifor.Cd_clifor; nm_proprietario.Text = fClifor.rClifor.Nm_clifor; cd_endproprietario_Leave(sender, new EventArgs()); } catch (Exception ex) { MessageBox.Show(ex.Message.Trim(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } } }
private void button1_Click(object sender, EventArgs e) { using (TFCadCliforResumido fClifor = new TFCadCliforResumido()) { if (fClifor.ShowDialog() == DialogResult.OK) { if (fClifor.rClifor != null) { try { CamadaNegocio.Financeiro.Cadastros.TCN_CadClifor.Gravar(fClifor.rClifor, null); vCD_Clifor = fClifor.rClifor.Cd_clifor; nm_fornecedor.Text = fClifor.rClifor.Nm_clifor; } catch (Exception ex) { MessageBox.Show(ex.Message.Trim(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } }