protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { UsuarioBEL usuario = (UsuarioBEL)Session["usuarioConectado"]; TipoAsientoBLL bllTipo = new TipoAsientoBLL(); EventoBLL eventoBLL = new EventoBLL(); int rut = usuario.Rut; ClienteTicketBLL bllClienteTicket = new ClienteTicketBLL(); ddlEvento.DataSource = eventoBLL.traerEventos(rut); ddlEvento.DataTextField = "Nombre"; ddlEvento.DataValueField = "IdEvento"; ddlEvento.DataBind(); ddlTipoAsiento.DataSource = bllTipo.traerTiposAsientos(); ddlTipoAsiento.DataTextField = "Nombre"; ddlTipoAsiento.DataValueField = "IdTipoAsiento"; ddlTipoAsiento.DataBind(); if (eventoBLL.traerEventos(rut).Count != 0) { string idEvento = ddlEvento.SelectedItem.Value; GetChartDataTipoAsiento("1"); } } }
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")); } }
protected void Page_Load(object sender, EventArgs e) { /// <summary> /// Carga la grilla con las ventas del evento seleccionado en el select /// </summary> if (!IsPostBack) { PerfilBEL usuario = (PerfilBEL)Session["usuarioConectado"]; EventoBLL eventoBLL = new EventoBLL(); int rut; if (usuario.Usuario.IndexOf('-') != -1) { String[] separadorRut = usuario.Usuario.Split('-'); rut = Int32.Parse(separadorRut[0]); } else { rut = Int32.Parse(usuario.Usuario); } ClienteTicketBLL bllClienteTicket = new ClienteTicketBLL(); grvContrato.DataSource = bllClienteTicket.traerClienteTicketOrg(rut); grvContrato.DataBind(); ddlEvento.DataSource = eventoBLL.traerEventos(rut); ddlEvento.DataTextField = "Nombre"; ddlEvento.DataValueField = "IdEvento"; ddlEvento.DataBind(); } }
/// <summary> /// Filtra los eventos por estado, se debe filtrar ademas por run del organizador /// </summary> protected void ddlFiltro_SelectedIndexChanged(object sender, EventArgs e) { String estado = ddlFiltro.SelectedItem.Value; EventoBLL evBLL = new EventoBLL(); PerfilBEL usuario = (PerfilBEL)Session["usuarioConectado"]; String[] separadorRut = usuario.Usuario.Split('-'); if (estado.Equals("")) { grvEventos.DataSource = evBLL.traerEventos(Int32.Parse(separadorRut[0])); grvEventos.DataBind(); } else { grvEventos.DataSource = evBLL.traerEventoPorEstado(estado, Int32.Parse(separadorRut[0])); grvEventos.DataBind(); } }
/// <summary> /// Modifica redireccionando a la pagina AgregarEvento.aspx o Elimina el evento seleccionado, ademas modifica el tipo de ticket redireccionando a la pagina TiposTicket.aspx /// </summary> protected void grvEventos_RowCommand(object sender, GridViewCommandEventArgs e) { EventoBLL evBLL = new EventoBLL(); PerfilBEL usuario = (PerfilBEL)Session["usuarioConectado"]; String[] separadorRut = usuario.Usuario.Split('-'); if (e.CommandName.Equals("modificar")) { Response.Redirect(string.Format("AgregarEvento.aspx?id={0}", e.CommandArgument.ToString()), false); } else if (e.CommandName.Equals("Eliminar")) { evBLL.eliminarEvento(Int32.Parse(e.CommandArgument.ToString())); grvEventos.DataSource = evBLL.traerEventos(Int32.Parse(separadorRut[0])); grvEventos.DataBind(); } else if (e.CommandName.Equals("tipos")) { Response.Redirect(string.Format("TiposTicket.aspx?idEvento={0}", e.CommandArgument.ToString()), false); } }