示例#1
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);
        }
    }