public virtual ActionResult Details(Guid id, ActivityFeedOptions options) { var bulletin = _bulletinsService.Get(id); var model = GetViewModel(bulletin, options); AddEntityIdentityForContext(id); return(PartialView(DetailsViewPath, model)); }
public virtual BulletinsBackofficeViewModel Create(BulletinsBackofficeCreateModel createModel) { var creatingBulletin = createModel.Map <BulletinBase>(); creatingBulletin.CreatorId = creatingBulletin.OwnerId = _intranetMemberService.GetCurrentMemberId(); var bulletinId = _bulletinsService.Create(creatingBulletin); var createdBulletin = _bulletinsService.Get(bulletinId); var result = createdBulletin.Map <BulletinsBackofficeViewModel>(); return(result); }
protected override void OnBulletinCreated(BulletinBase bulletin, BulletinCreateModel model) { base.OnBulletinCreated(bulletin, model); var groupId = Request.QueryString.GetGroupId(); if (groupId.HasValue) { _groupActivityService.AddRelation(groupId.Value, bulletin.Id); var extendedBulletin = _bulletinsService.Get(bulletin.Id); extendedBulletin.GroupId = groupId; } if (model is BulletinExtendedCreateModel extendedModel) { _activityTagsHelper.ReplaceTags(bulletin.Id, extendedModel.TagIdsData); } }
protected override void OnBulletinCreated(BulletinBase bulletin, BulletinCreateModel model) { base.OnBulletinCreated(bulletin, model); var groupId = Request.QueryString.GetGroupIdOrNone(); groupId.IfSome(id => _groupActivityService.AddRelation(id, bulletin.Id)); var extendedBulletin = _bulletinsService.Get(bulletin.Id); extendedBulletin.GroupId = groupId.ToNullable(); if (model is BulletinExtendedCreateModel extendedModel) { _activityTagsHelper.ReplaceTags(bulletin.Id, extendedModel.TagIdsData); } if (string.IsNullOrEmpty(model.Description)) { return; } ResolveMentions(model.Description, bulletin); }