コード例 #1
0
    public void cargaYMS(bool forzarcargaplayas)
    {
        // aquí va el sp



        YMS_ZONA_BC yms    = new YMS_ZONA_BC();
        var         imagen = yms.ObteneSite(Convert.ToInt32(dropsite.SelectedValue)).Rows[0]["SITE_IMAGEN"];

        siteimage.ImageUrl = url + "/images/" + imagen;
        DataTable ds = yms.ObtenerPlayas_Site(Convert.ToInt32(dropsite.SelectedValue), null, null);

        carga_trailers();
        try
        {
            int i = 0;
            while (i < ds.Rows.Count)
            {
                llenaPlaya(ds.Rows[i]);
                if (IsPostBack == false || forzarcargaplayas == true)
                {
                    agregafiltroplaya(ds.Rows[i]);
                }
                i = i + 1;
            }
        }
        catch (Exception ex)
        {
        }
    }
コード例 #2
0
    public void cargaYMS()
    {
        // aquí va el sp



        YMS_ZONA_BC yms    = new YMS_ZONA_BC();
        var         imagen = yms.ObteneSite(Convert.ToInt32(dropsite.SelectedValue)).Rows[0]["SITE_IMAGEN"];

        siteimage.ImageUrl = url + "/images/" + imagen;
        DataTable ds = yms.ObtenerPlayas_Site(Convert.ToInt32(dropsite.SelectedValue), null, null);

        try
        {
            int i = 0;
            while (i < ds.Rows.Count)
            {
                llenaPlaya(ds.Rows[i]);
                // If (IsPostBack = False) Then

                agregafiltroplaya(ds.Rows[i]);
                // End If
                i = i + 1;
            }
        }
        catch (Exception ex)
        {
        }
    }
コード例 #3
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EDITAR")
     {
         SiteBC site = new SiteBC();
         hf_idSite.Value               = e.CommandArgument.ToString();
         site                          = site.ObtenerXId(Convert.ToInt32(hf_idSite.Value));
         txt_editNombre.Text           = site.NOMBRE;
         txt_editDesc.Text             = site.DESCRIPCION;
         ddl_editEmpresa.SelectedValue = site.EMPRESA_ID.ToString();
         txt_editCodSap.Text           = site.COD_SAP.ToString();
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalSite();", true);
     }
     if (e.CommandName == "ELIMINAR")
     {
         hf_idSite.Value          = e.CommandArgument.ToString();
         lblRazonEliminacion.Text = "Eliminar Site";
         msjEliminacion.Text      = "Se eliminará el Site seleccionado, ¿desea continuar?";
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalConfirmacion();", true);
     }
     if (e.CommandName == "ACTIVAR")
     {
         SiteBC site = new SiteBC();
         if (site.TrailerAuto(u.ID, Convert.ToInt32(e.CommandArgument.ToString())))
         {
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "alert('Todo OK');", true);
         }
         else
         {
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "alert('Error');", true);
         }
         ObtenerSite(true);
     }
     if (e.CommandName == "VIRTUAL")
     {
         hf_idSite.Value = e.CommandArgument.ToString();
         SiteBC site = new SiteBC();
         site.ObtenerXId(Convert.ToInt32(hf_idSite.Value));
         ZonaBC z = new ZonaBC();
         utils.CargaDrop(ddl_virtualZona, "ID", "DESCRIPCION", z.ObtenerXSite(Convert.ToInt32(hf_idSite.Value), true));
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalVirtual();", true);
         YMS_ZONA_BC p  = new YMS_ZONA_BC();
         DataTable   dt = p.ObtenerPlayas_Site(Convert.ToInt32(hf_idSite.Value), "", "1");
         if (dt.Rows.Count == 1)
         {
             ddl_virtualZona.SelectedValue = dt.Rows[0]["zona_id"].ToString();
             ddl_virtualZona_SelectedIndexChanged(null, null);
             ddl_virtualPlaya.SelectedValue = dt.Rows[0]["id"].ToString();
         }
     }
 }