예제 #1
0
 /// <summary>
 /// Metodo para Guardar/Modificar una entidad IndicadorProducto
 /// </summary>
 /// <param name="info"></param>
 public int Guardar(IndicadorProductoInfo info)
 {
     try
     {
         Logger.Info();
         var indicadorProductoDAL = new IndicadorProductoDAL();
         int result = info.IndicadorProductoId;
         if (info.IndicadorProductoId == 0)
         {
             result = indicadorProductoDAL.Crear(info);
         }
         else
         {
             indicadorProductoDAL.Actualizar(info);
         }
         return(result);
     }
     catch (ExcepcionGenerica)
     {
         throw;
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="productoInfo"></param>
        /// <param name="estatus"></param>
        /// <returns></returns>
        internal List <IndicadorProductoInfo> ObtenerPorProductoId(ProductoInfo productoInfo, EstatusEnum estatus)
        {
            try
            {
                Logger.Info();
                var indicadorProductoDAL            = new IndicadorProductoDAL();
                List <IndicadorProductoInfo> result = indicadorProductoDAL.ObtenerPorProductoId(productoInfo, estatus);
                if (result != null)
                {
                    foreach (var indicadorProductoInfo in result)
                    {
                        if (indicadorProductoInfo.IndicadorInfo.IndicadorId > 0)
                        {
                            var indicadorBl = new IndicadorBL();
                            indicadorProductoInfo.IndicadorInfo = indicadorBl.ObtenerPorId(indicadorProductoInfo.IndicadorInfo);
                        }

                        indicadorProductoInfo.IsEditable = true;
                    }
                }
                return(result);
            }
            catch (ExcepcionGenerica)
            {
                throw;
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
            }
        }
예제 #3
0
 /// <summary>
 /// Obtiene un lista paginada
 /// </summary>
 /// <param name="pagina"></param>
 /// <param name="filtro"></param>
 /// <returns></returns>
 public ResultadoInfo <IndicadorProductoInfo> ObtenerPorPagina(PaginacionInfo pagina, IndicadorProductoInfo filtro)
 {
     try
     {
         Logger.Info();
         var indicadorProductoDAL = new IndicadorProductoDAL();
         ResultadoInfo <IndicadorProductoInfo> result = indicadorProductoDAL.ObtenerPorPagina(pagina, filtro);
         return(result);
     }
     catch (ExcepcionGenerica)
     {
         throw;
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
예제 #4
0
 /// <summary>
 /// Obtiene un indicador producto por clave
 /// de indicador y clave de producto
 /// </summary>
 /// <param name="indicadorProductoInfo"></param>
 /// <returns></returns>
 internal IndicadorProductoInfo ObtenerPorIndicadorProducto(IndicadorProductoInfo indicadorProductoInfo)
 {
     try
     {
         Logger.Info();
         var indicadorProductoDAL     = new IndicadorProductoDAL();
         IndicadorProductoInfo result = indicadorProductoDAL.ObtenerPorIndicadorProducto(indicadorProductoInfo);
         return(result);
     }
     catch (ExcepcionGenerica)
     {
         throw;
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
예제 #5
0
 /// <summary>
 /// Obtiene una lista filtrando por el estatus Activo = 1, Inactivo = 0
 /// </summary>
 /// <returns></returns>
 public IList <IndicadorProductoInfo> ObtenerTodos(EstatusEnum estatus)
 {
     try
     {
         Logger.Info();
         var indicadorProductoDAL             = new IndicadorProductoDAL();
         IList <IndicadorProductoInfo> result = indicadorProductoDAL.ObtenerTodos(estatus);
         return(result);
     }
     catch (ExcepcionGenerica)
     {
         throw;
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }