public bool Delete(Activity activity) { if (activity == null) return false; this.dbContext.Activities.Remove(activity); int result = dbContext.SaveChanges(); return result > 0; }
public void LogProjectCreation(Project project) { Activity act = new Activity(); act.ProjectId = project.Id; act.Who = project.Creator; act.When = DateTime.Now; act.Type = ActivityType.Create | ActivityType.Project; repoActivity.Create(act); notifyProjectCreation(project); }
public void LogFileCreation(ProjectFile file) { Activity act = new Activity(); act.FileId = file.Id; act.ProjectId = file.ProjectId; act.Who = file.Creator; act.When = DateTime.Now; act.Type = ActivityType.Create | ActivityType.File; repoActivity.Create(act); notifyFileCreation(file); }
public void LogCommentCreation(Comment newComment) { Activity act = new Activity(); act.Who = newComment.Creator; act.CommentId = newComment.Id; act.ProjectId = newComment.ProjectId; act.FileId = newComment.FileId; act.When = DateTime.Now; act.Type = ActivityType.Create | ActivityType.Comment; repoActivity.Create(act); notifyCommentCreation(newComment); }
public bool Create(Activity activity) { dbContext.Activities.Add(activity); int result = dbContext.SaveChanges(); return (result > 0); }