예제 #1
0
        /// <summary>
        ///     Obtiene un lista paginada
        /// </summary>
        /// <param name="pagina"></param>
        /// <param name="filtro"></param>
        /// <returns></returns>
        internal ResultadoInfo <VigilanciaInfo> ObtenerTransportistaPorPagina(PaginacionInfo pagina, VigilanciaInfo filtro)
        {
            ResultadoInfo <VigilanciaInfo> lista = null;

            try
            {
                Dictionary <string, object> parameters = AuxTransportistaVigilancia.ObtenerParametrosTransportistaPorPaginaCompleto(pagina, filtro);
                DataSet ds = Retrieve("[dbo].[Vigilancia_Transportista]", parameters);
                if (ValidateDataSet(ds))
                {
                    lista = MapTransportistaVigilanciaDAL.ObtenerTransportistaPorPaginaCompleto(ds);
                }
            }
            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);
            }
            return(lista);
        }
예제 #2
0
        /// <summary>
        ///     Obtiene un Organizacion por Id
        /// </summary>
        /// <returns></returns>
        internal VigilanciaInfo ObtenerPorID(int id)
        {
            VigilanciaInfo result = null;

            try
            {
                Logger.Info();

                Dictionary <string, object> parameters = AuxTransportistaVigilancia.ObtenerParametroPorID(id);
                DataSet ds = Retrieve("Vigilancia_Transportista_ObtenerPorID", parameters);
                if (ValidateDataSet(ds))
                {
                    result = MapTransportistaVigilanciaDAL.ObtenerPorID(ds);
                }
            }
            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);
            }
            return(result);
        }