Пример #1
0
        private void cargaGrilla()
        {
            OfertaDAO ofertaDAO = new OfertaDAO();

            listaOfertas = new BindingList <OfertaGridVO>(ofertaDAO.getListaOfertasGrid());
            this.dgvOferta.DataSource = listaOfertas;
        }
Пример #2
0
        private void btnModificar_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.dgvOferta.SelectedRows.Count == 0)
                {
                    MessageBox.Show("Error: Debe seleccionar una oferta para editar.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    OfertaDAO ofertaDAO = new OfertaDAO();
                    WindowsFormsApp1.Model.Negocio.Entities.Oferta oferta = ofertaDAO.getOfertaByCodigo(long.Parse(this.dgvOferta.SelectedRows[0].Cells[0].Value.ToString()));

                    EditarOferta modif = new EditarOferta();
                    modif.ofertaSeleccionada = oferta;
                    modif.ShowDialog();
                    listaOfertas = new BindingList <OfertaGridVO>(ofertaDAO.getListaOfertasGrid());
                    this.dgvOferta.DataSource = listaOfertas;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error grave editando Oferta.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #3
0
        private void btnNuevo_Click(object sender, EventArgs e)
        {
            CrearOferta crearOferta = new CrearOferta();

            crearOferta.ShowDialog();
            OfertaDAO ofertaDAO = new OfertaDAO();

            listaOfertas = new BindingList <OfertaGridVO>(ofertaDAO.getListaOfertasGrid());
            this.dgvOferta.DataSource = listaOfertas;
        }
Пример #4
0
 private void CargaOfertas()
 {
     try
     {
         OfertaDAO Oferta = new OfertaDAO();
         listaOferta = Oferta.getListaOfertasGrid();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ha ocurrido un error al listar las ofertas. Favor comunique a soporte.");
         return;
     }
 }
Пример #5
0
 private void btnActualizar_Click(object sender, EventArgs e)
 {
     try
     {
         OfertaDAO ofertaDAO = new OfertaDAO();
         listaOfertas = new BindingList <OfertaGridVO>(ofertaDAO.getListaOfertasGrid());
         this.dgvOferta.DataSource = listaOfertas;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error grave listando Ofertas.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }