void TopicService_Created(object sender, TopicEventArgs e) { if (e.Topic != null && e.Topic.MemberId > 0) { var ms = ApplicationContext.Current.Services.MemberService; var member = ms.GetById(e.Topic.MemberId); member.IncreaseForumPostCount(); ms.Save(member); Action a = new Action("NewTopic"); a.Perform(member.Id, e.Topic.Id, "New topic created"); } }
void CommentService_Created(object sender, CommentEventArgs e) { if (e.Comment != null && e.Comment.MemberId > 0) { var ms = ApplicationContext.Current.Services.MemberService; var member = ms.GetById(e.Comment.MemberId); member.IncreaseForumPostCount(); ms.Save(member); Action a = new Action("NewComment"); a.Perform(member.Id, e.Comment.Id, "New comment created"); } }