Exemplo n.º 1
0
        public ActionResult BuildOverview(string id, string projectid)
        {
            if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(projectid))
            {
                return(RedirectToAction("Index"));
            }

            TfsTeamProjectCollection         tpc = configurationServer.GetTeamProjectCollection(new Guid(id));
            ReadOnlyCollection <CatalogNode> teamProjectNodes = tpc.CatalogNode.QueryChildren(
                new[] { CatalogResourceTypes.TeamProject }, new[] { new KeyValuePair <string, string>("ProjectID", projectid) },
                false, CatalogQueryOptions.None);

            string             projectName;
            BuildOverviewModel bom = new BuildOverviewModel();

            if (teamProjectNodes.Count() == 1)
            {
                projectName = teamProjectNodes[0].Resource.DisplayName;

                FeedBuildData(bom.BuildDefinitionCollection, tpc, projectName);
            }
            return(PartialView(bom));
        }
        public ActionResult BuildOverview(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(RedirectToAction("Index"));
            }

            BuildOverviewModel bom = new BuildOverviewModel();

            if (!string.IsNullOrWhiteSpace(id))
            {
                TfsTeamProjectCollection         tpc = configurationServer.GetTeamProjectCollection(new Guid(id));
                ReadOnlyCollection <CatalogNode> teamProjectNodes = tpc.CatalogNode.QueryChildren(
                    new[] { CatalogResourceTypes.TeamProject },
                    false, CatalogQueryOptions.None);

                IBuildServer bs = tpc.GetService <IBuildServer>();
                foreach (CatalogNode teamProjectNode in teamProjectNodes)
                {
                    BuildServerHelper.FeedBuildDefinition(bom.BuildDefinitionCollection, bs, teamProjectNode.Resource.DisplayName);
                }
            }
            return(PartialView(bom));
        }