当前位置: 首页>>代码示例>>C#>>正文


C# Attachment.IsBuyed方法代码示例

本文整理汇总了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);
        }
开发者ID:huchao007,项目名称:bbsmax,代码行数:36,代码来源:attachmentexchanges.aspx.cs

示例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);
     }
 }
开发者ID:huchao007,项目名称:bbsmax,代码行数:11,代码来源:PostUbbParserV5.cs

示例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;
 }
开发者ID:huchao007,项目名称:bbsmax,代码行数:16,代码来源:ThreadPageBase.cs


注:本文中的Attachment.IsBuyed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。