//Evento al presionar el boton ModificarDenuncia2 protected void btnModificarDenuncia2_Click(object sender, EventArgs e) { //Se obtiene la denuncia a modificar denuncia.idDenuncia = Int32.Parse(hdfIdDenuncia.Value); DataTable tableDenuncia = denuncia.denunciaEspecifica(); //Se solicita informacion del usuario HttpPostedFile postedFile = fileUploadImage.PostedFile; string fileName = Path.GetFileName(postedFile.FileName); string fileExtension = Path.GetExtension(fileName); lblRestriccionTitulo.Visible = false; lblRestriccionFormatoFoto.Visible = false; //Verifica si el titulo esta vacio if (txtTitulo.Text == "") { lblRestriccionTitulo.Visible = true; } else { denuncia.titulo = txtTitulo.Text; denuncia.descripcion = txtDescripcion.Text; //Verifica si el archivo posee informacion if (fileUploadImage.HasFile == false) { denuncia.foto = (byte[])tableDenuncia.Rows[0][6]; denuncia.actualizarDenuncia(); limpiarPantalla(); } //Verifica si el archivo no posee los formatos necesarios else if (fileExtension.ToLower() != ".jpg" && fileExtension.ToLower() != ".bmp" && fileExtension.ToLower() != ".png") { lblRestriccionFormatoFoto.Visible = true; } else { //Se agrega la nueva foto Stream stream = postedFile.InputStream; BinaryReader binaryReader = new BinaryReader(stream); byte[] bytes = binaryReader.ReadBytes((int)stream.Length); denuncia.foto = bytes; denuncia.actualizarDenuncia(); limpiarPantalla(); } } }