public IActionResult CadastrarFuncionario()
        {
            DepartamentoServices DepartamentoServices = new DepartamentoServices();
            List <Departamento>  departamentos        = DepartamentoServices.RetornaDepartamentos();

            List <SelectListItem> SelectListItemDepartamentos = new List <SelectListItem>
            {
                new SelectListItem()
                {
                    Text = "Selecione", Value = ""
                }
            };

            foreach (Departamento departamento in departamentos)
            {
                SelectListItemDepartamentos.Add(new SelectListItem()
                {
                    Text = departamento.Nome, Value = departamento.Id.ToString()
                });
            }

            CargoServices CargoServices = new CargoServices();
            List <Cargo>  Cargos        = CargoServices.GetCargosItems();

            List <SelectListItem> SelectListItemCargos = new List <SelectListItem>
            {
                new SelectListItem()
                {
                    Text = "Selecione", Value = ""
                }
            };

            foreach (Cargo cargo in Cargos)
            {
                SelectListItemCargos.Add(new SelectListItem()
                {
                    Text = cargo.Nome, Value = cargo.Nome
                });
            }

            ViewBag.DepartamentoList = SelectListItemDepartamentos;
            ViewBag.CargoList        = SelectListItemCargos;
            return(View("../Portal/ServidorPublico/CadastrarFuncionario"));
        }
Exemplo n.º 2
0
        public HttpResponseMessage GetAll([ValidKey(ValidKeyAttribute.Entities.Usuario)] string samaccount)
        {
            var cargos = CargoServices.RecuperaTodos(samaccount);

            return(Request.CreateResponse(HttpStatusCode.OK, cargos));
        }
Exemplo n.º 3
0
        public HttpResponseMessage GetAll()
        {
            var cargos = CargoServices.RecuperaTodos();

            return(Request.CreateResponse(HttpStatusCode.OK, cargos));
        }