Exemplo n.º 1
0
 protected void GvImagenes_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         //Session["envioslide"] = "editar";
         GridViewRow row         = GvImagenes.SelectedRow;
         string      Id_Imagenes = "";
         HiddenField cod         = default(HiddenField);
         cod         = (HiddenField)row.FindControl("Id_Imagenes");
         Id_Imagenes = cod.Value;
         ServicioCom21.ServicioCom21 _administrador = new ServicioCom21.ServicioCom21();
         DataSet ds = _administrador.Com21_consulta_imagenes_id(int.Parse(Id_Imagenes));
         if (ds.Tables[0].Rows.Count > 0)
         {
             foreach (DataRow dr in ds.Tables[0].Rows)
             {
                 //seteo todos los valores de la consulta especifica
                 this.IdImagenes.Value = dr[0].ToString();
                 this.img.ImageUrl     = dr[4].ToString();
                 this.img0.ImageUrl    = dr[1].ToString();
                 this.img1.ImageUrl    = dr[2].ToString();
                 this.img2.ImageUrl    = dr[3].ToString();
                 if (Convert.ToBoolean(dr[6].ToString()) == true)
                 {
                     cbactivar.Checked = true;
                 }
                 else
                 {
                     cbactivar.Checked = false;
                 }
                 IdProducto.Value = dr[7].ToString();
                 lblproducto.Text = dr[8].ToString();
             }
             btnedit.Visible   = true;
             btninsert.Visible = false;
         }
     }
     catch (Exception Ex)
     {
         Console.WriteLine(Ex.Message);
         ScriptManager.RegisterStartupScript(upMantenimiento, upMantenimiento.GetType(), "click", "alert('Error Tecnico por favor espere unos minutos');", true);
     }
 }