示例#1
0
        /// <summary>
        /// Verificar este metodo Ing. Carlo  Hernandez ---Preguntar a Ditmar Estrada
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        protected void gv_Foto_ItemCommand(object source, GridCommandEventArgs e)
        {
            try
            {
                //panelEdit.DataBind();
                //RadBinaryImage_fotoBig.DataBind();
                //RadBinaryImage_fotoBig.Visible = false;
                //GridItem item = gv_Foto.Items[e.Item.ItemIndex];
                GridItem item = gv_Foto.Items[e.Item.ItemIndex];


                Label lbl_id_reg_foto = (Label)item.FindControl("lbl_id_reg_foto");


                if (e.CommandName == "VERFOTO")
                {
                    Session["iidregft"] = Convert.ToInt32(lbl_id_reg_foto.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);
                    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 (Int32.Equals(iidregft, 0))
                    {
                        Response.Redirect("/login.aspx");
                    }
                    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);
            }
        }
示例#2
0
        protected void ImageButton4_Click(object sender, ImageClickEventArgs e)
        {
            string a = Server.MapPath("temp.jpg");

            Session["path"] = a;
            MyImage FImage;

            FImage = new MyImage(RadBinaryImage_viewFoto.ImageUrl, (byte[])Session["array"]);
            FImage.Rotate("270", Server.MapPath("temp.jpg"));
            //Image1.ImageUrl = "temp.jpg";
            RadBinaryImage_viewFoto.DataValue = FImage.imageToByteArray((System.Drawing.Image)Session["imagenabyte"]);


            FImage = null;

            ModalPopupExtender_viewfoto.Show();
        }
示例#3
0
        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);
            }
        }