protected override async void BtnNovo_Click(object sender, EventArgs e) { using (FrmFormPrecos frm = new FrmFormPrecos(new Preco())) { using (FrmModal frmModal = new FrmModal(frm)) frmModal.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { await CarregarGrid(); } } base.BtnNovo_Click(sender, e); }
protected override async void BtnAlterar_Click(object sender, EventArgs e) { if (preco != null) { using (FrmFormPrecos frm = new FrmFormPrecos(preco)) { using (FrmModal frmModal = new FrmModal(frm)) frmModal.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { await CarregarGrid(); } } } else { MessageBox.Show("Seleciona um preço para altera-lo.", "Informações", MessageBoxButtons.OK, MessageBoxIcon.Information); } base.BtnAlterar_Click(sender, e); }