private void btnInserir_Click(object sender, EventArgs e)
 {
     if (tabAbas.SelectedIndex == 1) //Itens
     {
         FrmOrcamentoItem item = new FrmOrcamentoItem(Operacao.Insercao, _context, _orcamento, new model.Orcamento_item());
         item.ShowDialog();
     }
     preencheForm();
 }
 private void btnExcluir_Click(object sender, EventArgs e)
 {
     if (tabAbas.SelectedIndex == 1) //Itens
     {
         if (gridItens.CurrentRow == null)
         {
             MessageBox.Show("Nenhum registro selecionado", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             var orcamento_item    = (model.Orcamento_item)gridItens.CurrentRow.DataBoundItem;
             FrmOrcamentoItem item = new FrmOrcamentoItem(Operacao.Exclusao, _context, _orcamento, orcamento_item);
             item.ShowDialog();
         }
     }
     preencheForm();
 }
 private void btnConsultar_Click(object sender, EventArgs e)
 {
     if (tabAbas.SelectedIndex == 0) //Principal
     {
         FrmOrcamentoFormulario formulario = new FrmOrcamentoFormulario(Operacao.Consulta, _context, _orcamento);
         formulario.ShowDialog();
         formulario.Dispose();
     }
     else
     { // Itens
         if (gridItens.CurrentRow == null)
         {
             MessageBox.Show("Nenhum registro selecionado", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             var orcamento_item    = (model.Orcamento_item)gridItens.CurrentRow.DataBoundItem;
             FrmOrcamentoItem item = new FrmOrcamentoItem(Operacao.Consulta, _context, _orcamento, orcamento_item);
             item.ShowDialog();
         }
     }
 }