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); } }
private void ShowItem() { try { _logger.Action("UserX", Request.Url.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, DateTime.Now); string id = (Page.Request.Params["id"]) == null ? string.Empty : Convert.ToString(Page.Request.Params["id"]); string responseMessage = string.Empty; ItemDTO itemDTO = _itemApplication.GetItem(id, ref responseMessage); if (itemDTO != null) { divNoItem.Visible = false; divItem.Visible = true; txtSoldQuantity.InnerText = itemDTO.SoldQuantity > 0 ? itemDTO.SoldQuantity.ToString() + " Vendidos" : ""; txtTitulo.InnerText = itemDTO.Title; txtPrecio.InnerText = "$ " + itemDTO.Price.ToString("N"); txtAvailableQuantity.InnerText = "(" + itemDTO.AvailableQuantity.ToString() + (itemDTO.AvailableQuantity == 1 ? " Disponible" : " Disponibles") + ")"; txtQuantity.Attributes.Add("max", itemDTO.AvailableQuantity.ToString()); txtDescription.InnerHtml = itemDTO.ItemLargeDescription.Replace("\n", "<br />"); rpCharacterists.DataSource = itemDTO.Attributes; rpCharacterists.DataBind(); rpCarouselControls.DataSource = itemDTO.PicturesUrl; rpCarouselControls.DataBind(); rpImages.DataSource = itemDTO.PicturesUrl; rpImages.DataBind(); } else { divNoItem.Visible = true; HtmlGenericControl messageToShow = new HtmlGenericControl(); messageToShow.TagName = "h2"; messageToShow.InnerHtml = responseMessage; divNoItem.Controls.Add(messageToShow); divItem.Visible = false; } } catch (Exception ex) { divNoItem.Visible = true; divItem.Visible = false; _logger.Error(ex); } }