public async Task <ActionResult> Load(int id)
        {
            GetPriceListLinkByIdQueryResult result = Query.For <GetPriceListLinkByIdQueryResult>().ById(id);

            if (!result.IsFound)
            {
                return(HttpNotFound());
            }

            string document = await GetDocument(result.Link.Url);

            return(Content(document));
        }
        public async Task <ActionResult> Price(int id)
        {
            GetPriceListLinkByIdQueryResult result = Query.For <GetPriceListLinkByIdQueryResult>().ById(id);

            if (!result.IsFound)
            {
                return(Redirect("/"));
            }

            PriceListLinkViewModel vm = ToViewModel(result.Link);

            vm.HtmlContent = await GetDocument(vm.Url);

            return(View(vm));
        }
        public ActionResult Index(int?id = null)
        {
            FindAllPriceListLinksQueryResult items = Query.For <FindAllPriceListLinksQueryResult>().Empty();

            IndexViewModel vm = new IndexViewModel
            {
                AddLink      = new AddPriceListLinkViewModel(),
                EditLink     = null,
                ActiveLinks  = items.ActiveLinks.Select(ToViewModel).ToList(),
                DeletedLinks = items.DeletedLinks.Select(ToViewModel).ToList()
            };

            if (id.HasValue)
            {
                GetPriceListLinkByIdQueryResult result = Query.For <GetPriceListLinkByIdQueryResult>().ById(id.Value);

                if (result.IsFound)
                {
                    vm.EditLink = ToEditViewModel(result.Link);
                }
            }

            return(View(vm));
        }