Пример #1
0
    private void ObtenerDestinos(bool forzarBD)
    {
        PlayaBC   p = new PlayaBC();
        DataTable playas;

        if (ViewState["playas"] == null || forzarBD)
        {
            playas = p.ObtenerXSite(int.Parse(hf_idSite.Value));
            ViewState["playas"] = playas;
        }
        playas = (DataTable)ViewState["playas"];

        DataView playasNS = playas.AsDataView();
        string   filtros  = "";

        filtros += "ZONA_ID = " + ddl_destinoZona.SelectedValue;
        if (!string.IsNullOrEmpty(hf_seleccionados.Value))
        {
            filtros += " AND PLAY_ID NOT IN (" + hf_seleccionados.Value + ")";
        }
        playasNS.RowFilter            = filtros;
        ViewState["nosel"]            = playasNS.ToTable();
        gv_noSeleccionados.DataSource = playasNS.ToTable();
        gv_noSeleccionados.DataBind();
    }
Пример #2
0
    protected void ddl_site_SelectedIndexChanged(object sender, EventArgs e)
    {
        PlayaBC p       = new PlayaBC();
        int     site_id = Convert.ToInt32(ddl_site.SelectedValue);

        utils.CargaDrop(ddl_playa, "ID", "DESCRIPCION", p.ObtenerDrop(site_id));
    }
Пример #3
0
 protected void ddl_zona_SelectedIndexChanged(object sender, EventArgs e)
 {
     this.ddl_posicion.ClearSelection();
     if (this.ddl_zona.SelectedIndex != 0)
     {
         int     id_zona = Convert.ToInt32(this.ddl_zona.SelectedValue);
         PlayaBC playa   = new PlayaBC();
         if (rb_mantenimiento.Checked)
         {
             utils.CargaDrop(this.ddl_playa, "ID", "DESCRIPCION", playa.ObtenerPlayasXCriterio(null, null, id_zona, false, null));
         }
         else
         {
             utils.CargaDrop(this.ddl_playa, "ID", "DESCRIPCION", playa.ObtenerPlayasXCriterioTipoCarga(null, null, id_zona, false, Convert.ToInt32(this.ddl_tipo_carga.SelectedValue), "200"));
         }
         ddl_playa.Enabled = true;
         ddl_playa_SelectedIndexChanged(null, null);
     }
     else
     {
         ddl_posicion.Enabled = false;
         ddl_playa.Enabled    = false;
         ddl_posicion.ClearSelection();
         ddl_playa.ClearSelection();
     }
 }
Пример #4
0
    private void CargaDropPlaya(int tipo)
    {
        PlayaBC   p       = new PlayaBC();
        int       zona_id = Convert.ToInt32(ddl_zona.SelectedValue);
        DataTable dt      = new DataTable();

        switch (tipo)
        {
        case 1:
            dt = p.ObtenerXZona(zona_id, 100);     //Selecciona playas tipo andén
            break;

        case 2:
            dt = p.ObtenerXZona(zona_id, 200);     //Selecciona playas tipo estacionamiento
            break;

        case 3:
            dt = p.ObtenerXZona(zona_id, 400);     //Selecciona playas tipo logística inversa
            break;

        default:
            dt = p.ObtenerXZona(zona_id);
            break;
        }
        utils.CargaDrop(ddl_playa, "ID", "DESCRIPCION", dt);
        ddl_playa_SelectedIndexChanged(null, null);
    }
Пример #5
0
    private void ObtenerPlaya(bool forzarBD)
    {
        if (ViewState["lista"] == null || forzarBD)
        {
            PlayaBC   zona = new PlayaBC();
            DataTable dt   = zona.ObtenerXSite(int.Parse(ddl_site.SelectedValue));
            ViewState["lista"] = dt;
            ViewState.Remove("filtrados");
        }
        DataView dw;

        if (ViewState["filtrados"] == null)
        {
            dw = new DataView((DataTable)ViewState["lista"]);
        }
        else
        {
            dw = new DataView((DataTable)ViewState["filtrados"]);
        }
        if (ViewState["sortExpresion"] != null && ViewState["sortExpresion"].ToString() != "")
        {
            dw.Sort = (String)ViewState["sortExpresion"];
        }
        this.gv_listar.DataSource = dw;
        this.gv_listar.DataBind();
    }
Пример #6
0
    private void ObtenerDestinos(bool forzarBD)
    {
        PlayaBC   p = new PlayaBC();
        DataTable playas;

        if (this.ViewState["playas"] == null || forzarBD)
        {
            playas = p.ObtenerXSite(Convert.ToInt32(this.ddl_destinoSite.SelectedValue));
            this.ViewState["playas"] = playas;
        }
        playas = (DataTable)this.ViewState["playas"];

        //DataView playasS = playas.AsDataView();
        //playasS.RowFilter = "ID IN (" + hf_seleccionados.Value + ")";
        //gv_seleccionados.DataSource = (DataTable)ViewState["seleccionados"];
        //gv_seleccionados.DataBind();

        DataView playasNS = playas.AsDataView();
        string   filtros  = "";

        filtros += string.Format("ZONA_ID = {0}", this.ddl_destinoZona.SelectedValue);
        if (!string.IsNullOrEmpty(this.hf_seleccionados.Value))
        {
            filtros += string.Format(" AND PLAY_ID NOT IN ({0})", this.hf_seleccionados.Value);
        }
        playasNS.RowFilter                 = filtros;
        this.ViewState["nosel"]            = playasNS.ToTable();
        this.gv_noSeleccionados.DataSource = playasNS.ToTable();
        this.gv_noSeleccionados.DataBind();
    }
Пример #7
0
 protected void ddl_destinoZona2_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.ddl_destinoZona2.SelectedIndex > 0)
     {
         int     id_zona = int.Parse(this.ddl_destinoZona2.SelectedValue);
         PlayaBC playa   = new PlayaBC();
         utils.CargaDrop(this.ddl_destinoPlaya2, "ID", "DESCRIPCION", playa.ObtenerPlayasXCriterio(null, null, id_zona, false, "100"));
         if (this.ddl_destinoPlaya1.Items.Count > 1)
         {
             this.ddl_destinoPlaya2.Enabled = true;
             this.ddl_destinoPlaya2_SelectedIndexChanged(null, null);
         }
         else
         {
             this.ddl_destinoPlaya2.Enabled = false;
             this.ddl_destinoPos2.Enabled   = false;
         }
     }
     else
     {
         this.ddl_destinoPos2.Enabled         = false;
         this.ddl_destinoPlaya2.Enabled       = false;
         this.ddl_destinoPos2.SelectedIndex   = 0;
         this.ddl_destinoPlaya2.SelectedIndex = 0;
     }
 }
Пример #8
0
    protected void rb_pos_CheckedChanged(object sender, EventArgs e)
    {
        if (hf_idTrailer.Value != "")
        {
            if (rb_posAuto.Checked)
            {
                CargaTipoBC ct = new CargaTipoBC();
                if (ct.CargaDestinos(int.Parse(this.ddl_tipo_carga.SelectedValue)).Rows.Count == 0)
                {
                    LugarBC l = new LugarBC();
                    ddl_zona.Enabled     = false;
                    ddl_playa.Enabled    = false;
                    ddl_posicion.Enabled = false;
                    l = l.obtenerLugarAuto(int.Parse(dropsite.SelectedValue), usuario.ID, null);
                    if (l.ID == 0 || l.ID == null)
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "alert('Error. Intente designar un lugar manualmente.');", true);
                    }
                    else
                    {
                        PlayaBC p    = new PlayaBC();
                        ZonaBC  zona = new ZonaBC();
                        try
                        {
                            ddl_zona.SelectedValue = l.ID_ZONA.ToString();
                        }
                        catch (Exception ex)
                        {
                            zona = zona.ObtenerXId(l.ID_ZONA);
                            ddl_zona.Items.Add(new System.Web.UI.WebControls.ListItem(zona.DESCRIPCION, zona.ID.ToString()));
                            ddl_zona.SelectedValue = zona.ID.ToString();
                        }


                        utils.CargaDrop(this.ddl_playa, "ID", "DESCRIPCION", p.ObtenerXZona(l.ID_ZONA));
                        ddl_playa.SelectedValue = l.ID_PLAYA.ToString();
                        LugarBC    lugar = new LugarBC();
                        CargaDrops drops = new CargaDrops();
                        drops.Lugar1(ddl_posicion, 0, l.ID_PLAYA, 0, 1);
                        //utils.CargaDrop(this.ddl_posicion, "ID", "DESCRIPCION", lugar.ObtenerXPlaya(l.ID_PLAYA));
                        ddl_posicion.SelectedValue = l.ID.ToString();
                    }
                }
            }
            else
            {
                ddl_zona.Enabled = true;
                if (ddl_playa.SelectedIndex > 0)
                {
                    ddl_playa.Enabled = true;
                }
                if (ddl_posicion.SelectedIndex > 0)
                {
                    ddl_posicion.Enabled = true;
                }
            }
        }
    }
Пример #9
0
    protected void drop_SelectedIndexChanged(object sender, EventArgs e)
    {
        PlayaBC p = new PlayaBC();

        p.SITE_ID      = Convert.ToInt32(dropsite.SelectedValue);
        p.ID_TIPOPLAYA = 100;
        p.ID_TIPOZONA  = 200;
        utils.CargaDropTodos(this.ddl_buscarPlaya, "ID", "DESCRIPCION", p.ObtenerTodas());
        ObtenerTrailer(true);
    }
Пример #10
0
    protected void ddl_buscarSite_SelectedIndexChanged(object sender, EventArgs e)
    {
        PlayaBC p = new PlayaBC();

        p.SITE_ID      = Convert.ToInt32(this.ddl_buscarSite.SelectedValue);
        p.ID_TIPOPLAYA = 100;
        this.utils.CargaDropTodos(this.ddl_buscarPlaya, "ID", "DESCRIPCION", p.ObtenerTodas());
        this.ddl_buscarPlaya_SelectedIndexChanged(null, null);
        this.ObtenerSolicitudes(true);
    }
Пример #11
0
 protected void ddl_editZona_IndexChanged(object sender, EventArgs e)
 {
     if (ddl_Zona.SelectedIndex > 0)
     {
         drops.Playa(ddl_playa, int.Parse(ddl_Zona.SelectedValue));
     }
     else
     {
         PlayaBC p       = new PlayaBC();
         int     site_id = Convert.ToInt32(ddl_site.SelectedValue);
         utils.CargaDropTodos(ddl_playa, "ID", "DESCRIPCION", p.ObtenerDrop(site_id));
     }
 }
Пример #12
0
    public void btn_EliminarPlaya_Click(object sender, EventArgs e)
    {
        PlayaBC playa = new PlayaBC();

        if (playa.Eliminar(int.Parse(hf_idPlaya.Value)))
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Playa eliminada exitosamente');", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Ocurrió un error al eliminar zona. Revise si tiene otros datos asociados');", true);
        }
        ObtenerPlaya(true);
    }
Пример #13
0
 protected void ddl_virtualZona_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddl_virtualZona.SelectedIndex > 0)
     {
         PlayaBC p = new PlayaBC();
         utils.CargaDrop(ddl_virtualPlaya, "ID", "DESCRIPCION", p.ObtenerXZona(Convert.ToInt32(ddl_virtualZona.SelectedValue)));
         ddl_virtualPlaya.Enabled = true;
     }
     else
     {
         ddl_virtualPlaya.Enabled = false;
         ddl_virtualPlaya.ClearSelection();
     }
 }
Пример #14
0
    protected void ddl_bloqZona_onChange(object sender, EventArgs e)
    {
        PlayaBC playa   = new PlayaBC();
        int     zona_id = int.Parse(this.ddl_bloqZona.SelectedValue);

        this.utils.CargaDrop(this.ddl_bloqPlaya, "ID", "DESCRIPCION", playa.ObtenerXZona(zona_id));
        if (this.ddl_bloqPlaya.Items.Count > 1)
        {
            this.ddl_bloqPlaya.Enabled = true;
            if (this.ddl_bloqPlaya.SelectedIndex > 0)
            {
                this.ddl_bloqPlaya_onChange(null, null);
                this.ddl_bloqPlaya.Enabled = true;
            }
        }
    }
Пример #15
0
    public void btn_editGrabar_Click(object sender, EventArgs e)
    {
        PlayaBC playa = new PlayaBC();

        playa.CODIGO       = txt_editCodigo.Text;
        playa.DESCRIPCION  = txt_editDesc.Text;
        playa.ZONA_ID      = int.Parse(ddl_editZona.SelectedValue);
        playa.VIRTUAL      = chk_editVirtual.Checked;
        playa.ID_TIPOPLAYA = int.Parse(ddl_editTipo.SelectedValue);
        //playa.PLAYA_X = double.Parse(txt_editPosX.Text);
        //playa.PLAYA_Y = double.Parse(txt_editPosY.Text);
        //playa.ROTACION = int.Parse(txt_editRotacion.Text);
        //playa.ALTO = double.Parse(txt_editAltura.Text);
        //playa.ANCHO = double.Parse(txt_editAnchura.Text);
        if (string.IsNullOrEmpty(hf_idPlaya.Value))
        {
            if (playa.Crear(playa))
            {
                ObtenerPlaya(true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Playa creada exitosamente');", true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalPlaya');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Ocurrió un error al agregar playa. Intente nuevamente.');", true);
            }
            //txt_editPosX.Text = "";
            //txt_editPosY.Text = "";
            //txt_editRotacion.Text = "";
            //txt_editAnchura.Text = "";
            //txt_editAltura.Text = "";
        }
        else
        {
            playa.ID = int.Parse(hf_idPlaya.Value);
            if (playa.Modificar(playa))
            {
                ObtenerPlaya(true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Playa modificada exitosamente');", true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalPlaya');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Ocurrió un error al modificar playa. Intente nuevamente.');", true);
            }
        }
    }
Пример #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ZonaBC          zona          = new ZonaBC();
        PlayaBC         playa         = new PlayaBC();
        LugarBC         lugar         = new LugarBC();
        TransportistaBC transportista = new TransportistaBC();

        if (!this.IsPostBack)
        {
            this.txt_fechaMovimiento.Text = DateTime.Now.ToShortDateString();
            utils.CargaDrop(this.ddl_transportista, "ID", "NOMBRE", transportista.ObtenerTodos());
            YMS_ZONA_BC yms = new YMS_ZONA_BC();
            DataTable   ds  = yms.ObteneSites(((UsuarioBC)Session["Usuario"]).ID);
            utils.CargaDropNormal(this.dropsite, "ID", "NOMBRE", ds);
            this.drop_SelectedIndexChanged(null, null);
        }
    }
Пример #17
0
 protected void gv_noSeleccionados_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "SEL")
     {
         int       index = int.Parse(e.CommandArgument.ToString());
         DataTable sel   = new DataTable();
         DataTable nosel = (DataTable)ViewState["nosel"];
         PlayaBC   p     = new PlayaBC();
         p = p.ObtenerPlayaXId(int.Parse(hf_idPlaya.Value));
         if (ViewState["seleccionados"] == null)
         {
             sel.Columns.Add("SITE_ID");
             sel.Columns.Add("PLAY_ID_ORI");
             sel.Columns.Add("ORIGEN");
             sel.Columns.Add("PLAY_ID_DES");
             sel.Columns.Add("DESTINO");
             sel.Columns.Add("ZONA_ID");
             sel.Columns.Add("ZONA_DESTINO");
             sel.Columns.Add("ORDEN");
             sel.Columns.Add("TIIC_ID");
             ViewState["seleccionados"] = sel;
         }
         sel = (DataTable)ViewState["seleccionados"];
         string id_dest     = nosel.Rows[index]["PLAY_ID"].ToString();
         string destino     = nosel.Rows[index]["DESCRIPCION"].ToString();
         string zona_id_des = nosel.Rows[index]["ZONA_ID"].ToString();
         string zona_des    = nosel.Rows[index]["ZONA"].ToString();
         //string tiic_id = nosel.Rows[index]["TIIC_ID"].ToString();
         int orden = sel.Rows.Count + 1;
         if (string.IsNullOrWhiteSpace(hf_seleccionados.Value))
         {
             hf_seleccionados.Value = id_dest;
         }
         else
         {
             hf_seleccionados.Value += "," + id_dest;
         }
         sel.Rows.Add(p.SITE_ID, p.ID, p.DESCRIPCION, id_dest, destino, zona_id_des, zona_des, orden, 0);
         DataView dw = sel.AsDataView();
         dw.Sort = "ORDEN ASC";
         sel     = dw.ToTable();
         ViewState["seleccionados"] = sel;
         ObtenerSeleccionados(false);
         ObtenerDestinos(false);
     }
 }
Пример #18
0
    protected void ddl_zona_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (this.ddl_zona.SelectedIndex != 0)
        {
            int     id_zona = Convert.ToInt32(this.ddl_zona.SelectedValue);
            PlayaBC playa   = new PlayaBC();
            utils.CargaDrop(this.ddl_playa, "ID", "DESCRIPCION", playa.ObtenerPlayasXCriterio(null, null, id_zona, false, "200"));
            if (this.ddl_playa.Items.Count > 1)
            {
                this.ddl_playa.Enabled = true;
                if (this.ddl_playa.SelectedIndex != 0)
                {
                    int         id_playa = Convert.ToInt32(this.ddl_playa.SelectedValue);
                    YMS_ZONA_BC yms      = new YMS_ZONA_BC();
                    DataTable   ds1      = yms.Obtenerlugares_playa(id_playa, null, "0");

                    utils.CargaDrop(this.ddl_posicion, "ID", "DESCRIPCION", ds1);
                    if (this.ddl_posicion.Items.Count > 1)
                    {
                        this.ddl_posicion.Enabled = true;
                    }
                    else
                    {
                        this.ddl_posicion.Enabled = false;
                    }
                }
                else
                {
                    this.ddl_posicion.Enabled = false;
                }
            }
            else
            {
                this.ddl_playa.Enabled    = false;
                this.ddl_posicion.Enabled = false;
            }
        }
        else
        {
            this.ddl_posicion.Enabled       = false;
            this.ddl_playa.Enabled          = false;
            this.ddl_posicion.SelectedIndex = 0;
            this.ddl_playa.SelectedIndex    = 0;
        }
    }
Пример #19
0
 protected void ddl_zona_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.ddl_zona.SelectedIndex != 0)
     {
         int     id_zona = Convert.ToInt32(this.ddl_zona.SelectedValue);
         PlayaBC playa   = new PlayaBC();
         this.d.Playa(this.ddl_playa, id_zona);
         ddl_playa.Enabled = true;
         ddl_playa_SelectedIndexChanged(null, null);
     }
     else
     {
         ddl_posicion.Enabled = false;
         ddl_playa.Enabled    = false;
         ddl_posicion.ClearSelection();
         ddl_playa.ClearSelection();
     }
 }
Пример #20
0
 protected void ddl_zona_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.ddl_zona.SelectedIndex != 0)
     {
         int     id_zona = int.Parse(this.ddl_zona.SelectedValue);
         PlayaBC playa   = new PlayaBC();
         utils.CargaDrop(this.ddl_playa, "ID", "DESCRIPCION", playa.ObtenerPlayasXCriterio(null, null, id_zona, false, "200"));
         ddl_playa_SelectedIndexChanged(null, null);
         ddl_playa.Enabled = true;
     }
     else
     {
         ddl_posicion.Enabled = false;
         ddl_playa.Enabled    = false;
         ddl_posicion.ClearSelection();
         ddl_playa.ClearSelection();
     }
 }
Пример #21
0
    protected void DDL_ZONA_INDEX_CHANGED(object SENDER, EventArgs E)
    {
        DropDownList ddl_zona   = (DropDownList)SENDER;
        DropDownList ddl_playas = (DropDownList)panel_ddl.FindControl(ddl_zona.ID.Replace("ZONA", "PLAYA"));

        if (!string.IsNullOrEmpty(ddl_zona.SelectedValue) && ddl_zona.SelectedValue != "0")
        {
            ddl_playas.Enabled = true;
            PlayaBC p = new PlayaBC();
            utils.CargaDrop(ddl_playas, "ID", "DESCRIPCION", p.ObtenerXZona(Convert.ToInt32(ddl_zona.SelectedValue)));
        }
        else
        {
            ddl_playas.ClearSelection();
            ddl_playas.Enabled = false;
        }
        DDL_playa_INDEX_CHANGED(ddl_playas, null);
    }
Пример #22
0
    protected void ddl_bloqPlaya_onChange(object sender, EventArgs e)
    {
        PlayaBC playa    = new PlayaBC();
        int     playa_id = int.Parse(ddl_bloqPlaya.SelectedValue);
        LugarBC lugar    = new LugarBC();

        CargaDrops drops = new CargaDrops();

        drops.Lugar1(ddl_bloqLugar, 0, playa_id, -1, 1);
        //utils.CargaDrop(ddl_bloqLugar, "ID", "DESCRIPCION", lugar.ObtenerXPlaya(playa_id));
        if (ddl_bloqLugar.Items.Count <= 1)
        {
            ddl_bloqLugar.Enabled = false;
        }
        else
        {
            ddl_bloqLugar.Enabled = true;
        }
    }
Пример #23
0
 public void ddl_destinoZona_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!(ddl_destinoZona.SelectedIndex == 0))
     {
         int     id_zona = int.Parse(ddl_destinoZona.SelectedValue);
         PlayaBC playa   = new PlayaBC();
         utils.CargaDrop(ddl_destinoPlaya, "ID", "DESCRIPCION", playa.ObtenerXZona(id_zona));
         if (ddl_destinoPlaya.Items.Count > 1)
         {
             ddl_destinoPlaya.Enabled = true;
             if (ddl_destinoPlaya.SelectedIndex != 0)
             {
                 int         id_playa = int.Parse(ddl_destinoPlaya.SelectedValue);
                 LugarBC     lugar    = new LugarBC();
                 YMS_ZONA_BC yms      = new YMS_ZONA_BC();
                 DataTable   ds1      = yms.Obtenerlugares_playa(id_playa, null, "0");
                 utils.CargaDrop(ddl_destinoPos, "ID", "DESCRIPCION", ds1);
                 if (ddl_destinoPos.Items.Count > 1)
                 {
                     ddl_destinoPos.Enabled = true;
                 }
                 else
                 {
                     ddl_destinoPos.Enabled = false;
                 }
             }
         }
         else
         {
             ddl_destinoPlaya.Enabled = false;
             ddl_destinoPos.Enabled   = false;
         }
     }
     else
     {
         ddl_destinoPos.Enabled         = false;
         ddl_destinoPlaya.Enabled       = false;
         ddl_destinoPos.SelectedIndex   = 0;
         ddl_destinoPlaya.SelectedIndex = 0;
     }
     //     ButtonClickDemo(null, null);
 }
Пример #24
0
    protected void gv_listar_RowEditing(object sender, GridViewEditEventArgs e)
    {
        PlayaBC playa = new PlayaBC();

        gv_listar.SelectedIndex = e.NewEditIndex;
        hf_idPlaya.Value        = this.gv_listar.SelectedDataKey.Value.ToString();
        playa = playa.ObtenerPlayaXId(int.Parse(this.gv_listar.SelectedDataKey.Value.ToString()));
        txt_editCodigo.Text        = playa.CODIGO;
        txt_editDesc.Text          = playa.DESCRIPCION;
        ddl_editZona.SelectedValue = playa.ZONA_ID.ToString();
        chk_editVirtual.Checked    = playa.VIRTUAL;
        ddl_editZona.Enabled       = false;
        ddl_editTipo.SelectedValue = playa.ID_TIPOZONA.ToString();
        //txt_editPosX.Text = playa.PLAYA_X.ToString();
        //txt_editPosY.Text = playa.PLAYA_Y.ToString();
        //txt_editRotacion.Text = playa.ROTACION.ToString();
        //txt_editAnchura.Text = playa.ANCHO.ToString();
        //txt_editAltura.Text = playa.ALTO.ToString();
        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalPlaya();", true);
    }
Пример #25
0
    private void ObtenerPlayas(bool forzarBD)
    {
        if (this.ViewState["playas"] == null || forzarBD)
        {
            PlayaBC   p      = new PlayaBC();
            DataTable playas = p.ObtenerXSite(Convert.ToInt32(this.hf_idSite.Value));
            this.ViewState["playas"] = playas;
        }
        DataView playasNS = new DataView((DataTable)this.ViewState["playas"]);
        string   filtro   = string.Format("ZONA_ID = {0}", this.ddl_asignarZona.SelectedValue);

        if (!string.IsNullOrEmpty(hf_seleccionados.Value))
        {
            filtro += string.Format(" AND PLAY_ID NOT IN ({0})", hf_seleccionados.Value);
        }
        playasNS.RowFilter                 = filtro;
        this.ViewState["nosel"]            = playasNS.ToTable();
        this.gv_noSeleccionados.DataSource = this.ViewState["nosel"];
        this.gv_noSeleccionados.DataBind();
        ObtenerSeleccionados(false);
    }
Пример #26
0
    protected void btn_guardarTTrai_Click(object sender, EventArgs e)
    {
        PlayaBC playa = new PlayaBC();

        string caract = GenerarCadena();

        if (!string.IsNullOrEmpty(caract))
        {
            if (playa.AgregarCaracteristica(int.Parse(hf_idPlaya.Value), caract))
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Caracteristicas Agregadas Correctamente');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Ocurrió un error al agregar caracteristicas. Intente nuevamente.');", true);
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Debe seleccionar al menos una característica.');", true);
        }
    }
Пример #27
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["usuario"] == null)
     {
         Response.Redirect("../InicioQYMS.aspx");
     }
     usuario = (UsuarioBC)Session["usuario"];
     if (!IsPostBack)
     {
         YMS_ZONA_BC y  = new YMS_ZONA_BC();
         PlayaBC     p  = new PlayaBC();
         Tipo_ZonaBC tz = new Tipo_ZonaBC();
         DataTable   dt = y.ObteneSites(usuario.ID);
         utils.CargaDropNormal(ddl_site, "ID", "NOMBRE", dt);
         utils.CargaDropNormal(ddl_editSite, "ID", "NOMBRE", dt);
         utils.CargaDrop(ddl_editTipo, "PYTI_ID", "TIPO_PLAYA", p.ObtenerTipos());
         utils.CargaDrop(ddl_editTipoZona, "ID", "DESCRIPCION", tz.ObtenerTodos());
         ddl_site_SelectedIndexChanged(null, null);
         ddl_editSite_SelectedIndexChanged(null, null);
         //ltl_contenidoCaract.Text = crearContenido();
     }
 }
Пример #28
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "ELIMINAR")
     {
         hf_idPlaya.Value         = e.CommandArgument.ToString();
         lblRazonEliminacion.Text = "Eliminar Tipo Playa";
         msjEliminacion.Text      = "Se eliminará el tipo zona seleccionado, ¿desea continuar?";
         btnModalEliminar.Attributes.Remove("onclick");
         btnModalEliminar.Attributes.Add("onclick", "eliminarPlaya();");
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "modalConfirmacion();", true);
     }
     if (e.CommandName == "DESTINO")
     {
         hf_idPlaya.Value = e.CommandArgument.ToString();
         PlayaBC p = new PlayaBC();
         p = p.ObtenerPlayaXId(int.Parse(hf_idPlaya.Value));
         hf_idSite.Value = p.SITE_ID.ToString();
         ZonaBC z = new ZonaBC();
         utils.CargaDrop(ddl_destinoZona, "ID", "DESCRIPCION", z.ObtenerXSite(p.SITE_ID, true));
         ObtenerSeleccionados(true);
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalDestino();", true);
     }
 }
Пример #29
0
 protected void ddl_destinoZona1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!(this.ddl_destinoZona1.SelectedIndex == 0))
     {
         int     id_zona = int.Parse(this.ddl_destinoZona1.SelectedValue);
         PlayaBC playa   = new PlayaBC();
         utils.CargaDrop(this.ddl_destinoPlaya1, "ID", "DESCRIPCION", playa.ObtenerPlayasXCriterio(null, null, id_zona, false, "100"));
         if (this.ddl_destinoPlaya1.Items.Count > 1)
         {
             this.ddl_destinoPlaya1.Enabled = true;
             this.ddl_destinoPlaya1_SelectedIndexChanged(null, null);
             //if (ddl_destinoPlaya1.SelectedIndex != 0)
             //{
             //    int id_playa = int.Parse(ddl_destinoPlaya1.SelectedValue);
             //    YMS_ZONA_BC yms = new YMS_ZONA_BC();
             //    DataTable ds1 = yms.Obtenerlugares_playa(id_playa, null, "0");
             //    utils.CargaDrop(ddl_destinoPos1, "ID", "DESCRIPCION", ds1);
             //    if (ddl_destinoPos1.Items.Count > 1)
             //        ddl_destinoPos1.Enabled = true;
             //    else
             //        ddl_destinoPos1.Enabled = false;
             //}
         }
         else
         {
             this.ddl_destinoPlaya1.Enabled = false;
             this.ddl_destinoPos1.Enabled   = false;
         }
     }
     else
     {
         this.ddl_destinoPos1.Enabled         = false;
         this.ddl_destinoPlaya1.Enabled       = false;
         this.ddl_destinoPos1.SelectedIndex   = 0;
         this.ddl_destinoPlaya1.SelectedIndex = 0;
     }
 }
Пример #30
0
    private void LlenarForm()
    {
        PlayaBC p = new PlayaBC();

        p = p.ObtenerPlayaXId(int.Parse(hf_idPlaya.Value));
        txt_editCodigo.Text        = p.CODIGO;
        txt_editDesc.Text          = p.DESCRIPCION;
        ddl_editSite.SelectedValue = p.SITE_ID.ToString();
        ddl_editSite_SelectedIndexChanged(null, null);
        try
        {
            ddl_editZona.SelectedValue = p.ZONA_ID.ToString();
        }
        catch (Exception ex)
        {
        }


        chk_editVirtual.Checked        = p.VIRTUAL;
        ddl_editSite.Enabled           = false;
        ddl_editZona.Enabled           = true;
        ddl_editTipo.SelectedValue     = p.ID_TIPOPLAYA.ToString();
        ddl_editTipoZona.SelectedValue = p.ID_TIPOZONA.ToString();
    }