コード例 #1
0
        public static UserPaymentPlanSubscriptionUpdatesTask Run(LcLogger logger)
        {
            var task = new UserPaymentPlanSubscriptionUpdatesTask();

            using (var db = new LcDatabase())
            {
                var list = LcRest.UserPaymentPlan.QueryActiveSubscriptions(db);
                task.UpdateFromGateway(list, logger);
            }

            task.TaskEnded = DateTime.Now;

            logger.Log("Elapsed time {0}, for {1} subscriptions processed, {2} records reviewed",
                       task.ElapsedTime, task.ItemsProcessed, task.ItemsReviewed);

            return(task);
        }
        public static UserPaymentPlanSubscriptionUpdatesTask Run(LcLogger logger)
        {
            var task = new UserPaymentPlanSubscriptionUpdatesTask();

            using (var db = new LcDatabase())
            {
                // Subcriptions that need udpate from Gateway
                var list = LcRest.UserPaymentPlan.QueryActiveSubscriptions(true, db);
                task.UpdateFromGateway(list, logger);
                // No-payment subscriptions, currently just partnership plans, that need manual check of due date
                task.EnforceDueDate(LcRest.UserPaymentPlan.QueryActiveSubscriptions(false, db), logger);
            }

            task.TaskEnded = DateTime.Now;

            logger.Log("Elapsed time {0}, for {1} subscriptions processed, {2} records reviewed",
                       task.ElapsedTime, task.ItemsProcessed, task.ItemsReviewed);

            return(task);
        }