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


C# Content.Set方法代码示例

本文整理汇总了C#中Content.Set方法的典型用法代码示例。如果您正苦于以下问题:C# Content.Set方法的具体用法?C# Content.Set怎么用?C# Content.Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Content的用法示例。


在下文中一共展示了Content.Set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RequestApproval

        public ActionResult RequestApproval(int contentID)
        {
            var content = new Content(contentID)
            {
                CurrentStatus = Convert.ToChar(SiteEnums.ContentStatus.P.ToString()),
                UpdatedByUserID = Convert.ToInt32(_mu.ProviderUserKey)
            };
            content.Set();

            var dm = new DirectMessage { IsRead = false };
            if (_mu != null) dm.FromUserAccountID = Convert.ToInt32(_mu.ProviderUserKey);
            var admin = new UserAccount(GeneralConfigs.AdminUserName);

            dm.ToUserAccountID = admin.UserAccountID;
            dm.Message = "Content To Approve: " + content.PreviewLink;
            if (_mu != null)
            {
                var currentUserId = Convert.ToInt32(_mu.ProviderUserKey);

                // ignore low quality users
                if (currentUserId == 18136) return RedirectToAction("Articles");

                dm.CreatedByUserID = currentUserId;
                dm.Create();
            }

            var uad = new UserAccountDetail();
            uad.GetUserAccountDeailForUser(admin.UserAccountID);

            if (uad.EmailMessages)
            {
                _mail.SendMail(
                    AmazonCloudConfigs.SendFromEmail,
                    admin.EMail, string.Format("{0}: {1}", Messages.From, _mu.UserName), dm.Message);
            }

            return RedirectToAction("Articles");
        }
开发者ID:dasklub,项目名称:kommunity,代码行数:38,代码来源:AccountContentController.cs

示例2: DeleteVideo

        public ActionResult DeleteVideo(int? id)
        {
            var model = new Content(Convert.ToInt32(id));

            var s3 = new S3Service
            {
                AccessKeyID = AmazonCloudConfigs.AmazonAccessKey,
                SecretAccessKey = AmazonCloudConfigs.AmazonSecretKey
            };

            if (!string.IsNullOrWhiteSpace(model.ContentVideoURL) &&
                s3.ObjectExists(AmazonCloudConfigs.AmazonBucketName, model.ContentVideoURL))
            {
                s3.DeleteObject(AmazonCloudConfigs.AmazonBucketName, model.ContentVideoURL);

                model.ContentVideoURL = string.Empty;
                model.Set();
            }

            if (!string.IsNullOrWhiteSpace(model.ContentVideoURL2) &&
                s3.ObjectExists(AmazonCloudConfigs.AmazonBucketName, model.ContentVideoURL2))
            {
                s3.DeleteObject(AmazonCloudConfigs.AmazonBucketName, model.ContentVideoURL2);

                model.ContentVideoURL2 = string.Empty;
                model.Set();
            }

            return RedirectToAction("EditArticle", new {@id = model.ContentID});
        }
开发者ID:dasklub,项目名称:kommunity,代码行数:30,代码来源:AccountController.cs


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