private static void AddSubscriptionToTable(DataTable table, Subscription subscription) { table.Rows.Add(new object[] { subscription.SubscriptionId, subscription.UserId, subscription.PortalId, subscription.SubscriptionTypeId, subscription.ObjectKey, subscription.Description, subscription.CreatedOnDate, subscription.ModuleId, subscription.TabId }); }
public HttpResponseMessage DeleteContentSubscription(Subscription subscription) { try { var sub = SubscriptionController.Instance.GetUserSubscriptions(UserInfo, PortalSettings.PortalId) .SingleOrDefault(s => s.SubscriptionId == subscription.SubscriptionId); if (sub != null) { SubscriptionController.Instance.DeleteSubscription(sub); } return Request.CreateResponse(HttpStatusCode.OK, "unsubscribed"); } catch (Exception ex) { Exceptions.LogException(ex); return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); } }
private static SubscriptionViewModel GetSubscriptionViewModel(Subscription subscription) { return new SubscriptionViewModel { SubscriptionId = subscription.SubscriptionId, Description = subscription.Description, SubscriptionType = SubscriptionTypeController.Instance.GetSubscriptionType( t => t.SubscriptionTypeId == subscription.SubscriptionTypeId).FriendlyName }; }
private static SubscriptionViewModel GetSubscriptionViewModel(Subscription subscription) { var model = new SubscriptionViewModel { SubscriptionId = subscription.SubscriptionId, Description = subscription.Description, }; // localize the type name var subscriptionType = SubscriptionTypeController.Instance.GetSubscriptionType( t => t.SubscriptionTypeId == subscription.SubscriptionTypeId); if (subscriptionType != null) { var localizedName = Localization.GetString(subscriptionType.SubscriptionName, ViewControlResources); model.SubscriptionType = localizedName ?? subscriptionType.FriendlyName; } return model; }