Exemplo n.º 1
0
        // GET: Releases/Create
        //[FrameworkAuthorization]
        public ActionResult Create(string version)
        {
            var releaseCombined = new ReleaseCombined {
                Release = new Release {
                    Version = version
                },
                StakeholdersHeadline = GetStakeholdersHeadline()
            };

            return(View(releaseCombined));
        }
Exemplo n.º 2
0
 //[FrameworkAuthorization]
 //[ValidateAntiForgeryToken]
 public ActionResult Delete(ReleaseCombined releaseCombined, string action)
 {
     if (action == "delete")
     {
         using (var service = DomainLocator.GetRepositoryService())
         {
             var converter = new Converter();
             service.Object.DeleteRelease(converter.Convert(releaseCombined.Release));
             return(RedirectToAction("Index"));
         }
     }
     return(View());
 }
Exemplo n.º 3
0
        // GET: Releases/Delete
        //[FrameworkAuthorization]
        public ActionResult Delete(string version)
        {
            ViewBag.Message = "You are about to delete:";
            if (version == null)
            {
                ViewBag.Message = "Invalid version number. Nothing to display.";
                return(View());
            }

            ReleaseCombined releaseCombined = new ReleaseCombined {
                StakeholdersHeadline = GetStakeholdersHeadline()
            };

            using (var service = DomainLocator.GetRepositoryService())
            {
                var releases = service.Object.ReadReleases();
                foreach (var releaseBO in releases)
                {
                    if (releaseBO.Version != version)
                    {
                        continue;
                    }
                    var converter = new Converter();
                    releaseCombined.Release = converter.Convert(releaseBO);
                    foreach (var releaseUnit in releaseCombined.Release.UnitList)
                    {
                        foreach (var headline in releaseCombined.StakeholdersHeadline)
                        {
                            if (releaseUnit.StakeholderList.Count(x => x.Name == headline.Name) > 0)
                            {
                                continue;
                            }
                            releaseUnit.StakeholderList.Add(headline);
                        }
                    }
                }
            }
            return(View(releaseCombined));
        }
Exemplo n.º 4
0
        //[FrameworkAuthorization]
        //[ValidateAntiForgeryToken]
        public ActionResult Create(ReleaseCombined releaseCombined, string action)
        {
            releaseCombined.StakeholdersHeadline = GetStakeholdersHeadline();
            switch (action)
            {
            case "addreleaseunit":
                var releaseUnit = new ReleaseUnit {
                    Name = releaseCombined.NewReleaseUnit
                };
                foreach (var stakeholderHead in releaseCombined.StakeholdersHeadline)
                {
                    releaseUnit.StakeholderList.Add(new Stakeholder()
                    {
                        Name = stakeholderHead.Name, IsParticipating = false
                    });
                }
                releaseCombined.Release.UnitList.Add(releaseUnit);
                break;

            case "save":
                if (ModelState.IsValid)
                {
                    using (var service = DomainLocator.GetRepositoryService())
                    {
                        var converter = new Converter();
                        service.Object.CreateRelease(converter.Convert(releaseCombined.Release));
                    }
                    return(RedirectToAction("Index"));
                }
                break;

            case "deletereleaseunit":
                //ToDo: Complete view and logic
                break;
            }
            return(View(releaseCombined));
        }