Пример #1
0
 public void SaveOrUpdate(Sprint sprint, string userId)
 {
     if (sprint.Id > 0)
     {
         Update(sprint);
     }
     else
     {
         Add(sprint, userId);
     }
 }
Пример #2
0
        public void Delete(Sprint sprint)
        {
            var exist = Get(sprint);

            if (exist.UserStories.ToList().Any())
            {
                throw new BadRequestException("This story is shared between user stories");
            }

            db.Sprints.Remove(exist);
            db.SaveChanges();
        }
Пример #3
0
        private void SaveToHistory(Sprint sprint, string userId)
        {
            SprintHistory history = new SprintHistory()
            {
                sprintId  = sprint.Id,
                closedBy  = userId,
                closeDate = DateTime.Now,
                version   = int.Parse(sprint.version.ToString())
            };

            db.SprintHistories.Add(history);
            db.SaveChanges();
        }