// GET: UserStory/Edit/5

        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UserStory userStory = service.GetUserStoryById(id.Value);

            if (userStory == null)
            {
                return(HttpNotFound());
            }
            Employee User = Utility.GetEmployeeSession(this.Session);

            ViewBag.ProductBackLogId = new SelectList(ProductService.GetAllProductBackLogsByOwner(User.Id), "Id", "Name", userStory.ProductBackLogId);
            ViewBag.ReleaseId        = new SelectList(new List <ReleaseBacklog>());
            ViewBag.SprintId         = userStory.ReleaseId == null ? new SelectList(new List <Sprint>()) : new SelectList(SprintService.GetAllSprintsByRelId(userStory.ReleaseId.Value), "Id", "SprintName");

            if (Utility.UserInRole(RoleEnum.ProductOwner, Session))
            {
                return(View("_POEdit", userStory));
            }

            ViewBag.DevelopedId = new SelectList(HrService.GetAllDevelopers(), "Id", "FirstName", userStory.DevelopedId);
            ViewBag.TesterId    = new SelectList(HrService.GetAllTesters(), "Id", "FirstName", userStory.TesterId);

            if (Utility.UserInRole(RoleEnum.ScrumMaster, Session))
            {
                return(View("_SMEdit", userStory));
            }

            else if (Utility.UserInRole(RoleEnum.Developer, Session) || Utility.UserInRole(RoleEnum.Tester, Session))
            {
                return(View("_EmpEdit", userStory));
            }

            return(View(userStory));
        }
Esempio n. 2
0
 public IEnumerable <Sprint> GetSprintByReleaseId(int ReleaseId)
 {
     return(SprintService.GetAllSprintsByRelId(ReleaseId));
 }