示例#1
0
        protected ScrumDetail BuildScrumDetail(Sprint sprint, Task task)
        {
            Scrum       mostRecentScrum       = GetMostRecentScrum(sprint);
            ScrumDetail mostRecentScrumDetail = null;

            if (mostRecentScrum != null && mostRecentScrum.ScrumDetails.Count() > 0)
            {
                var results = from s in mostRecentScrum.ScrumDetails
                              where s.TaskId == task.TaskId
                              select s;
                if (results.Count() > 0)
                {
                    mostRecentScrumDetail = results.First();
                }
            }
            ScrumDetail scrumDetail = new ScrumDetail()
            {
                AssignedTo     = (mostRecentScrumDetail != null) ? mostRecentScrumDetail.AssignedTo : AccountMembershipService.UNASSIGNED,
                HoursCompleted = (mostRecentScrumDetail != null) ? mostRecentScrumDetail.HoursCompleted : 0,
                HoursRemaining = (mostRecentScrumDetail != null) ? mostRecentScrumDetail.HoursRemaining :
                                 ((task.Hours != null) ? (int)task.Hours : 0),
                StoryTaskDescription = task.Story.UserDefinedId + " -> " + task.Description,
                TaskId = task.TaskId
            };

            return(scrumDetail);
        }
示例#2
0
        public ActionResult DeleteConfirmed(int id)
        {
            ScrumDetail scrumDetail = db.ScrumDetails.Find(id);

            db.ScrumDetails.Remove(scrumDetail);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#3
0
 public ActionResult Edit([Bind(Include = "ScrumDetailId,ScrumUpdate,UpdateDateTime,UpdatePerson,PriorDueDateTime,NewDueDateTime,Notes,ScrumId")] ScrumDetail scrumDetail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(scrumDetail).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ScrumId = new SelectList(db.Scrums, "ScrumId", "ScrumId", scrumDetail.ScrumId);
     return(View(scrumDetail));
 }
示例#4
0
        // GET: ScrumDetails/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ScrumDetail scrumDetail = db.ScrumDetails.Find(id);

            if (scrumDetail == null)
            {
                return(HttpNotFound());
            }
            return(View(scrumDetail));
        }
示例#5
0
        // GET: ScrumDetails/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ScrumDetail scrumDetail = db.ScrumDetails.Find(id);

            if (scrumDetail == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ScrumId = new SelectList(db.Scrums, "ScrumId", "ScrumId", scrumDetail.ScrumId);
            return(View(scrumDetail));
        }
示例#6
0
        public Scrum GenerateNewScrumDetails(int sprintId, Scrum scrum)
        {
            SprintService sprintService = new SprintService(_ScrumTimeEntities);
            Sprint        sprint        = sprintService.GetSprintById(sprintId);

            if (sprint != null)
            {
                foreach (Story story in sprint.Stories)
                {
                    foreach (Task task in story.Tasks)
                    {
                        ScrumDetail scrumDetail = BuildScrumDetail(sprint, task);
                        scrum.ScrumDetails.Add(scrumDetail);
                    }
                }
            }
            return(scrum);
        }
示例#7
0
        public ActionResult Save(FormCollection collection)
        {
            string   scrumId               = collection.Get("scrumId");
            int      scrumIdAsInt          = Int32.Parse(scrumId);
            string   sprintId              = collection.Get("sprintId");
            int      sprintIdAsInt         = Int32.Parse(sprintId);
            string   dateOfScrum           = collection.Get("dateOfScrum");
            DateTime dateOfScrumAsDateTime = DateTime.Parse(dateOfScrum);
            string   scrumDetailCount      = collection.Get("scrumDetailCount");
            int      scrumDetailCountAsInt = Int32.Parse(scrumDetailCount);
            Scrum    scrum = new Scrum()
            {
                ScrumId     = scrumIdAsInt,
                SprintId    = sprintIdAsInt,
                DateOfScrum = dateOfScrumAsDateTime,
                ProductId   = SessionHelper.GetCurrentProductId(User.Identity.Name, Session)
            };

            for (int i = 0; i < scrumDetailCountAsInt; i++)
            {
                string      storyTaskDescription = collection.Get("scrumDetails[" + i + "][StoryTaskDescription]");
                string      assignedTo           = collection.Get("scrumDetails[" + i + "][AssignedTo]");
                string      hoursRemaining       = collection.Get("scrumDetails[" + i + "][HoursRemaining]");
                string      hoursCompleted       = collection.Get("scrumDetails[" + i + "][HoursCompleted]");
                string      taskId      = collection.Get("scrumDetails[" + i + "][TaskId]");
                ScrumDetail scrumDetail = new ScrumDetail()
                {
                    ScrumId              = scrumIdAsInt,
                    AssignedTo           = assignedTo,
                    HoursRemaining       = decimal.Parse(hoursRemaining),
                    HoursCompleted       = decimal.Parse(hoursCompleted),
                    StoryTaskDescription = storyTaskDescription,
                    TaskId = Int32.Parse(taskId)
                };
                scrum.ScrumDetails.Add(scrumDetail);
            }

            scrum = _ScrumService.SaveScrum(scrum);
            return(new SecureJsonResult("success"));
        }