Exemple #1
0
        public Activity SaveActivityForDueDate(int issueId, int teamId, int currentUserId)
        {
            var issue = repo.GetIssue(issueId);

            Activity activity = new Activity();

            activity.CreatedByID  = currentUserId;
            activity.OldState     = issue.Title;
            activity.NewState     = issue.DueDate.Value.ToShortDateString();
            activity.ObjectID     = issueId;
            activity.ObjectType   = "Issue";
            activity.ActivityDesc = "Due date updated";
            activity.TeamID       = teamId;
            var result = repo.SaveActivity(activity);

            if (result.Status)
            {
                return(repo.GetActivity(activity.ID));
            }
            return(null);
        }
        public void SaveActivityForNewUserJoinedTeam(TeamMemberRequest teamMemberRequest, User user, int currentUserId, int teamId)
        {
            var activity = new Activity {
                CreatedByID = currentUserId, TeamID = teamId
            };

            activity.ObjectID     = user.ID;
            activity.ObjectType   = "User";
            activity.ActivityDesc = "Joined team " + teamMemberRequest.Team.Name;
            activity.NewState     = user.FirstName;

            var result = repo.SaveActivity(activity);

            if (!result.Status)
            {
                var log = new Logger("Email");
                log.Error(result);
            }
        }