Example #1
0
 /// <summary>
 /// Obtiene un lista paginada
 /// </summary>
 /// <param name="pagina"></param>
 /// <param name="filtro"></param>
 /// <returns></returns>
 internal ResultadoInfo <TrampaInfo> ObtenerPorPagina(PaginacionInfo pagina, TrampaInfo filtro)
 {
     try
     {
         Dictionary <string, object> parameters = AuxTrampaDAL.ObtenerParametrosPorPagina(pagina, filtro);
         DataSet ds = Retrieve("Trampa_ObtenerPorPagina", parameters);
         ResultadoInfo <TrampaInfo> result = null;
         if (ValidateDataSet(ds))
         {
             result = MapTrampaDAL.ObtenerPorPagina(ds);
         }
         return(result);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
Example #2
0
 /// <summary>
 /// Metrodo Para obtener la trampa
 /// </summary>
 internal TrampaInfo ObtenerTrampa(TrampaInfo trampaInfo)
 {
     try
     {
         Logger.Info();
         var        parameters = AuxTrampaDAL.ObtenerParametrosObtenerTrampa(trampaInfo);
         var        ds         = Retrieve("Trampa_ObtenerOrganizacionTipoHostName", parameters);
         TrampaInfo result     = null;
         if (ValidateDataSet(ds))
         {
             result = MapTrampaDAL.ObtenerObtenerTrampa(ds);
         }
         return(result);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
Example #3
0
 /// <summary>
 /// Obtiene un registro de Trampa
 /// </summary>
 /// <param name="hostName">hostName de la Trampa</param>
 /// <returns></returns>
 internal TrampaInfo ObtenerPorHostName(string hostName)
 {
     try
     {
         Logger.Info();
         var parametros = new Dictionary <string, object> {
             { "@HostName", hostName }
         };
         DataSet    ds     = Retrieve("Trampa_ObtenerPorHostName", parametros);
         TrampaInfo result = null;
         if (ValidateDataSet(ds))
         {
             result = MapTrampaDAL.ObtenerPorDescripcion(ds);
         }
         return(result);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
Example #4
0
 /// <summary>
 /// Obtiene una entidad por su Organizacion
 /// </summary>
 /// <param name="organizacionID"></param>
 /// <returns></returns>
 internal List <TrampaInfo> ObtenerPorOrganizacion(int organizacionID)
 {
     try
     {
         Logger.Info();
         Dictionary <string, object> parameters = AuxTrampaDAL.ObtenerParametrosPorOrganizacion(organizacionID);
         DataSet           ds     = Retrieve("Trampa_ObtenerPorOrganizacion", parameters);
         List <TrampaInfo> result = null;
         if (ValidateDataSet(ds))
         {
             result = MapTrampaDAL.ObtenerPorOrganizacion(ds);
         }
         return(result);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
Example #5
0
 /// <summary>
 /// Obtiene una lista filtrando por el estatus Activo = 1, Inactivo = 0
 /// </summary>
 /// <returns></returns>
 internal IList <TrampaInfo> ObtenerTodos(EstatusEnum estatus)
 {
     try
     {
         Logger.Info();
         Dictionary <string, object> parameters = AuxTrampaDAL.ObtenerTodos(estatus);
         DataSet            ds     = Retrieve("Trampa_ObtenerTodos", parameters);
         IList <TrampaInfo> result = null;
         if (ValidateDataSet(ds))
         {
             result = MapTrampaDAL.ObtenerTodos(ds);
         }
         return(result);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
Example #6
0
 /// <summary>
 /// Obtiene una lista de Trampa
 /// </summary>
 /// <returns></returns>
 internal IList <TrampaInfo> ObtenerTodos()
 {
     try
     {
         Logger.Info();
         DataSet            ds     = Retrieve("Trampa_ObtenerTodos");
         IList <TrampaInfo> result = null;
         if (ValidateDataSet(ds))
         {
             result = MapTrampaDAL.ObtenerTodos(ds);
         }
         return(result);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }