Exemple #1
0
 protected override async void BtnNovo_Click(object sender, EventArgs e)
 {
     using (FrmFormUsuario frm = new FrmFormUsuario(new Usuario()))
     {
         using (FrmModal frmModal = new FrmModal(frm))
             frmModal.ShowDialog();
         if (frm.DialogResult == DialogResult.OK)
         {
             await CarregarGrid();
         }
     }
     base.BtnNovo_Click(sender, e);
 }
Exemple #2
0
        protected override async void BtnAlterar_Click(object sender, EventArgs e)
        {
            if (usuario != null)
            {
                using (FrmFormUsuario frm = new FrmFormUsuario(usuario))
                {
                    using (FrmModal frmModal = new FrmModal(frm))
                        frmModal.ShowDialog();
                    if (frm.DialogResult == DialogResult.OK)
                    {
                        await CarregarGrid();
                    }
                }
            }
            else
            {
                MessageBox.Show("Selecione um usuário para altera-lo.", "Informações", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            base.BtnAlterar_Click(sender, e);
        }