예제 #1
0
        public List<Evento> ObtenerListadoEventos(DateTime fechaInicial, DateTime fechaFinal, int codigoCentro, string usuario, short tipoEvento, string sortExpression)
        {
            try
            {
                Pagos acceso = new Pagos();
                ReporteEventos.PC_ReporteEventosDataTable datos = acceso.ReporteEventos(fechaInicial, fechaFinal, codigoCentro, usuario, tipoEvento, System.Web.HttpContext.Current.User.Identity.Name, System.Web.HttpContext.Current.Request.UserHostAddress);
                List<Evento> listadoEventos = null;

                if (datos != null && datos.Count > 0 && datos.Rows.Count > 0)
                {
                    listadoEventos = (from ReporteEventos.PC_ReporteEventosRow row in datos.Rows
                                      select new Evento
                                      {
                                          Descripcion = row.DescripcionEvento,
                                          FechaRegistro = row.FechaEvento,
                                          Login = row.Login,
                                          NombreUsuario = row.NombreUsuario,
                                          NumeroEnvio = row.IsNumeroEnvioNull() ? String.Empty : row.NumeroEnvio.ToString(),
                                          NumeroTransaccion = row.IsNumeroTransaccionNull() ? String.Empty : row.NumeroTransaccion.ToString(),
                                          TipoEvento = (EnumTipoEventoBitacora) row.TipoEvento,
                                      }).ToList();
                }

                return listadoEventos;
            }
            catch (Exception)
            {
                throw;
            }
        }