Пример #1
0
        private void LoadInfo()
        {
            var manager = new CustomerPointsManager(HccApp.CurrentRequestContext);

            var pointsIssued = manager.TotalPointsIssuedForStore(HccApp.CurrentStore.Id);

            lblPointsIssued.Text      = pointsIssued.ToString();
            lblPointsIssuedValue.Text = manager.DollarCreditForPoints(pointsIssued).ToString("c");

            var pointsReserverd = manager.TotalPointsReservedForStore(HccApp.CurrentStore.Id);

            lblPointsReserved.Text      = pointsReserverd.ToString();
            lblPointsReservedValue.Text = manager.DollarCreditForPoints(pointsReserverd).ToString("c");

            RewardsNameField.Text              = HccApp.CurrentStore.Settings.RewardsPointsName;
            chkEnableRewardsPoints.Checked     = HccApp.CurrentStore.Settings.RewardsPointsEnabled;
            chkUseForUserPrice.Checked         = HccApp.CurrentStore.Settings.UseRewardsPointsForUserPrice;
            chkIssuePointsForUserPrice.Checked = HccApp.CurrentStore.Settings.IssuePointsForUserPrice;
            PointsCreditField.Text             = HccApp.CurrentStore.Settings.RewardsPointsNeededPerDollarCredit.ToString();
            PointsPerDollarField.Text          = HccApp.CurrentStore.Settings.RewardsPointsIssuedPerDollarSpent.ToString();
        }
Пример #2
0
        private void LoadInfo()
        {
            CustomerPointsManager manager = CustomerPointsManager.InstantiateForDatabase(MTApp.CurrentStore.Settings.RewardsPointsIssuedPerDollarSpent,
                                                                                         MTApp.CurrentStore.Settings.RewardsPointsNeededPerDollarCredit,
                                                                                         MTApp.CurrentStore.Id);

            int pointsIssued = manager.TotalPointsIssuedForStore(MTApp.CurrentStore.Id);

            this.lblPointsIssued.Text      = pointsIssued.ToString();
            this.lblPointsIssuedValue.Text = manager.DollarCreditForPoints(pointsIssued).ToString("c");

            int pointsReserverd = manager.TotalPointsReservedForStore(MTApp.CurrentStore.Id);

            this.lblPointsReserved.Text      = pointsReserverd.ToString();
            this.lblPointsReservedValue.Text = manager.DollarCreditForPoints(pointsReserverd).ToString("c");

            this.RewardsNameField.Text        = MTApp.CurrentStore.Settings.RewardsPointsName;
            this.chkPointForDollars.Checked   = MTApp.CurrentStore.Settings.RewardsPointsOnPurchasesActive;
            this.chkPointsForProducts.Checked = MTApp.CurrentStore.Settings.RewardsPointsOnProductsActive;
            this.PointsCreditField.Text       = MTApp.CurrentStore.Settings.RewardsPointsNeededPerDollarCredit.ToString();
            this.PointsPerDollarField.Text    = MTApp.CurrentStore.Settings.RewardsPointsIssuedPerDollarSpent.ToString();
        }