本文整理汇总了C#中UserModel.GetSubscriptionID方法的典型用法代码示例。如果您正苦于以下问题:C# UserModel.GetSubscriptionID方法的具体用法?C# UserModel.GetSubscriptionID怎么用?C# UserModel.GetSubscriptionID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserModel
的用法示例。
在下文中一共展示了UserModel.GetSubscriptionID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBillingDate
public DateTime? GetBillingDate(UserModel.User user)
{
try
{
var subscriptionID = user.GetSubscriptionID(User.Identity.Name);
if (subscriptionID != String.Empty)
{
Subscription subscription = Gateway.BrainTreeGateway.Subscription.Find(subscriptionID);
return subscription.NextBillingDate;
}
else
{
//Fail to retrieve Billing ID
return default(DateTime);
}
}
catch (Exception ex)
{
Logger.WriteErrorLog(ex);
return default(DateTime);
}
}
示例2: SaveSubscriptionInfo
public ActionResult SaveSubscriptionInfo(UserModel.User user)
{
if (ModelState.IsValid)
{
if (user.CancelSubscription(User.Identity.Name, user.CancelComments))
{
var subscriptionId = user.GetSubscriptionID(User.Identity.Name);
var result = Gateway.BrainTreeGateway.Subscription.Cancel(subscriptionId);
//Authentication
HttpCookie userNameCookie = new HttpCookie("QueueViewUserName");
DateTime now = DateTime.Now;
userNameCookie.Value = User.Identity.Name;
userNameCookie.Expires = now.AddDays(-1D);
Response.Cookies.Add(userNameCookie);
FormsAuthentication.SignOut();
}
else
{
//Fail
return RedirectToAction("Error", "User");
}
}
return RedirectToAction("CancelSuccess", "Home");
}
示例3: GetBillingStatus
public string GetBillingStatus(UserModel.User user)
{
try
{
var subscriptionID = user.GetSubscriptionID(User.Identity.Name);
if (subscriptionID != String.Empty)
{
Subscription subscription = Gateway.BrainTreeGateway.Subscription.Find(subscriptionID);
return subscription.Status.ToString();
}
else
{
//Fail to retrieve Billing ID
return string.Empty;
}
}
catch (Exception ex)
{
Logger.WriteErrorLog(ex);
return string.Empty;
}
}