Example #1
0
 protected override async void BtnNovo_Click(object sender, EventArgs e)
 {
     using (FrmFormOperacao frm = new FrmFormOperacao(new Operacao()))
     {
         using (FrmModal frmModal = new FrmModal(frm))
             frmModal.ShowDialog();
         if (frm.DialogResult == DialogResult.OK)
         {
             await CarregarGrid();
         }
     }
     base.BtnNovo_Click(sender, e);
 }
Example #2
0
        protected override async void BtnAlterar_Click(object sender, EventArgs e)
        {
            if (operacao != null)
            {
                using (FrmFormOperacao frm = new FrmFormOperacao(operacao))
                {
                    using (FrmModal frmModal = new FrmModal(frm))
                        frmModal.ShowDialog();
                    if (frm.DialogResult == DialogResult.OK)
                    {
                        await CarregarGrid();
                    }
                }
            }
            else
            {
                MessageBox.Show("Seleciona uma operação para altera-la.", "Informações", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            base.BtnAlterar_Click(sender, e);
        }