Exemple #1
0
        // GET: TestRunnerGroups/Details/5
        public IActionResult Details(int?id)
        {
            if (id == null)
            {
                return(HttpNotFound());
            }

            ViewData["Message"] = HttpContext.Session.GetString("Message");
            HttpContext.Session.Remove("Message");

            var trg = new TestRunnerGroupAndTestRunnersAndNewTestRunner();

            trg.TestRunnerGroup = _context.TestRunnerGroup.Single(m => m.TestRunnerGroupID == id);
            if (trg == null)
            {
                return(HttpNotFound());
            }

            trg.TestRunners = _context.TestRunner.Where(t => t.TestRunnerGroupID == id);

            trg.TestRunner = new TestRunner();

            var projects = _context.Project.Where(t => t.TestRunnerGroupID == id).ToList();

            if (projects.Count != 0)
            {
                ViewBag.ProjectsDisplayString = String.Join(", ", projects.Select(t => t.Name).ToList());
            }

            var folders = _context.Folder.Where(t => t.TestRunnerGroupID == id).ToList();

            if (folders.Count != 0)
            {
                ViewBag.FoldersDisplayString = String.Join(", ", folders.Select(t => t.Name).ToList());
            }

            var groups = _context.Group.Where(t => t.TestRunnerGroupID == id).ToList();

            if (groups.Count != 0)
            {
                ViewBag.GroupsDisplayString = String.Join(", ", groups.Select(t => t.Name).ToList());
            }

            var runs = _context.Run.Where(t => t.TestRunnerGroupID == id).ToList();

            if (runs.Count != 0)
            {
                ViewBag.RunsDisplayString = String.Join(", ", runs.Select(t => t.Name).ToList());
            }

            return(View(trg));
        }
        // GET: TestRunnerGroups/Details/5
        public IActionResult Details(int? id)
        {
            if (id == null)
            {
                return HttpNotFound();
            }

            ViewData["Message"] = HttpContext.Session.GetString("Message");
            HttpContext.Session.Remove("Message");

            var trg = new TestRunnerGroupAndTestRunnersAndNewTestRunner();
            trg.TestRunnerGroup = _context.TestRunnerGroup.Single(m => m.TestRunnerGroupID == id);
            if (trg == null)
            {
                return HttpNotFound();
            }

            trg.TestRunners = _context.TestRunner.Where(t => t.TestRunnerGroupID == id);

            trg.TestRunner = new TestRunner();

            var projects = _context.Project.Where(t => t.TestRunnerGroupID == id).ToList();
            if (projects.Count != 0)
            {
                ViewBag.ProjectsDisplayString = String.Join(", ", projects.Select(t => t.Name).ToList());
            }

            var folders = _context.Folder.Where(t => t.TestRunnerGroupID == id).ToList();
            if (folders.Count != 0)
            {
                ViewBag.FoldersDisplayString = String.Join(", ", folders.Select(t => t.Name).ToList());
            }

            var groups = _context.Group.Where(t => t.TestRunnerGroupID == id).ToList();
            if (groups.Count != 0)
            {
                ViewBag.GroupsDisplayString = String.Join(", ", groups.Select(t => t.Name).ToList());
            }

            var runs = _context.Run.Where(t => t.TestRunnerGroupID == id).ToList();
            if (runs.Count != 0)
            {
                ViewBag.RunsDisplayString = String.Join(", ", runs.Select(t => t.Name).ToList());
            }

            return View(trg);
        }