Exemplo n.º 1
0
        public ActionResult CancelSubscription(string msisdn, int portalId)
        {
            SubscriptionRepository subscriptionRepository = new SubscriptionRepository();
            Subscriber subscriber = subscriptionRepository.GetSubscriber(msisdn, portalId)
                                                          .SingleOrDefault();

            //get currency by Portal
            Portal currentPortal = SessionHandler
                                   .UserInfo
                                   .Portals
                                   .Where(p => p.Id == portalId)
                                   .FirstOrDefault();

            string currency = currentPortal.Currency;
            string remark = currentPortal.CancelRemark;
            //execute cancel subscription
            subscriptionRepository.CancelSubscription(subscriber.ID, currency, remark);

            string redirectURL = Request.UrlReferrer.AbsolutePath + "?msisdn=" + msisdn;
            redirectURL += "&portal=" + portalId.ToString();

            return new RedirectResult(redirectURL);
        }
Exemplo n.º 2
0
        private SubscriptionList GetSubscription(string msisdn, int portalId, int? page)
        {
            if (page == null) page = 0;

            SubscriptionRepository subscriptionRepository = new SubscriptionRepository();

            var transactions = subscriptionRepository.GetSubscriptionActivity(msisdn, portalId);

            var subscriber = subscriptionRepository.GetSubscriber(msisdn, portalId).ToList();

            //var subscribersList = new List<Subscriber>(subscriber);
            var paginatedSubscriptions = new PaginatedList<SubscriptionActivity>(transactions,
                                                                                (int)page,
                                                                                Settings.PageSize);
            var model = new SubscriptionList(paginatedSubscriptions, msisdn, subscriber);
            model.PortalId = portalId;

            return model;
        }