-
-
-
-
-
+
+
-
-
-
-
-
-
\ No newline at end of file
diff --git a/WebLab/Usuarios/UsuarioList.aspx.cs b/WebLab/Usuarios/UsuarioList.aspx.cs
index 039e1a1c..e10eefb3 100644
--- a/WebLab/Usuarios/UsuarioList.aspx.cs
+++ b/WebLab/Usuarios/UsuarioList.aspx.cs
@@ -102,26 +102,49 @@ private void CargarListas()
oUtil.CargarCombo(ddlEfector, m_ssql, "idEfector", "nombre");
if (nivelcentral)
ddlEfector.Items.Insert(0, new ListItem("Todos", "0"));
-
+
+ m_ssql = @"SELECT idPerfil, nombre FROM Sys_Perfil with (nolock) ORDER BY nombre";
+ oUtil.CargarCombo(ddlPerfil, m_ssql, "idPerfil", "nombre");
+ ddlPerfil.Items.Insert(0, new ListItem("Todos", "0"));
+
}
private void CargarGrilla()
{
gvLista.AutoGenerateColumns = false;
gvLista.DataSource = LeerDatos();
gvLista.DataBind();
+ CurrentPageLabel.Text = "Página " + (gvLista.PageIndex+1) + " de " + gvLista.PageCount.ToString();
}
private object LeerDatos()
{
string m_strSQL = @"SELECT U.idUsuario, U.apellido, U.nombre, U.username, P.nombre AS perfil, E.nombre as efector ,
-case when U.activo=1 then 'Si' else 'No' end as habilitado, U.activo as activo
+case when U.activo=1 then 'Si' else 'No' end as habilitado, U.activo as activo , tipoAutenticacion
FROM Sys_Usuario AS U (nolock) INNER JOIN
Sys_Perfil AS P (nolock) ON U.idPerfil = P.idPerfil inner join
Sys_UsuarioEfector UE (nolock) on Ue.idusuario= U.idUsuario inner join
- sys_efector as E (nolock) on Ue.idEfector= E.idEfector";
+ sys_efector as E (nolock) on Ue.idEfector= E.idEfector
+ where 1=1 ";
if (ddlEfector.SelectedValue != "0")
- m_strSQL += " where E.idEfector=" + ddlEfector.SelectedValue.ToString();
+ m_strSQL += " and E.idEfector=" + ddlEfector.SelectedValue.ToString();
+
+ if (ddlPerfil.SelectedValue != "0")
+ m_strSQL += " and P.idPerfil=" + ddlPerfil.SelectedValue.ToString();
+ if (ddlTipoAutenticacion.SelectedValue != "0")
+ m_strSQL += " and tipoAutenticacion='" + ddlTipoAutenticacion.SelectedValue.ToString()+"'";
+ if (ddlHabilitados.SelectedValue != "0")
+ if(ddlHabilitados.SelectedValue == "1") m_strSQL += " and U.activo=1";
+ else m_strSQL += " and U.activo=0";
+
+ if (txtUsername.Text != "")
+ m_strSQL += " and U.username LIKE '%" + txtUsername.Text + "%'";
+ if (txtNombre.Text != "")
+ m_strSQL += " and U.nombre LIKE '%" + txtNombre.Text +"%'";
+ if (txtApellido.Text != "")
+ m_strSQL += " and U.apellido LIKE '%" + txtApellido.Text +"%'";
+
+
m_strSQL += " order by username";
@@ -133,8 +156,8 @@ Sys_UsuarioEfector UE (nolock) on Ue.idusuario= U.idUsuario inner join
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand(m_strSQL, conn);
adapter.Fill(Ds);
-
-
+ CantidadRegistros.Text = Ds.Tables[0].Rows.Count.ToString() + " registros encontrados";
+
return Ds.Tables[0];
}
@@ -180,7 +203,7 @@ protected void gvLista_RowDataBound(object sender, GridViewRowEventArgs e)
if (e.Row.RowType == DataControlRowType.DataRow)
{
- ImageButton CmdModificar = (ImageButton)e.Row.Cells[6].Controls[1];
+ ImageButton CmdModificar = (ImageButton)e.Row.Cells[7].Controls[1];
CmdModificar.CommandArgument = this.gvLista.DataKeys[e.Row.RowIndex].Value.ToString();
CmdModificar.CommandName = "Modificar";
@@ -243,16 +266,30 @@ protected void lnkExcel_Click(object sender, EventArgs e)
private DataTable LeerDatosExcel()
{
- string m_strFiltro = "";
+ string m_strFiltro = "1=1 ";
DataSet Ds = new DataSet();
// SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection;
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString); ///Performance: conexion de solo lectura
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
if (ddlEfector.SelectedValue != "0")
- m_strFiltro = " E.idEfector=" + ddlEfector.SelectedValue.ToString();
+ m_strFiltro += " AND E.idEfector=" + ddlEfector.SelectedValue.ToString();
+ if (ddlPerfil.SelectedValue != "0")
+ m_strFiltro += " and P.idPerfil=" + ddlPerfil.SelectedValue.ToString();
+ if (ddlTipoAutenticacion.SelectedValue != "0")
+ m_strFiltro += " and tipoAutenticacion='" + ddlTipoAutenticacion.SelectedValue.ToString() + "'";
+ if (ddlHabilitados.SelectedValue != "0")
+ if (ddlHabilitados.SelectedValue == "1") m_strFiltro += " and U.activo=1";
+ else m_strFiltro += " and U.activo=0";
+
+ if (txtUsername.Text != "")
+ m_strFiltro += " and U.username LIKE '%" + txtUsername.Text + "%'";
+ if (txtNombre.Text != "")
+ m_strFiltro += " and U.nombre LIKE '%" + txtNombre.Text + "%'";
+ if (txtApellido.Text != "")
+ m_strFiltro += " and U.apellido LIKE '%" + txtApellido.Text + "%'";
cmd.CommandText = "[LAB_ListaUsuarios]";
@@ -300,5 +337,40 @@ private void dataTableAExcel(DataTable tabla, string nombreArchivo)
Response.End();
}
}
+
+ protected void btnBuscar_Click(object sender, EventArgs e)
+ {
+ CargarGrilla();
+ }
+
+ protected void ddlPerfil_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ CargarGrilla();
+ }
+
+
+
+ protected void gvLista_PageIndexChanging(object sender, GridViewPageEventArgs e)
+ {
+ if (Session["idUsuario"] != null)
+ {
+ gvLista.PageIndex = e.NewPageIndex;
+ int currentPage = gvLista.PageIndex + 1;
+ CurrentPageLabel.Text = "Página " + currentPage.ToString() + " de " + gvLista.PageCount.ToString();
+ CargarGrilla();
+ }
+ else
+ Response.Redirect("../FinSesion.aspx", false);
+ }
+
+ protected void ddlTipoAutenticacion_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ CargarGrilla();
+ }
+
+ protected void ddlHabilitados_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ CargarGrilla();
+ }
}
}
diff --git a/WebLab/Usuarios/UsuarioList.aspx.designer.cs b/WebLab/Usuarios/UsuarioList.aspx.designer.cs
index c6d3ef5f..c6ffaec1 100644
--- a/WebLab/Usuarios/UsuarioList.aspx.designer.cs
+++ b/WebLab/Usuarios/UsuarioList.aspx.designer.cs
@@ -1,50 +1,151 @@
//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
+//
+// Este código fue generado por una herramienta.
//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
+// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
+// se vuelve a generar el código.
+//
//------------------------------------------------------------------------------
-namespace WebLab.Usuarios {
-
-
- public partial class UsuarioList {
-
+namespace WebLab.Usuarios
+{
+
+
+ public partial class UsuarioList
+ {
+
+ ///
+ /// Control pnlTitulo.
+ ///
+ ///
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl pnlTitulo;
+
///
- /// ddlEfector control.
+ /// Control ddlEfector.
///
///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
///
protected global::System.Web.UI.WebControls.DropDownList ddlEfector;
-
+
///
- /// btnAgregar control.
+ /// Control ddlPerfil.
///
///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
///
- protected global::System.Web.UI.WebControls.Button btnAgregar;
-
+ protected global::System.Web.UI.WebControls.DropDownList ddlPerfil;
+
+ ///
+ /// Control txtUsername.
+ ///
+ ///
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtUsername;
+
///
- /// lnkExcel control.
+ /// Control ddlTipoAutenticacion.
///
///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList ddlTipoAutenticacion;
+
+ ///
+ /// Control txtNombre.
+ ///
+ ///
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtNombre;
+
+ ///
+ /// Control txtApellido.
+ ///
+ ///
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtApellido;
+
+ ///
+ /// Control ddlHabilitados.
+ ///
+ ///
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList ddlHabilitados;
+
+ ///
+ /// Control lnkExcel.
+ ///
+ ///
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
///
protected global::System.Web.UI.WebControls.LinkButton lnkExcel;
-
+
+ ///
+ /// Control btnBuscar.
+ ///
+ ///
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
+ ///
+ protected global::System.Web.UI.WebControls.Button btnBuscar;
+
+ ///
+ /// Control btnAgregar.
+ ///
+ ///
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
+ ///
+ protected global::System.Web.UI.WebControls.Button btnAgregar;
+
+ ///
+ /// Control pnlLista.
+ ///
+ ///
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
+ ///
+ protected global::System.Web.UI.WebControls.Panel pnlLista;
+
+ ///
+ /// Control CantidadRegistros.
+ ///
+ ///
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
+ ///
+ protected global::System.Web.UI.WebControls.Label CantidadRegistros;
+
+ ///
+ /// Control CurrentPageLabel.
+ ///
+ ///
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
+ ///
+ protected global::System.Web.UI.WebControls.Label CurrentPageLabel;
+
///
- /// gvLista control.
+ /// Control gvLista.
///
///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
///
protected global::System.Web.UI.WebControls.GridView gvLista;
}
diff --git a/WebLab/WebLab.csproj b/WebLab/WebLab.csproj
index ca1485e1..68e941f1 100644
--- a/WebLab/WebLab.csproj
+++ b/WebLab/WebLab.csproj
@@ -2013,24 +2013,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -2719,6 +2701,7 @@
+
diff --git a/WebLab/script/select2.custom.css b/WebLab/script/select2.custom.css
new file mode 100644
index 00000000..aa8eb144
--- /dev/null
+++ b/WebLab/script/select2.custom.css
@@ -0,0 +1,178 @@
+/* =========================================================
+ SELECT2 CUSTOM FIX
+ Compatible:
+ - Bootstrap 3
+ - Select2 v3.x
+ - ASP.NET WebForms
+ - jQuery UI 1.8.x
+ ========================================================= */
+
+
+/* ===============================
+ CONTENEDOR GENERAL
+ =============================== */
+
+.select2-container {
+ width: 100% !important;
+ font-size: 14px;
+}
+
+
+ /* ===============================
+ CAJA VISIBLE (INPUT)
+ =============================== */
+
+ .select2-container .select2-choice {
+ height: 34px !important;
+ line-height: 34px !important;
+ padding: 0 30px 0 12px !important;
+ border-radius: 4px !important;
+ box-sizing: border-box;
+ }
+
+
+/* ===============================
+ TEXTO SELECCIONADO
+ =============================== */
+
+.select2-chosen {
+ display: block !important;
+ width: 100% !important;
+ overflow: hidden !important;
+ text-overflow: ellipsis !important;
+ white-space: nowrap !important;
+}
+
+
+/* ===============================
+ FLECHA DERECHA
+ =============================== */
+
+.select2-container .select2-choice .select2-arrow {
+ height: 34px !important;
+}
+
+
+/* ===============================
+ BUSCADOR INTERNO
+ =============================== */
+
+.select2-search input {
+ height: 28px !important;
+ box-sizing: border-box;
+}
+
+
+/* ===============================
+ DROPDOWN RESULTADOS
+ =============================== */
+
+.select2-drop {
+ font-size: 14px;
+}
+
+
+/* ===============================
+ ITEMS RESULTADOS
+ =============================== */
+
+.select2-results .select2-result-label {
+ padding: 6px 10px;
+}
+
+
+/* ===============================
+ ESTADO DISABLED
+ =============================== */
+
+.select2-container.select2-container-disabled .select2-choice {
+ background-color: #eeeeee !important;
+ cursor: not-allowed;
+}
+.select2-disabled {
+ pointer-events: none !important; /* bloquea interacción */
+ opacity: 0.6 !important; /* aspecto deshabilitado */
+}
+
+ /* cursor y flecha en apariencia de no permitido */
+ .select2-disabled .select2-choice {
+ cursor: not-allowed !important;
+ }
+
+ .select2-disabled .select2-choice .select2-arrow {
+ pointer-events: none !important;
+ }
+
+/* ===============================
+ EVITA SALTOS DE TAMAÑO
+ =============================== */
+
+.select2-container,
+.select2-choice,
+.select2-chosen {
+ max-width: 100% !important;
+}
+
+
+/* ===============================
+ CORRECCIÓN BOOTSTRAP 3
+ =============================== */
+
+.form-control + .select2-container {
+ width: 100% !important;
+}
+
+
+/* ===============================
+ TOOLTIP NATIVO (OPCIONAL)
+ =============================== */
+
+.select2-chosen {
+ cursor: default;
+}
+
+
+/* ===============================
+ FIX ANTIGUO SELECT2 V3
+ evita recalculo de ancho
+ =============================== */
+
+.select2-container .select2-choice > .select2-chosen {
+ margin-right: 26px !important;
+}
+
+
+/* =========================================================
+ FIX ESPECÍFICO: ddlEfector3 (ClientIDMode="Static")
+ Forzar ancho fijo para evitar cambios al escribir/seleccionar
+ ========================================================= */
+
+/* Ajusta este valor al ancho que quieras (200px según tu markup) */
+#s2id_ddlEfector3.select2-container,
+#ddlEfector3 + .select2-container {
+ width: 500px !important;
+ min-width: 500px !important;
+ max-width: 500px !important;
+}
+
+ /* Asegura que la caja visible y el texto interno respeten el ancho fijo */
+ #s2id_ddlEfector3 .select2-choice,
+ #ddlEfector3 + .select2-container .select2-choice {
+ width: 100% !important;
+ box-sizing: border-box;
+ }
+
+ /* Limita el ancho del texto seleccionado para que no empuje elementos */
+ #s2id_ddlEfector3 .select2-chosen,
+ #ddlEfector3 + .select2-container .select2-chosen {
+ max-width: calc(100% - 36px) !important; /* deja espacio para flecha/clear */
+ overflow: hidden !important;
+ text-overflow: ellipsis !important;
+ white-space: nowrap !important;
+ }
+
+/* Asegura ancho fijo del dropdown (por si se renderiza fuera del contenedor) */
+.select2-drop {
+ min-width: 500px !important;
+}
+
diff --git a/WebLabResultados/WebLabResultados.csproj b/WebLabResultados/WebLabResultados.csproj
index 93b6b3a2..3cf9890a 100644
--- a/WebLabResultados/WebLabResultados.csproj
+++ b/WebLabResultados/WebLabResultados.csproj
@@ -371,47 +371,16 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Web.config