示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(CategoryId))
            {
                var categoryRepo = Factory.CreateRepo <CategoryRepository>();
                var category     = categoryRepo.Find(CategoryId);
                if (category != null)
                {
                    var currentStore = HccRequestContext.Current.CurrentStore;

                    lblCategoryName.Text   = category.Name;
                    lblLastModifiedOn.Text =
                        DateHelper.ConvertUtcToStoreTime(currentStore, category.LastUpdatedUtc).ToString("MMM dd, yyyy");
                    var performanceUserSelections = new PerformanceUserSelections();
                    ddlRowPeriod.SelectedValue = performanceUserSelections.CategoriesPerformacePeriod.ToString();
                }
            }
        }
示例#2
0
        public object GetCategoryPerformanceData(HttpRequest request, HotcakesApplication hccApp)
        {
            var categoryId = request.Params["categoryId"];
            var period     = (SalesPeriod)Enum.Parse(typeof(SalesPeriod), request.Params["period"]);

            // Update setting only if it is different
            var performanceUserSelections = new PerformanceUserSelections();

            if (performanceUserSelections.CategoriesPerformacePeriod != period)
            {
                performanceUserSelections.CategoriesPerformacePeriod = period;
            }

            var reportingService = Factory.CreateService <ReportingService>();
            var performanceInfo  = reportingService.GetCategoryPerformance(categoryId, period);

            return(new PerformanceInfoJson(performanceInfo, period, Localization));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(ProductId))
            {
                var productRepo = Factory.CreateRepo <ProductRepository>();
                var product     = productRepo.FindWithCache(ProductId);
                if (product != null)
                {
                    var currentStore = HccRequestContext.Current.CurrentStore;

                    lblProductName.Text    = product.ProductName;
                    lblLastModifiedOn.Text =
                        DateHelper.ConvertUtcToStoreTime(currentStore, product.LastUpdated).ToString("MMM dd, yyyy");
                    lblCreatedOn.Text =
                        DateHelper.ConvertUtcToStoreTime(currentStore, product.CreationDateUtc).ToString("MMM dd, yyyy");

                    var performanceUserSelections = new PerformanceUserSelections();
                    ddlRowPeriod.SelectedValue = performanceUserSelections.ProductsPerformacePeriod.ToString();
                }
            }
        }