Exemplo n.º 1
0
        protected void btnEditarN_Click(object sender, EventArgs e)
        {
            int    Id         = Int32.Parse(txtId.Text);
            string titulo     = txtTitulo.Text.ToString();
            string resumen    = txtResumen.Text.ToString();
            string contenido  = txtContenido.Text.ToString();
            string fecha      = txtFecha.Text.ToString();
            String imgPortada = imagenPortada.FileName;
            String imgContent = imagenesContenido.FileName;


            Noticia Registro = new Noticia(Id, titulo, resumen, contenido, fecha, imgPortada, imgContent);



            DaoNoticias objmodifica = new DaoNoticias();

            //if (
            objmodifica.modificar(Id, titulo, resumen, contenido, fecha, imgPortada, imgContent);
            //)
            //{
            //lblNotifu.Text = "Modificado correctamente";
            gvNoticias.DataSource = objConectar.mMostrarNoticia();
            gvNoticias.DataBind();
            //}
            //else
            //{

            //    lblNotifu.Text = "Algo salio mal";
            //}
        }
Exemplo n.º 2
0
        protected void btnCargar_Click(object sender, EventArgs e)
        {
            DaoNoticias noticia = new DaoNoticias();

            int Id = Int32.Parse(txtId.Text);

            noticia.cargarDatos(ref Id);
            List <Noticia> lista = noticia.cargarDatos(ref Id);


            txtTitulo.Text    = lista[0].titulo;
            txtResumen.Text   = lista[0].resumen;
            txtContenido.Text = lista[0].contenido;
            txtFecha.Text     = lista[0].fecha;
        }