Ejemplo n.º 1
0
        protected override void BindReport()
        {
            var utcStart = ucDateRangePicker.GetStartDateUtc(HccApp);
            var utcEnd   = ucDateRangePicker.GetEndDateUtc(HccApp);

            var t = HccApp.ReportingTopSellersByDate(utcStart, utcEnd, 10);

            ProductCount = t.Count;

            if (ProductCount > 0)
            {
                gvProducts.DataSource = t;
                gvProducts.DataBind();
            }

            ShowNoRecordsMessage(ProductCount == 0);
        }
Ejemplo n.º 2
0
        private List <SideMenuItem> LoadProducts(DateTime start, DateTime end)
        {
            var s = start;
            var e = end;

            var t = HccApp.ReportingTopSellersByDate(s, e, 10);

            var result = new List <SideMenuItem>();

            foreach (var p in t)
            {
                var item = new SideMenuItem
                {
                    Title = p.ProductName,
                    Name  = p.ProductName,
                    Url   = UrlRewriter.BuildUrlForProduct(p)
                };
                result.Add(item);
            }
            return(result);
        }
        public ActionResult Index()
        {
            var model = new SideMenuViewModel();

            var            s = new DateTime(1900, 1, 1);
            var            e = new DateTime(3000, 12, 31);
            List <Product> products;

            products = HccApp.ReportingTopSellersByDate(s, e, 10);
            foreach (var p in products)
            {
                var item = new SideMenuItem
                {
                    Title = p.ProductName,
                    Name  = p.ProductName,
                    Url   = UrlRewriter.BuildUrlForProduct(p)
                };
                item.Name += " - " + p.SitePrice.ToString("C");
                model.Items.Add(item);
            }

            model.Title = "Top Sellers";
            return(View(model));
        }