Esempio n. 1
0
        private void Find()
        {
            try
            {
                _logger.Action("UserX", Request.Url.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name,
                               DateTime.Now);

                string filter;
                int    pageNumber;
                GetParameters(out filter, out pageNumber);

                //Set hidden field to help Paginator Item on Aspx page.
                hfCurrentPage.Value = pageNumber.ToString();
                string          responseMessage = string.Empty;
                SearchResultDTO searchResult    = _itemApplication.SearchItems(filter, (pageNumber - 1) * _itemsPerPage, _itemsPerPage, ref responseMessage);

                BindResults(searchResult, responseMessage);
            }
            catch (Exception ex)
            {
                rpItems.Visible      = false;
                divNoResults.Visible = true;
                _logger.Error(ex);
            }
        }
Esempio n. 2
0
        // GET
        public IActionResult Index(string filter)
        {
            string responseMessage = string.Empty;
            var    searchResult    = _itemApplication.SearchItems(filter, null, null, ref responseMessage);

            if (searchResult == null)
            {
                return(Content(responseMessage));
            }

            if (searchResult.Results.Count > 0)
            {
                return(View(searchResult.Results));
            }
            else
            {
                return(Content("No hay ítems que coincidan con tu búsqueda."));
            }
        }