protected void btn_img_buscar_detalle_Click(object sender, ImageClickEventArgs e) { //try //{ string sidcompetencia = ((ImageButton)sender).CommandArgument; int iidcompetencia = Convert.ToInt32(sidcompetencia); DataTable dt = null; dt = oCoon.ejecutarDataTable("UP_WEBXPLORA_CLIE_V2_REPORTE_COMPETENCIA_DETALLE", iidcompetencia); lbl_foto_comentario.Visible = false; if (dt.Rows.Count == 0) { lbl_foto_comentario.Visible = true; lbl_foto_comentario.ForeColor = System.Drawing.Color.Red; lbl_foto_comentario.Text = "No hay detalle"; foto_url.Visible = false; gv_detalle_competencia.DataBind(); } else { foto_url.Visible = true; //gv_detalle_competencia.Visible = true; gv_detalle_competencia.DataSource = dt; gv_detalle_competencia.DataBind(); DataTable dt2 = null; dt2 = oCoon.ejecutarDataTable("UP_WEBXPLORA_CLIE_V2_REPORTE_COMPETENCIA_FOTO", iidcompetencia); if (dt2.Rows.Count > 0) { foto_url.ImageUrl = "Informe_de_Competencia/Fotos/" + dt2.Rows[0]["Url_foto"].ToString(); lbl_foto_comentario.Text = "Comentario: " + dt2.Rows[0]["Comentario"].ToString(); lbl_foto_fecha.Text = "Fecha de toma: " + dt2.Rows[0]["Fec_Reg_Cel"].ToString(); lbl_foto_comentario.ForeColor = System.Drawing.Color.Black; } else { foto_url.ImageUrl = "Informe_de_Competencia/Fotos/sin_url_imagen.jpg"; lbl_foto_comentario.Text = "No se tomó la foto para este registro."; lbl_foto_comentario.ForeColor = System.Drawing.Color.Red; lbl_foto_fecha.Text = ""; } } ModalPopupExtender_detalle.Show(); //} //catch (Exception ex) //{ ex.Message.ToString(); } }
protected void btn_img_buscar_detalle_Click(object sender, ImageClickEventArgs e) { try { Conexion Ocoon = new Conexion(); string sidcompetencia = ((ImageButton)sender).CommandArgument; int iidcompetencia = Convert.ToInt32(sidcompetencia); DataTable dt2 = null; dt2 = Ocoon.ejecutarDataTable("UP_WEBXPLORA_CLIE_V2_REPORTE_COMPETENCIA_FOTO", iidcompetencia); if (dt2.Rows.Count > 0) { string photoName = dt2.Rows[0]["Id_regft"].ToString() + ".jpg";; byte[] byteArrayIn = (byte[])dt2.Rows[0]["foto"]; //string strFileName = Server.MapPath(@"~\Pages\Modulos\Cliente\Reportes\Galeria_fotografica\Fotos") + "\\" + photoName; Save_photo(photoName, byteArrayIn); Image foto_url = Panel_DetalleCompetencia.FindControl("foto_url") as Image; foto_url.ImageUrl = "~/Pages/Modulos/Cliente/Reportes/Galeria_fotografica/Fotos/" + photoName; ModalPopupExtender_detalle.Show(); } else { foto_url.ImageUrl = "~/Pages/Modulos/Cliente/Reportes/Galeria_fotografica/Fotos/sin_url_imagen.jpg"; ModalPopupExtender_detalle.Show(); } } catch (Exception ex) { ex.Message.ToString(); } }