Ejemplo n.º 1
0
        // 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));
        }
Ejemplo n.º 2
0
        // 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));
        }
Ejemplo n.º 3
0
        // GET: Funcionarios/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var funcionario = _funcionarioAppService.ObterPorId(id.Value);

            if (funcionario == null)
            {
                return(HttpNotFound());
            }

            ViewBag.EmpresaId = new SelectList(_empresaAppService.ObterTodos(), "EmpresaId", "NomeFantasia", funcionario.EmpresaId);
            ViewBag.CBOId     = new SelectList(_cboAppService.ObterTodos(), "CBOId", "Nome", funcionario.CBOId);
            ViewBag.SetorId   = new SelectList(_setorAppService.ObterTodos(), "SetorId", "Nome", funcionario.SetorId);
            ViewBag.EscalaId  = new SelectList(_escalaAppService.ObterTodos(), "EscalaId", "Nome", funcionario.EscalaId);

            List <SelectListItem> ddlStatus_Funcionario = new List <SelectListItem>();

            ddlStatus_Funcionario.Add(new SelectListItem()
            {
                Text = "Ativo", Value = "1"
            });
            ddlStatus_Funcionario.Add(new SelectListItem()
            {
                Text = "Desativado", Value = "2"
            });
            TempData["ddlStatus_Funcionarios"] = ddlStatus_Funcionario;

            funcionario.StatusNome = ddlStatus_Funcionario.Where(e => e.Value.Trim().Equals(funcionario.Status.ToString())).First().Text;



            return(View(funcionario));
        }
Ejemplo n.º 4
0
        // GET: FuncionarioEmpresas/Create
        public ActionResult Create()
        {
            List <SelectListItem> ddlStatus = new List <SelectListItem>();

            ddlStatus.Add(new SelectListItem()
            {
                Text = "Vinculado à empresa", Value = "1"
            });
            ddlStatus.Add(new SelectListItem()
            {
                Text = "Desvinculado à empresa", Value = "2"
            });
            TempData["ddlStatus"] = ddlStatus;

            ViewBag.EmpresaId     = new SelectList(_empresaAppService.ObterTodos(), "EmpresaId", "NomeFantasia");
            ViewBag.FuncionarioId = new SelectList(_funcionarioAppService.ObterTodos(), "FuncionarioId", "Nome");
            ViewBag.CBOId         = new SelectList(_cboAppService.ObterTodos(), "CBOId", "Nome");
            ViewBag.SetorId       = new SelectList(_setorAppService.ObterTodos(), "SetorId", "Nome");
            ViewBag.EscalaId      = new SelectList(_escalaAppService.ObterTodos(), "EscalaId", "Nome");

            var funcionarioEmpresaViewModel = new FuncionarioEmpresaViewModel();

            return(View(funcionarioEmpresaViewModel));
        }