public Migi.Framework.Models.ChangeResult AddCustomerSubscription(SubscriptionSave subscriptionToSave)
        {
            Migi.Framework.Models.ChangeResult result = new Migi.Framework.Models.ChangeResult();

            if (_subscriptionAccess.LoadCustomerSubscriptionByCustomerAndSeries(subscriptionToSave.CustomerId, subscriptionToSave.ComicBookSeriesId, DateTime.UtcNow) != null)
                result.AddErrorMessage("Customer is already subscribed to series");

            if (result.IsSuccess)
                _subscriptionAccess.SaveSubscription(subscriptionToSave.GetSubscriptionDataLayer());

            return result;
        }
Пример #2
0
        public Migi.Framework.Models.ChangeResult AddCustomerSubscription(SubscriptionSave subscriptionToSave)
        {
            Migi.Framework.Models.ChangeResult result = new Migi.Framework.Models.ChangeResult();

            if (_subscriptionAccess.LoadCustomerSubscriptionByCustomerAndSeries(subscriptionToSave.CustomerId, subscriptionToSave.ComicBookSeriesId, DateTime.UtcNow) != null)
            {
                result.AddErrorMessage("Customer is already subscribed to series");
            }

            if (result.IsSuccess)
            {
                _subscriptionAccess.SaveSubscription(subscriptionToSave.GetSubscriptionDataLayer());
            }

            return(result);
        }