private void afterNovo() { using (TFTabSimples fTab = new TFTabSimples()) { if (fTab.ShowDialog() == DialogResult.OK) { if (fTab.rTab != null) { try { CamadaNegocio.Fiscal.TCN_TabSimples.Gravar(fTab.rTab, null); MessageBox.Show("Tabela gravada com sucesso.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information); this.afterBusca(); } catch (Exception ex) { MessageBox.Show(ex.Message.Trim(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } }
private void afterAltera() { if (bsTabSimples.Current != null) { using (TFTabSimples fTab = new TFTabSimples()) { fTab.rTab = bsTabSimples.Current as CamadaDados.Fiscal.TRegistro_TabSimples; if (fTab.ShowDialog() == DialogResult.OK) { try { CamadaNegocio.Fiscal.TCN_TabSimples.Gravar(fTab.rTab, null); MessageBox.Show("Tabela alterada com sucesso.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(ex.Message.Trim(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); } } this.afterBusca(); } } }