예제 #1
0
        // GET: TestRunnerGroups
        public IActionResult Index()
        {
            ViewData["Message"] = HttpContext.Session.GetString("Message");
            HttpContext.Session.Remove("Message");

            var trg = new TestRunnerGroupsAndNewTestRunnerGroupAndProjectsAndFoldersAndGroupsAndRuns();

            trg.TestRunnerGroups = _context.TestRunnerGroup;
            trg.TestRunnerGroup  = new TestRunnerGroup();
            trg.Projects         = _context.Project;
            trg.Folders          = _context.Folder;
            trg.Groups           = _context.Group;
            trg.Runs             = _context.Run;

            var BlankSelectListItem = new SelectListItem {
                Text = "", Value = null
            };

            var projects = new SelectList(_context.Project, "ID", "Name").ToList();

            projects.Insert(0, BlankSelectListItem);
            ViewBag.Projects = projects;

            var folders = new SelectList(_context.Folder, "FolderID", "Name").ToList();

            folders.Insert(0, BlankSelectListItem);
            ViewBag.Folders = folders;

            var groups = new SelectList(_context.Group, "GroupID", "Name").ToList();

            groups.Insert(0, BlankSelectListItem);
            ViewBag.Groups = groups;

            var runs = new SelectList(_context.Run, "RunID", "Name").ToList();

            runs.Insert(0, BlankSelectListItem);
            ViewBag.Runs = runs;

            return(View(trg));
        }
        // GET: TestRunnerGroups
        public IActionResult Index()
        {
            ViewData["Message"] = HttpContext.Session.GetString("Message");
            HttpContext.Session.Remove("Message");

            var trg = new TestRunnerGroupsAndNewTestRunnerGroupAndProjectsAndFoldersAndGroupsAndRuns();

            trg.TestRunnerGroups = _context.TestRunnerGroup;
            trg.TestRunnerGroup = new TestRunnerGroup();
            trg.Projects = _context.Project;
            trg.Folders = _context.Folder;
            trg.Groups = _context.Group;
            trg.Runs = _context.Run;

            var BlankSelectListItem = new SelectListItem { Text = "", Value = null };

            var projects = new SelectList(_context.Project, "ID", "Name").ToList();
            projects.Insert(0, BlankSelectListItem);
            ViewBag.Projects = projects;

            var folders = new SelectList(_context.Folder, "FolderID", "Name").ToList();
            folders.Insert(0, BlankSelectListItem);
            ViewBag.Folders = folders;

            var groups = new SelectList(_context.Group, "GroupID", "Name").ToList();
            groups.Insert(0, BlankSelectListItem);
            ViewBag.Groups = groups;

            var runs = new SelectList(_context.Run, "RunID", "Name").ToList();
            runs.Insert(0, BlankSelectListItem);
            ViewBag.Runs = runs;

            return View(trg);
        }