Example #1
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            bo.IDEvento    = txtIDEvento.Text;
            bo.IDUsuario   = Convert.ToInt32(Session["IDUsuario"]);
            bo.Nombre      = txtNombreEvento.Text;
            bo.Descripcion = txtDescripcion.Value;
            bo.HoraInicio  = HoraInicio.Value;
            bo.HoraFin     = HoraFin.Value;
            bo.Costo       = Precio.Value;
            bo.FechaInicio = FechaInicio.Value;
            bo.FechaFin    = FechaFin.Value;
            string NombreImagen = Path.GetFileName(fupfoto.PostedFile.FileName);

            if (fupfoto.HasFile)
            {
                fupfoto.PostedFile.SaveAs(Server.MapPath("~/Img/") + NombreImagen);
                Image1.ImageUrl = "~/Img/" + NombreImagen;
            }
            //almacenar en la BD
            bo.Fotografia = "/" + NombreImagen;
            bo.Aprobacion = 0;
            bo.Categoria  = Convert.ToInt32(Categoria.SelectedValue);
            bo.Ubicacion  = 1;
            if (dao.ActualizarEvento(bo) != 0)
            {
                Response.Write("<script language=javascript>alert('Evento Actualizado');</script>");
            }
            else
            {
                Response.Write("<script language=javascript>alert('Algo salio mal');</script>");
            }

            MostrarTabla();
        }
        public int ActualizarR(object obj)
        {
            int status = 0;

            status = Tipo_Ser.ActualizarEvento(obj);
            return(status);
        }