// GET: Sala/Create public ActionResult Create() { var orgs = _organizacaoService.GetByIdUsuario(_usuarioService.RetornLoggedUser((ClaimsIdentity)User.Identity).UsuarioModel.Id); ViewBag.Organizacoes = orgs; ViewBag.BlocoList = _blocoService.GetByIdOrganizacao(orgs.FirstOrDefault().Id); ViewBag.TipoHardware = _tipoHardwareService.GetAll(); return(View()); }
public IActionResult Create() { var organizacoes = _organizacaoService.GetByIdUsuario(_usuarioService.RetornLoggedUser((ClaimsIdentity)User.Identity).UsuarioModel.Id); var blocos = _blocoService.GetByIdOrganizacao(organizacoes.FirstOrDefault().Id); ViewBag.Organizacoes = organizacoes; ViewBag.Salas = _salaService.GetByIdBloco(blocos.FirstOrDefault().Id); ViewBag.Blocos = blocos; ViewBag.tipoHardware = new SelectList(_tipoHardwareService.GetAll(), "Id", "Descricao"); return(View()); }
public ActionResult Get() { try { var tipoHard = _service.GetAll(); if (tipoHard.Count == 0) { return(NoContent()); } return(Ok(tipoHard)); } catch (ServiceException e) { return(StatusCode(500, e.Message)); } }