Exemple #1
0
        public async Task <IActionResult> Create([Bind("id,nome")] Status status)
        {
            if (ModelState.IsValid)
            {
                _context.Add(status);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(status));
        }
        public async Task <IActionResult> Create([Bind("id,nome,dataInicio,dataTermino,dataCadastro")] Projeto projeto)
        {
            if (ModelState.IsValid)
            {
                _context.Add(projeto);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(projeto));
        }
        public async Task <IActionResult> Create([Bind("id,nome,telefone,email,cpf,cnpj,enderecoCep,enderecoRua,enderecoNumero,enderecoBairro,enderecoCidade")] Cliente cliente)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cliente);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cliente));
        }
Exemple #4
0
        public async Task <IActionResult> Create([Bind("id,nome")] TipoOrdemServico tipoOrdemServico)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tipoOrdemServico);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tipoOrdemServico));
        }
        public async Task <IActionResult> Create([Bind("id,titulo,resumo,justificativa,descricao,resolucao,ClienteId,TipoOrdemServicoId,ServicoId,StatusId")] OrdemServico ordemServico)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ordemServico);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClienteId"]          = new SelectList(_context.Cliente, "id", "nome", ordemServico.ClienteId);
            ViewData["ServicoId"]          = new SelectList(_context.Servico, "id", "nome", ordemServico.ServicoId);
            ViewData["StatusId"]           = new SelectList(_context.Status, "id", "nome", ordemServico.StatusId);
            ViewData["TipoOrdemServicoId"] = new SelectList(_context.TipoOrdemServico, "id", "nome", ordemServico.TipoOrdemServicoId);
            return(View(ordemServico));
        }