コード例 #1
0
        public ActionResult Reward()
        {
            var customer = _customerService.GetCustomerId(this.CustomerId);
            var reward   = customer.GetCustomerAttributeValue <int>(CustomerAttributeNames.Reward);
            var model    = new CustomerRewardModel();

            model.IsSign     = _signService.IsSign(this.CustomerId);
            model.Reward     = reward;
            model.CustomerId = customer.Id;
            return(PartialView(model));
        }
コード例 #2
0
        public ActionResult RewardHistory()
        {
            var customer = _customerService.GetCustomerId(this.CustomerId);
            var reward   = customer.GetCustomerAttributeValue <int>(CustomerAttributeNames.Reward);
            var model    = new CustomerRewardModel();

            model.Reward     = reward;
            model.CustomerId = customer.Id;
            var histories = _rewardService.GetAllCustomerRewards(customer: this.CustomerId, pageSize: 10);

            model.Histories = histories.Items.Select(h => h.MapTo <RewardHistoryModel>()).ToList();
            _signService.SignIn(this.CustomerId);
            return(PartialView(model));
        }
コード例 #3
0
        public ActionResult Reward(int pageIndex = 0, int pageSize = 30)
        {
            var customer  = GetCurrentCustomer();
            var model     = new CustomerRewardModel();
            var histories = customer.GetCustomerReward(_rewardPointService, pageIndex, pageSize);

            model.Reward = customer.GetCustomerAttributeValue <int>(CustomerAttributeNames.Reward);
            model.Items  = new Models.Common.PagedItemModel <RewardPointsHistoryModel>
            {
                PageIndex = pageIndex,
                PageSize  = pageSize,
                Total     = histories.TotalCount,
                Items     = histories.Items.MapTo <IList <RewardPointsHistoryModel> >()
            };
            return(View(model));
        }