protected void Page_Load(object sender, EventArgs e) { if (!(Page.IsPostBack)) { dalTablero.SLA _dal = new dalTablero.SLA(); this.cmbAnio.DataSource = _dal.Listar_Anios(); this.cmbAnio.DataTextField = "ANIO"; this.cmbAnio.DataBind(); this.cmbAnio.SelectedValue = Convert.ToString(DateTime.Now.Year); this.cmbMes.DataSource = _dal.Listar_Meses(this.cmbAnio.SelectedValue); this.cmbMes.DataValueField = "CODIGO"; this.cmbMes.DataTextField = "MES"; this.cmbMes.DataBind(); this.cmbMes.SelectedValue = Convert.ToString(DateTime.Now.Month); this.cmbTip.DataSource = _dal.Listar_Tipos(); //this.cmbTip.DataValueField = "CODIGO"; this.cmbTip.DataTextField = "TIPO"; this.cmbTip.DataBind(); this.cmbGru.DataSource = _dal.Listar_Grupos(); //this.cmbGru.DataValueField = "CODIGO"; this.cmbGru.DataTextField = "GRUPO"; this.cmbGru.DataBind(); this.cmbAre.DataSource = _dal.Listar_Areas(); //this.cmbAre.DataValueField = "CODIGO"; this.cmbAre.DataTextField = "AREA"; this.cmbAre.DataBind(); this.cmbAre.Items.Insert(0,new ListItem("[TODOS]", "[TODOS]")); this.cmbGru.Items.Insert(0, new ListItem("[TODOS]", "[TODOS]")); this.cmbTip.Items.Insert(0, new ListItem("[TODOS]", "[TODOS]")); _dal = null; } }
protected void Page_Load(object sender, EventArgs e) { if (!(Page.IsPostBack)) { System.Int16 intTipo; TipoTop10 ettTipo; if (Int16.TryParse(Request.QueryString["intTipo"], out intTipo)) { ettTipo = (TipoTop10)intTipo; switch (ettTipo) { case TipoTop10.Usuario: this.lblTit.Text = "Top10 Tickets por Usuario"; break; case TipoTop10.Area: this.lblTit.Text = "Top10 Tickets por Área"; break; case TipoTop10.Catgegoria: this.lblTit.Text = "Top10 Tickets por Categoria"; break; default: Response.Redirect("Default.aspx"); break; } Session.Add("intTipoTop10", ettTipo); dalTablero.SLA _dal = new dalTablero.SLA(); this.cmbAnio.DataSource = _dal.Listar_Anios(); this.cmbAnio.DataTextField = "ANIO"; this.cmbAnio.DataBind(); this.cmbAnio.SelectedValue = Convert.ToString(DateTime.Now.Year); this.cmbMes.DataSource = _dal.Listar_Meses(this.cmbAnio.SelectedValue); this.cmbMes.DataValueField = "CODIGO"; this.cmbMes.DataTextField = "MES"; this.cmbMes.DataBind(); this.cmbMes.Items.Insert(0,new ListItem("[TODOS]", "")); this.cmbTip.DataSource = _dal.Listar_Tipos(); this.cmbTip.DataTextField = "TIPO"; this.cmbTip.DataBind(); this.cmbGru.DataSource = _dal.Listar_Grupos(); this.cmbGru.DataTextField = "GRUPO"; this.cmbGru.DataBind(); this.cmbAre.DataSource = _dal.Listar_Areas(); this.cmbAre.DataTextField = "AREA"; this.cmbAre.DataBind(); this.cmbAre.Items.Insert(0, new ListItem("[TODOS]", "[TODOS]")); this.cmbGru.Items.Insert(0, new ListItem("[TODOS]", "[TODOS]")); this.cmbTip.Items.Insert(0, new ListItem("[TODOS]", "[TODOS]")); _dal = null; } else Response.Redirect("Default.aspx"); } }