public UserStory Get(UserStory story)
        {
            var exist = db.UserStories.SingleOrDefault(w => w.Id == story.Id);

            if (exist == null)
            {
                throw new NotExistItemException("Project Not exist");
            }
            return(exist);
        }
 public void SaveOrUpdate(UserStory story, string userId)
 {
     if (story.Id > 0)
     {
         Update(story);
     }
     else
     {
         Add(story, userId);
     }
 }
        public void Update(UserStory story)
        {
            var exist = Get(story);

            exist.name        = story.name;
            exist.description = story.description;
            exist.updateDate  = DateTime.Now;
            exist.Project     = story.Project;
            exist.state       = story.state;
            exist.AspNetUsers = story.AspNetUsers;
            db.SaveChanges();
        }
        public void SaveToHistory(UserStory story, string userId)
        {
            UserStoryHistory history = new UserStoryHistory()
            {
                userStoryId = story.Id,
                closedBy    = userId,
                closeDate   = DateTime.Now,
            };

            db.UserStoryHistories.Add(history);
            db.SaveChanges();
        }
Exemplo n.º 5
0
 public UserStoryAttachment FindByIDAndUserStory(Attachment attachment, UserStory us)
 {
     return(db.UserStoryAttachments.SingleOrDefault(w => w.attachId == attachment.Id && w.userStoryId == us.Id));
 }