コード例 #1
0
 public void UpdateSubscriptionPlan(SubscriptionPlan subscriptionPlan)
 {
     SubscriptionPlanOperations.UpdateSubscriptionPlan(subscriptionPlan);
 }
コード例 #2
0
 public SubscriptionPlan AddSubscriptionPlan(SubscriptionPlan subscriptionPlan)
 {
     return SubscriptionPlanOperations.AddSubscriptionPlan(subscriptionPlan);
 }
コード例 #3
0
 public SubscriptionPlan CreateSubscriptionPlan(SubscriptionPlan subscriptionPlan)
 {
     return SubscriptionPlanOperations.CreateSubscriptionPlan(subscriptionPlan);
 }
コード例 #4
0
        /// <summary>
        /// <para>Adds a subscription plan.</para>
        /// </summary>
        /// <param name="subscriptionPlan">A populated subscription plan object.</param>
        /// <returns>Returns a validation result object.</returns>
        internal IValidationResult AddSubscriptionPlan(SubscriptionPlan subscriptionPlan)
        {
            IValidationResult validationResult = new ValidationResult();

            // Validate the new subscription plan.
            validationResult = this.doctrineShipsValidation.SubscriptionPlan(subscriptionPlan);
            if (validationResult.IsValid == true)
            {
                // Add the new subscription plan.
                this.doctrineShipsRepository.CreateSubscriptionPlan(subscriptionPlan);
                this.doctrineShipsRepository.Save();

                // Log the addition.
                logger.LogMessage("Subscription Plan '" + subscriptionPlan.Name + "' Successfully Added.", 2, "Message", MethodBase.GetCurrentMethod().Name);
            }

            return validationResult;
        }
コード例 #5
0
 /// <summary>
 /// <para>Adds a subscription plan.</para>
 /// </summary>
 /// <param name="subscriptionPlan">A populated subscription plan object.</param>
 /// <returns>Returns a validation result object.</returns>
 public IValidationResult AddSubscriptionPlan(SubscriptionPlan subscriptionPlan)
 {
     return AccountManager.AddSubscriptionPlan(subscriptionPlan);
 }
コード例 #6
0
 internal void UpdateSubscriptionPlan(SubscriptionPlan subscriptionPlan)
 {
     subscriptionPlan.ObjectState = ObjectState.Modified;
     this.unitOfWork.Repository<SubscriptionPlan>().Update(subscriptionPlan);
 }
コード例 #7
0
 internal SubscriptionPlan CreateSubscriptionPlan(SubscriptionPlan subscriptionPlan)
 {
     subscriptionPlan.ObjectState = ObjectState.Added;
     this.unitOfWork.Repository<SubscriptionPlan>().Insert(subscriptionPlan);
     return subscriptionPlan;
 }
コード例 #8
0
 internal SubscriptionPlan AddSubscriptionPlan(SubscriptionPlan subscriptionPlan)
 {
     this.unitOfWork.Repository<SubscriptionPlan>().Insert(subscriptionPlan);
     return subscriptionPlan;
 }
コード例 #9
0
        internal IValidationResult SubscriptionPlan(SubscriptionPlan subscriptionPlan)
        {
            IValidationResult validationResult = new ValidationResult();

            // Null checks.
            if (subscriptionPlan.Name == null)
            {
                validationResult.AddError("Name.Null", "Name cannot be null.");
            }

            if (subscriptionPlan.Description == null)
            {
                validationResult.AddError("Description.Null", "Description cannot be null.");
            }

            // Range checks.
            if (subscriptionPlan.SalesAgentLimit < 1 || subscriptionPlan.SalesAgentLimit > 500)
            {
                validationResult.AddError("SalesAgentLimit.Range", "SalesAgentLimit is outside of expected ranges. SalesAgentLimit should be between 1 and 500.");
            }

            if (subscriptionPlan.PricePerMonth < 0 || subscriptionPlan.PricePerMonth > long.MaxValue)
            {
                validationResult.AddError("PricePerMonth.Range", "PricePerMonth can not be less than 0. Also, the upper limit cannot exceed the max value of the long data type.");
            }

            return validationResult;
        }
コード例 #10
0
 public IValidationResult SubscriptionPlan(SubscriptionPlan subscriptionPlan)
 {
     return AccountCheck.SubscriptionPlan(subscriptionPlan);
 }