Example #1
0
        private void Recarrega()
        {
            if (tbCodigo.Text.Length <= 0)
            {
                return;
            }

            if (editando)
            {
                if (MessageBox.Show("Tem certeza que deseja perder os dados alterados?",
                                    "Aviso de alteração",
                                    MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Warning) == DialogResult.No)
                {
                    return;
                }
            }


            if (orcamento != null)
            {
                orcamento = orcamentoDAO.BuscaByID(orcamento.OrcamentoID);
                PreencheCampos(orcamento);
            }
            else
            {
                ignoracheckevent = true;
                LimpaCampos(true);
                ignoracheckevent = false;
            }
            Editando(false);
        }
Example #2
0
        private void DgvOrcamentos_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int             selectedRowIndex = dgvOrcamentos.SelectedCells[0].RowIndex;
            DataGridViewRow selectedRow      = dgvOrcamentos.Rows[selectedRowIndex];

            orcamentoSelecionado = orcamentos.Find(o => o.OrcamentoID == Convert.ToInt32(selectedRow.Cells[0].Value));
            orcamentoSelecionado = orcamentoDAO.BuscaByID(orcamentoSelecionado.OrcamentoID);
            this.Close();
        }