本文整理汇总了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");
}
示例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});
}