Example #1
0
        public CcRemoveSubscriptionResponse RemoveSubscription(CcRemoveSubscriptionRequest request)
        {
            var connection = new SqliteConnection(Settings.SQLiteConnectionString);
            PersistenceStorage.PersistentDataContext context = new PersistenceStorage.PersistentDataContext(connection);

            PersistenceStorage.Subscription subscription = context.Subscription.Where(x => x.ID == request.SubscriptionId).FirstOrDefault();
            if (subscription != null)
            {
                context.Subscription.DeleteOnSubmit(subscription);
                context.SubmitChanges();
            }

            CcRemoveSubscriptionResponse response = new CcRemoveSubscriptionResponse();
            return response;
        }
 public ActionResult RemoveSubscription(int subscriptionId)
 {
     try
     {
         CcRemoveSubscriptionRequest request = new CcRemoveSubscriptionRequest(Settings.Credentials);
         request.SubscriptionId = subscriptionId;
         EndPoints.CcDashboardService.RemoveSubscription(request);
         return RedirectToAction("Subscriptions");
     }
     catch (Exception e)
     {
         return ShowError(e);
     }
 }