protected void Listar(string campo, string direccion) { string estado = string.Empty; if (ddlEstados.SelectedIndex == 0) { estado = string.Empty; } else { estado = ddlEstados.SelectedValue.ToString(); } string area = string.Empty; if (ddlarea.SelectedIndex == 0) { area = string.Empty; } else { area = ddlarea.SelectedValue.ToString(); } string especialidad = string.Empty; if (ddlespecialidad.SelectedIndex == 0) { especialidad = string.Empty; } else { especialidad = ddlespecialidad.SelectedValue.ToString(); } string centro = string.Empty; if (ddlcentro.SelectedIndex == 0) { centro = string.Empty; } else { centro = ddlcentro.SelectedValue.ToString(); } BL_SOL_ANDAMIOS obj = new BL_SOL_ANDAMIOS(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_SOL_ANDAMIOS_BANDEJA(Session["IDE_USUARIO"].ToString(), estado, ddlanio.SelectedValue.ToString(), txtTicket.Text, campo, direccion, centro, area, especialidad); if (dtResultado.Rows.Count > 0) { GridView1.DataSource = dtResultado; GridView1.DataBind(); } else { GridView1.DataSource = dtResultado; GridView1.DataBind(); } }
protected void btnDescarga_Click(object sender, ImageClickEventArgs e) { string estado = string.Empty; if (ddlEstados.SelectedIndex == 0) { estado = string.Empty; } else { estado = ddlEstados.SelectedValue.ToString(); } string area = string.Empty; if (ddlarea.SelectedIndex == 0) { area = string.Empty; } else { area = ddlarea.SelectedValue.ToString(); } string especialidad = string.Empty; if (ddlespecialidad.SelectedIndex == 0) { especialidad = string.Empty; } else { especialidad = ddlespecialidad.SelectedValue.ToString(); } string centro = string.Empty; if (ddlcentro.SelectedIndex == 0) { centro = string.Empty; } else { centro = ddlcentro.SelectedValue.ToString(); } BL_SOL_ANDAMIOS obj = new BL_SOL_ANDAMIOS(); DataTable dtResultadoeExcel = new DataTable(); dtResultadoeExcel = obj.uspSEL_SOL_ANDAMIOS_BANDEJA(Session["IDE_USUARIO"].ToString(), estado, ddlanio.SelectedValue.ToString(), txtTicket.Text, "", "", centro, area, especialidad); if (dtResultadoeExcel.Rows.Count > 0) { //ExcelHelper.ToExcel(dtResultadoeExcel, "CJI3_" + ddlEstados.SelectedItem + ".xls", Page.Response); gvExcel.DataSource = dtResultadoeExcel; gvExcel.DataBind(); GridViewExportUtil.Export("ANDAMIOS_" + DateTime.Now + ".xls", gvExcel); return; } else { } }