예제 #1
0
        /// <summary>
        /// Habilita, Modifica o Elimina el recinto seleccionado
        /// </summary>
        protected void grvEventos_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            RecintoBLL recBLL = new RecintoBLL();

            if (e.CommandName.Equals("modificar"))
            {
                Response.Redirect(string.Format("AgregarRecinto.aspx?id={0}", e.CommandArgument.ToString()), false);
            }
            else if (e.CommandName.Equals("Eliminar"))
            {
                recBLL.eliminarRecinto(Int32.Parse(e.CommandArgument.ToString()));
                grvEventos.DataSource = recBLL.traerRecintos();
                grvEventos.DataBind();
            }
            else if (e.CommandName.Equals("habilitar"))
            {
                RecintoBEL rec = recBLL.traerRecintoPorId(Int32.Parse(e.CommandArgument.ToString()));
                rec.IdEstado = 1;
                recBLL.editarRecinto(rec);
                grvEventos.DataSource = recBLL.traerRecintos();
                grvEventos.DataBind();
            }
            else if (e.CommandName.Equals("asiento"))
            {
                Response.Redirect(string.Format("Asientos.aspx?id={0}", e.CommandArgument.ToString()), false);
            }
            else if (e.CommandName.Equals("ver"))
            {
                Response.Redirect(string.Format("verRecinto.aspx?id={0}", e.CommandArgument.ToString()), false);
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            /// <summary>
            /// Carga la grilla con todos los eventos registrados
            /// </summary>
            if (!IsPostBack)
            {
                EventoBLL evBLL = new EventoBLL();
                //UsuarioBEL usuario = new UsuarioBEL();
                UsuarioBEL usuario = (UsuarioBEL)Session["usuarioConectado"];
                grvEventos.DataSource = evBLL.traerEventos(usuario.Rut);
                grvEventos.DataBind();

                RecintoBLL recBLL = new RecintoBLL();
                ddlRecintos.DataSource     = recBLL.traerRecintos();
                ddlRecintos.DataValueField = "IdRecinto";
                ddlRecintos.DataTextField  = "NombreRecinto";
                ddlRecintos.DataBind();
                ddlRecintos.Items.Insert(0, new ListItem("..Seleccione Recinto..", "-1"));

                TipoEventoBLL tipBLL = new TipoEventoBLL();
                ddlTipoEventos.DataSource     = tipBLL.listaDeTiposEventos();
                ddlTipoEventos.DataValueField = "IdTipoEvento";
                ddlTipoEventos.DataTextField  = "DescripcionTipoEvento";
                ddlTipoEventos.DataBind();
                ddlTipoEventos.Items.Insert(0, new ListItem("..Seleccione Tipo Evento..", "-1"));
            }
        }
예제 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     /// <summary>
     /// Carga la grilla con todos los recintos registrados
     /// </summary>
     if (!IsPostBack)
     {
         //linea con mensaje de cuadro de busqueda
         txtBusqueda.Attributes.Add("placeholder", "Ingrese nombre de recinto");
         RecintoBLL recBLL = new RecintoBLL();
         grvEventos.DataSource = recBLL.traerRecintos();
         grvEventos.DataBind();
     }
 }
예제 #4
0
        /// <summary>
        /// Busca un recinto por habilitado o deshabilitado
        /// </summary>
        protected void ddlFiltro_SelectedIndexChanged(object sender, EventArgs e)
        {
            int itemSel = Int32.Parse(ddlFiltro.SelectedItem.Value);

            if (itemSel == 1 || itemSel == 0)
            {
                RecintoBLL recBLL = new RecintoBLL();
                grvEventos.DataSource = recBLL.filtrarRecintos(itemSel);
                grvEventos.DataBind();
            }
            else
            {
                RecintoBLL recBLL = new RecintoBLL();
                grvEventos.DataSource = recBLL.traerRecintos();
                grvEventos.DataBind();
            }
        }