private void dgdTabela_DoubleClick(object sender, EventArgs e) { if (tpOperacao == Enumeradores.TipoOperacao.Select) { Selecionar(); } else { if (btnEditar.Enabled) { OrcamentoDTO orcamentoDTO = (OrcamentoDTO)OrcamentoBindingSource.Current; if (orcamentoDTO != null) { if (orcamentoDTO.PosicaoOrcamentoDescricao.Equals("Pedido Finalizado")) { MessageBox.Show("Não é possível alterar um orçamento já finalizado!", "Impossível prosseguir!", MessageBoxButtons.OK, MessageBoxIcon.Information); Cursor = Cursors.Default; return; } } Cursor = Cursors.WaitCursor; frmUpdateOrcamento frmUpdate = new frmUpdateOrcamento(this, Enumeradores.TipoOperacao.Update, OrcamentoBindingSource); frmUpdate.Show(); Cursor = Cursors.Default; } } }
private void Visualizar() { Cursor = Cursors.WaitCursor; frmUpdateOrcamento frmUpdate = new frmUpdateOrcamento(this, Enumeradores.TipoOperacao.Viewer, OrcamentoBindingSource); frmUpdate.Show(); Cursor = Cursors.Default; }
private void Novo() { Cursor = Cursors.WaitCursor; frmUpdateOrcamento frmUpdate = new frmUpdateOrcamento(this, Enumeradores.TipoOperacao.Insert, OrcamentoBindingSource); frmUpdate.Show(); Cursor = Cursors.Default; }
private void Alterar() { OrcamentoDTO orcamentoDTO = (OrcamentoDTO)OrcamentoBindingSource.Current; if (orcamentoDTO != null) { if (orcamentoDTO.PosicaoOrcamentoDescricao.Equals("Pedido Finalizado")) { MessageBox.Show("Não é possível alterar um orçamento já finalizado!", "Impossível prosseguir!", MessageBoxButtons.OK, MessageBoxIcon.Information); Cursor = Cursors.Default; return; } } Cursor = Cursors.WaitCursor; frmUpdateOrcamento frmUpdate = new frmUpdateOrcamento(this, Enumeradores.TipoOperacao.Update, OrcamentoBindingSource); frmUpdate.Show(); Cursor = Cursors.Default; }