本文整理汇总了C#中Attachment.IsBuyed方法的典型用法代码示例。如果您正苦于以下问题:C# Attachment.IsBuyed方法的具体用法?C# Attachment.IsBuyed怎么用?C# Attachment.IsBuyed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attachment
的用法示例。
在下文中一共展示了Attachment.IsBuyed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
int attachmentID = _Request.Get<int>("attachmentID", Method.Get, 0);
if (attachmentID < 1)
ShowError(new InvalidParamError("attachmentID").Message);
attachment = PostBOV5.Instance.GetAttachment(attachmentID, false);
if (attachment == null)
ShowError("该附件不存在或者已被删除!");
PostV5 post = PostBOV5.Instance.GetPost(attachment.PostID, false);
if (post == null)
{
ShowError("该附件不存在或者已被删除!");
}
ForumPermissionSetNode permission = AllSettings.Current.ForumPermissionSet.Nodes.GetPermission(post.ForumID);
if (post.UserID != MyUserID && (!permission.Can(My, ForumPermissionSetNode.Action.AlwaysViewContents)))
{
if (!attachment.IsBuyed(My))
{
ShowError("您还没有购买此附件,不能查看购买记录!");
}
}
TradePoint = ForumPointAction.Instance.GetUserPoint(post.UserID, ForumPointValueType.SellAttachment, post.ForumID);
int pageNumber = _Request.Get<int>("page",Method.Get,1);
ExchangeList = PostBOV5.Instance.GetAttachmentExchanges(attachmentID, pageNumber, pageSize, out totalCount, out totalMoney);
WaitForFillSimpleUsers<AttachmentExchange>(ExchangeList);
SetPager("list", null, pageNumber, pageSize, totalCount);
}
示例2: ProcessAttach
private static string ProcessAttach(Attachment attachment, AuthUser operatorUser, ForumSettingItem forumSetting, bool canAlwaysViewContents)
{
if (attachment.Price == 0 || canAlwaysViewContents || attachment.UserID == operatorUser.UserID || attachment.IsBuyed(operatorUser) || attachment.IsOverSellDays(forumSetting))
{
return GetAttachUrl(attachment);
}
else//附件没购买,不显示。
{
return GetMustBuyFileLink(attachment.FileName);
}
}
示例3: isShowAttachmentImage
protected bool isShowAttachmentImage(Attachment attachment)
{
if (attachment.IsInContent)
return false;
if (IsImage(attachment.FileType, attachment.UserID))
{
if (attachment.Price > 0)
{
if (attachment.UserID == MyUserID || attachment.IsBuyed(My) || AlwaysViewContents || IsOverSellAttachmentDays(attachment))
return true;
}
else
return true;
}
return false;
}