예제 #1
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     using (FCad_PlanoReferencia plano = new FCad_PlanoReferencia())
     {
         if (plano.ShowDialog() == DialogResult.OK)
         {
             CamadaNegocio.Contabil.Cadastro.TCN_PlanoReferencial.Gravar(plano.rPlano, null);
             MessageBox.Show("Plano Referencial gravado com sucesso.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);
             bsPlanoReferencia.Add(plano.rPlano);
         }
     }
 }
예제 #2
0
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            if (bsPlanoReferencia.Current != null)
            {
                using (FCad_PlanoReferencia plano = new FCad_PlanoReferencia())
                {
                    plano.rPlano = (bsPlanoReferencia.Current as CamadaDados.Contabil.Cadastro.TRegistro_PlanoReferencial);
                    if (plano.ShowDialog() == DialogResult.OK)
                    {
                        CamadaNegocio.Contabil.Cadastro.TCN_PlanoReferencial.Gravar(plano.rPlano, null);
                        MessageBox.Show("Plano Referencial gravado com sucesso.", "Mensagem", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        bsPlanoReferencia.DataSource = CamadaNegocio.Contabil.Cadastro.TCN_PlanoReferencial.Buscar(string.Empty, string.Empty, null);
                        //     bsPlanoReferencia.Add(plano.rPlano);
                    }
                }
            }
        }