protected void buttonSubmit_Click(object sender, EventArgs e) { UploadedFile file = UploadedFile.FromHttpPostedFile(Request.Files[inputFile.UniqueID]); if (!Object.Equals(file, null)) { LooongMethodWhichUpdatesTheProgressContext(file); RadBinaryImage_fotoBig.Visible = true; Int32 tamaño = Convert.ToInt32(file.InputStream.Length); byte[] byteArrayIn = new byte[tamaño + 1]; file.InputStream.Read(byteArrayIn, 0, tamaño); RadBinaryImage_fotoBig.DataValue = byteArrayIn; Session["byteArrayIn"] = byteArrayIn; } ModalPopup_Edit.Show(); }
protected void gv_incidencias_ItemCommand(object source, GridCommandEventArgs e) { try { panelEdit.DataBind(); RadBinaryImage_fotoBig.DataBind(); RadBinaryImage_fotoBig.Visible = false; //GridItem item = gv_Foto.Items[e.Item.ItemIndex]; int a = e.Item.ItemIndex; if (a == -1) { return; } GridItem item = gv_incidencias.Items[e.Item.ItemIndex]; Label lbl_id_reg_foto = (Label)item.FindControl("lbl_id_reg_foto"); Label lbl_Id_Reg_Fotogr = (Label)item.FindControl("Id_incidencia"); if (e.CommandName == "VERFOTO") { Session["iidregft"] = Convert.ToInt32(lbl_id_reg_foto.Text); Session["Id_repft"] = Convert.ToInt32(lbl_Id_Reg_Fotogr.Text); DataTable dt = null; Conexion Ocoon = new Conexion(); //string sidregft = ((LinkButton)sender).CommandArgument; int iidregft = Convert.ToInt32(lbl_id_reg_foto.Text); dt = Ocoon.ejecutarDataTable("UP_WEBXPLORA_OPE_CONSULTA_REG_FOTO", iidregft); if (dt.Rows.Count == 0) { lblencabezado.Text = "INFORMACION"; lblmensajegeneral.Text = "La Foto Seleccionada no existe"; ImgMensaje.ImageUrl = "~/Pages/images/Mensajes/warning_blue.png"; divMensaje.Style.Value = "border-width:10px;border-style:solid;border-color:#53A2FF; height:169px;background-color:#9FCBFF"; ModalPopupMensaje.Show(); return; } byte[] byteArrayIn = (byte[])dt.Rows[0]["foto"]; Session["array"] = byteArrayIn; RadBinaryImage_viewFoto.DataValue = byteArrayIn; ModalPopupExtender_viewfoto.Show(); //Response.Redirect("verFoto.aspx?iidregft=" + iidregft, true); } else if (e.CommandName == "EDITFOTO") { //string sidregft = ((LinkButton)senser).CommandArgument; int iidregft = Convert.ToInt32(lbl_id_reg_foto.Text); int Id_repft = Convert.ToInt32(lbl_Id_Reg_Fotogr.Text); if (iidregft == 0) { lblencabezado.Text = "INFORMACION"; lblmensajegeneral.Text = "La Foto Seleccionada no existe"; ImgMensaje.ImageUrl = "~/Pages/images/Mensajes/warning_blue.png"; divMensaje.Style.Value = "border-width:10px;border-style:solid;border-color:#53A2FF; height:169px;background-color:#9FCBFF"; ModalPopupMensaje.Show(); return; } else { RadBinaryImage imageBinary = (RadBinaryImage)item.FindControl("RadBinaryImage_foto"); RadBinaryImage_fotoBig.DataValue = imageBinary.DataValue; RadBinaryImage_fotoBig.Visible = false; Session["iidregft"] = iidregft; Session["Id_repft"] = Id_repft; } ModalPopup_Edit.Show(); } } catch (Exception ex) { ex.ToString(); Response.Redirect("~/err_mensaje_seccion.aspx", true); } }