示例#1
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);
     }
 }
示例#2
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);
    }
示例#3
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);
     }
 }
示例#4
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();
    }
示例#5
0
    protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        PlayaBC zona = new PlayaBC();

        if (e.CommandName == "ELIMINAR")
        {
            hf_idPlaya.Value         = e.CommandArgument.ToString();
            zona                     = zona.ObtenerPlayaXId(int.Parse(hf_idPlaya.Value));
            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);
        }
        else if (e.CommandName == "CARACT")
        {
            chk_seco.Checked  = false;
            chk_frio.Checked  = false;
            chk_mfrio.Checked = false;
            chk_cong.Checked  = false;
            chk_ways.Checked  = false;
            PlayaBC playa = new PlayaBC();
            hf_idPlaya.Value = e.CommandArgument.ToString();
            try
            {
                string   caract = playa.ObtenerCaracteristicasPlaya(int.Parse(hf_idPlaya.Value));
                string[] car    = caract.Split(",".ToCharArray());
                foreach (string c in car)
                {
                    switch (c)
                    {
                    case "CCS":
                        chk_seco.Checked = true;
                        break;

                    case "CCF":
                        chk_frio.Checked = true;
                        break;

                    case "CCMF":
                        chk_mfrio.Checked = true;
                        break;

                    case "CCC":
                        chk_cong.Checked = true;
                        break;

                    case "CCWAY":
                        chk_ways.Checked = true;
                        break;
                    }
                }
            }
            catch (Exception)
            {
            }
            //Label1.Text = "Caracteristicas Playa ";
            //btnModalCaract.Attributes.Add("onclick", "CaracteristicasPlaya();");
            //btnModalCaract.Text = "Grabar";

            //playa = playa.ObtenerCaracteristicasPlaya(int.Parse(hf_idPlaya.Value));
            //hf_excluyentes.Value = playa.EXCLUYENTES;
            //hf_noexcluyentes.Value = playa.NO_EXCLUYENTES;

            //ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "llenarForm", "llenarForm();", true);
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asddf", "ModalCaracteristicas();", true);
        }
    }