Exemplo n.º 1
0
        public async Task <IActionResult> GetMarcas(string pattern, int?skip)
        {
            var validateToken = await ValidatedToken(_configuration, _getHelper, "catalogo");

            if (validateToken != null)
            {
                return(null);
            }

            if (!await ValidateModulePermissions(_getHelper, moduloId, eTipoPermiso.PermisoEscritura))
            {
                return(null);
            }

            if (pattern == null || pattern == "" || skip == null)
            {
                return(null);
            }

            var marcas = await _getHelper.GetMarcasByPatternAsync(pattern, (int)skip);

            return(new PartialViewResult
            {
                ViewName = "_GetMarcas",
                ViewData = new ViewDataDictionary
                           <List <Marca> >(ViewData, marcas)
            });
        }