// GET: Empresas/Create public ActionResult Create() { ViewBag.UFId = new SelectList(_uFAppService.ObterTodos(), "UFId", "Nome"); ViewBag.CnaeIdList = new MultiSelectList(_cnaeAppService.ObterTodos(), "CnaeId", "Descricao"); ViewBag.CnaeId = ViewBag.CnaeIdList; ViewBag.SetorIdList = new MultiSelectList(_setorAppService.ObterTodos(), "SetorId", "Nome"); var empresaViewModel = new EmpresaViewModel(); return(View(empresaViewModel)); }
// GET: Empresas/Create public ActionResult Create() { if (Session["usuario"] == null) { return(RedirectToAction("Login", "Usuarios")); } ViewBag.UFId = new SelectList(_uFAppService.ObterTodos(), "UFId", "Nome"); ViewBag.CnaeIdList = new MultiSelectList(_cnaeAppService.ObterTodos(), "CnaeId", "Descricao"); ViewBag.CnaeId = ViewBag.CnaeIdList; ViewBag.SetorIdList = new MultiSelectList(_setorAppService.ObterTodos(), "SetorId", "Nome"); var empresaViewModel = new EmpresaViewModel(); return(View(empresaViewModel)); }