protected override void OnBulletinEdited(BulletinBase bulletin, BulletinEditModel model) { if (model is BulletinExtendedEditModel extendedModel) { _activityTagsHelper.ReplaceTags(bulletin.Id, extendedModel.TagIdsData); } }
protected override void OnNewsEdited(NewsBase news, NewsEditModel model) { if (model is NewsExtendedEditModel extendedModel) { _activityTagsHelper.ReplaceTags(news.Id, extendedModel.TagIdsData); } }
public async Task <IHttpActionResult> Create(EventCreateModel createModel) { if (!await _eventsService.CanCreateAsync(createModel.GroupId)) { return(StatusCode(System.Net.HttpStatusCode.Forbidden)); } var @event = MapToEvent(createModel); var activityId = _eventsService.Create(@event); _reminderService.CreateIfNotExists(activityId, ReminderTypeEnum.OneDayBefore); @event = _eventsService.Get(activityId); if (createModel.GroupId.HasValue) { _groupActivityService.AddRelation(createModel.GroupId.Value, activityId); @event.GroupId = createModel.GroupId; } _activityTagsHelper.ReplaceTags(activityId, createModel.TagIdsData); ResolveMentions(createModel.Description, @event); var redirectUrl = _activityLinkService.GetLinks(activityId).Details; ReloadFeed(); return(Ok(redirectUrl)); }
protected override void OnNewsEdited(NewsBase news, NewsEditModel model) { if (model is NewsExtendedEditModel extendedModel) { _activityTagsHelper.ReplaceTags(news.Id, extendedModel.TagIdsData); } ResolveMentions(model.Description, news); }
protected override void OnBulletinEdited(BulletinBase bulletin, BulletinEditModel model) { if (model is BulletinExtendedEditModel extendedModel) { _activityTagsHelper.ReplaceTags(bulletin.Id, extendedModel.TagIdsData); } if (string.IsNullOrEmpty(model.Description)) { return; } ResolveMentions(model.Description, bulletin); }
protected override void OnEventCreated(Guid activityId, EventCreateModel model) { _reminderService.CreateIfNotExists(activityId, ReminderTypeEnum.OneDayBefore); var groupId = Request.QueryString.GetGroupId(); if (groupId.HasValue) { _groupActivityService.AddRelation(groupId.Value, activityId); var @event = _eventsService.Get(activityId); @event.GroupId = groupId; } if (model is EventExtendedCreateModel extendedModel) { _activityTagsHelper.ReplaceTags(activityId, extendedModel.TagIdsData); } }
protected override void OnEventCreated(Guid activityId, EventCreateModel model) { _reminderService.CreateIfNotExists(activityId, ReminderTypeEnum.OneDayBefore); var @event = _eventsService.Get(activityId); var groupId = Request.QueryString.GetGroupIdOrNone(); groupId.IfSome(id => _groupActivityService.AddRelation(id, activityId)); @event.GroupId = groupId.ToNullable(); if (model is EventExtendedCreateModel extendedModel) { _activityTagsHelper.ReplaceTags(activityId, extendedModel.TagIdsData); } ResolveMentions(model.Description, @event); }
private void OnBulletinEdited(SocialBase social, SocialEditModel model) { _activityTagsHelper.ReplaceTags(social.Id, model.TagIdsData); ResolveMentions(model.Description, social); }