public void RefrescarFiltrado() { string condicion_filtro = CONDICION_FIJA; switch (SITUACIONESELECCIONADA) { case "Abierto": condicion_filtro += " AND pa.cerrado = 0"; break; case "Cerrado": condicion_filtro += " AND pa.cerrado = 1"; break; default: condicion_filtro += " AND pa.cerrado IN (0,1)"; break; } string patron = @"^[0-9]*$"; Regex pa = new Regex(patron); if (NUMEROPEDIDO != null && NUMEROPEDIDO.Trim(' ').Length > 0 && pa.IsMatch(NUMEROPEDIDO)) { condicion_filtro += " AND pe.idPedido = " + NUMEROPEDIDO; } if (NOMBRE != null && NOMBRE.Trim(' ').Length > 0) { condicion_filtro += " AND em.nombre LIKE '%" + NOMBRE + "%'"; } if (APELLIDOS != null && APELLIDOS.Trim(' ').Length > 0) { condicion_filtro += " AND em.apellidos LIKE '%" + APELLIDOS + "%'"; } if (AÑOSELECCIONADO != null && AÑOSELECCIONADO.Length > 0) { condicion_filtro += " AND YEAR(pa.fechaIntroduccion) = " + Convert.ToInt32(AÑOSELECCIONADO); } if (MESSELECCIONADO != null && MESSELECCIONADO.Length > 0) { condicion_filtro += " AND MONTH(pa.fechaIntroduccion) = " + Convert.ToInt32(MESSELECCIONADO); } PARTES = bbdd.ObtenerPartes(condicion_filtro, PEDIDO.IDPEDIDO, false); }
public void RefrescarFiltrado() { string condicion_filtro = CONDICION_FIJA; string patron = @"^[0-9]*$"; Regex pa = new Regex(patron); if (NUMEROPEDIDO != null && NUMEROPEDIDO.Trim(' ').Length > 0 && pa.IsMatch(NUMEROPEDIDO)) { condicion_filtro += " AND pe.idPedido = " + NUMEROPEDIDO; } if (AÑOSELECCIONADO != null && AÑOSELECCIONADO.Length > 0) { condicion_filtro += " AND YEAR(pe.fechaIntroduccion) = " + Convert.ToInt32(AÑOSELECCIONADO); } if (MESSELECCIONADO != null && MESSELECCIONADO.Length > 0) { condicion_filtro += " AND MONTH(pe.fechaIntroduccion) = " + Convert.ToInt32(MESSELECCIONADO); } if (SITUACIONESELECCIONADA.IDSITUACION != 0) { condicion_filtro += " AND pe.situacion = '" + SITUACIONESELECCIONADA.IDSITUACION + "'"; } if (TIPOPEDIDOESELECCIONADA.IDTIPO != 0) { condicion_filtro += " AND pe.tipoPedido = '" + TIPOPEDIDOESELECCIONADA.IDTIPO + "'"; } if (TELEFONO != null && TELEFONO.Trim(' ').Length > 0) { condicion_filtro += " AND pe.telefono LIKE '%" + TELEFONO + "%'"; } if (POBLACION != null && POBLACION.Trim(' ').Length > 0) { condicion_filtro += " AND pe.poblacion LIKE '%" + POBLACION + "%'"; } PEDIDOS = bbdd.ObtenerPedidos(condicion_filtro, false); }