예제 #1
0
 private void btnConsultar_Click(object sender, EventArgs e)
 {
     if (gridRegistros.CurrentRow == null)
     {
         MessageBox.Show("Nenhum registro selecionado", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         var area_comum = (model.Area_comum)gridRegistros.CurrentRow.DataBoundItem;
         FrmAreaComumFormulario formulario = new FrmAreaComumFormulario(Operacao.Consulta, _context, area_comum);
         formulario.ShowDialog();
     }
 }
예제 #2
0
 private void btnInserir_Click(object sender, EventArgs e)
 {
     if (_permissoes.editInserir == util.SimNao.NAO && _permissoes.editSupervisor == util.SimNao.NAO)
     {
         MessageBox.Show("Usuário não tem permissão para inserir registros", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         FrmAreaComumFormulario formulario = new FrmAreaComumFormulario(Operacao.Insercao, _context, new model.Area_comum());
         formulario.ShowDialog();
         atualizaLista();
     }
 }
예제 #3
0
 private void btnExcluir_Click(object sender, EventArgs e)
 {
     if (_permissoes.editExcluir == util.SimNao.NAO && _permissoes.editSupervisor == util.SimNao.NAO)
     {
         MessageBox.Show("Usuário não tem permissão para excluir registros", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         if (gridRegistros.CurrentRow == null)
         {
             MessageBox.Show("Nenhum registro selecionado", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             var area_comum = (model.Area_comum)gridRegistros.CurrentRow.DataBoundItem;
             FrmAreaComumFormulario formulario = new FrmAreaComumFormulario(Operacao.Exclusao, _context, area_comum);
             formulario.ShowDialog();
             atualizaLista();
         }
     }
 }