コード例 #1
0
        public ActionResult Novo()
        {
            CadastroCasoTesteViewModel viewModel = new CadastroCasoTesteViewModel()
            {
                sistemas = Sistema_DAO.getAllSistemas().AsEnumerable <Sistema>()
            };

            return(View(viewModel));
        }
コード例 #2
0
        public ActionResult Criar(CadastroCasoTesteViewModel vModel)
        {
            TestCase _testCase = vModel.testCase;

            if (!ModelState.IsValid)
            {
                var viewModel = new CadastroCasoTesteViewModel()
                {
                    testCase = _testCase,
                    sistemas = Sistema_DAO.getAllSistemas()
                };
                return(View("Novo", viewModel));
            }
            else
            {
                _testCase.SistemaPai = Sistema_DAO.getAllSistemas().First(x => x.Id == _testCase.sistemaPaiId);
                _testCase.Salvar();
                return(RedirectToAction("Index", "TestCase"));
            }
        }