Exemple #1
0
        /// <summary>
        ///     Obtiene un lista paginada
        /// </summary>
        /// <param name="pagina"></param>
        /// <param name="filtro"></param>
        /// <returns></returns>
        internal ResultadoInfo <ChoferInfo> ObtenerPorPagina(PaginacionInfo pagina, ChoferInfo filtro)
        {
            ResultadoInfo <ChoferInfo> lista = null;

            try
            {
                Dictionary <string, object> parameters = AuxChoferDAL.ObtenerParametrosPorPagina(pagina, filtro);
                DataSet ds = Retrieve("Chofer_ObtenerPorPagina", parameters);
                if (ValidateDataSet(ds))
                {
                    lista = MapChoferDAL.ObtenerPorPagina(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);
        }
Exemple #2
0
 /// <summary>
 /// Obtiene un registro de Chofer
 /// </summary>
 /// <param name="descripcion">Descripción de la Chofer</param>
 /// <returns></returns>
 internal ChoferInfo ObtenerPorDescripcion(string descripcion)
 {
     try
     {
         Logger.Info();
         Dictionary <string, object> parameters = AuxChoferDAL.ObtenerParametrosPorDescripcion(descripcion);
         DataSet    ds     = Retrieve("Chofer_ObtenerPorDescripcion", parameters);
         ChoferInfo result = null;
         if (ValidateDataSet(ds))
         {
             result = MapChoferDAL.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);
     }
 }
Exemple #3
0
        /// <summary>
        ///     Obtiene una lista de todos los choferes
        /// </summary>
        /// <returns></returns>
        internal List <ChoferInfo> ObtenerTodos()
        {
            List <ChoferInfo> result = null;

            try
            {
                Logger.Info();
                DataSet ds = Retrieve("Chofer_ObtenerTodos");
                if (ValidateDataSet(ds))
                {
                    result = MapChoferDAL.ObtenerTodos(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);
        }
Exemple #4
0
        /// <summary>
        ///     Obtiene una lista de Choferes filtrando por el estatus Activo = 1, Inactivo = 0
        /// </summary>
        /// <returns></returns>
        internal List <ChoferInfo> ObtenerTodos(EstatusEnum estatus)
        {
            try
            {
                Logger.Info();
                Dictionary <string, object> parameters = AuxChoferDAL.ObtenerTodos(estatus);
                DataSet           ds     = Retrieve("Chofer_ObtenerTodos", parameters);
                List <ChoferInfo> result = null;

                if (ValidateDataSet(ds))
                {
                    result = MapChoferDAL.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);
            }
        }
Exemple #5
0
        /// <summary>
        /// Obtiene un chofer por Id
        /// </summary>
        /// <returns></returns>
        internal ChoferInfo ObtenerPorID(ChoferInfo chofer)
        {
            ChoferInfo result = null;

            try
            {
                Logger.Info();
                Dictionary <string, object> parameters = AuxChoferVigilanciaDAL.ObtenerParametroPorID(chofer);
                DataSet ds = Retrieve("Vigilancia_Chofer_ObtenerPorID", parameters);
                if (ValidateDataSet(ds))
                {
                    result = MapChoferDAL.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);
        }