コード例 #1
0
        public IHttpActionResult GetListarBusqueda(bool conStock, int subcategoria, string textoBuscar, int cliente, int numeroPagina, int cantidadRegistros)
        {
            try
            {
                ServiciosProductos servicio               = new ServiciosProductos();
                ServicioGenerico   servGenerico           = new ServicioGenerico();
                string             estamosEnMantenimiento = servGenerico.ParametroObtenerValor("HOST_EN_MANTENIMIENTO");

                ProductoList resp = null;

                if (estamosEnMantenimiento.Equals("SI"))
                {
                    resp = servicio.ProductoListarEstamosEnMantenimiento();
                }
                else
                {
                    resp = servicio.ProductoListarCarrito(conStock, subcategoria, textoBuscar, cliente, numeroPagina, cantidadRegistros);
                }

                //LoggerHelper.LogInfo(System.Reflection.MethodBase.GetCurrentMethod(), JsonConvert.SerializeObject(resp));

                if (resp == null)
                {
                    return(NotFound());
                }
                return(Ok(resp));
            }
            catch (Exception ex)
            {
                LoggerHelper.LogError(MethodBase.GetCurrentMethod(), ex);
                return(BadRequest(ex.GetExceptionOriginal().Message));
            }
        }
コード例 #2
0
        private string DamePathFoto()
        {
            ServicioGenerico servicio = new ServicioGenerico();

            string pathFotos      = string.Empty;
            string paramsPathFoto = servicio.ParametroObtenerValor("PATH_FOTOS");

            if (paramsPathFoto != null)
            {
                pathFotos = paramsPathFoto;
            }
            else
            {
                pathFotos = "~/assets/fotos/";
            }

            return(pathFotos);
        }