コード例 #1
0
 public async Task<IActionResult> Create([Bind("IdPagamento,FormaPagamento,Parcelas")] TbPagamento tbPagamento)
 {
     if (ModelState.IsValid)
     {
         _context.Add(tbPagamento);
         await _context.SaveChangesAsync();
         return RedirectToAction(nameof(Index));
     }
     return View(tbPagamento);
 }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("IdCurriculo,Graduacao,AnosExperiencia,CursosRealizados")] TbCurriculo tbCurriculo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tbCurriculo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tbCurriculo));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("IdCursos,Ementa,Nome,DuracaoHoras,Valor")] TbCursos tbCursos)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tbCursos);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tbCursos));
        }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("IdCliente,IdPagamento,VisitasSite,Nome,Cpf,Cep,Email,Telefone")] TbCliente tbCliente)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tbCliente);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdPagamento"] = new SelectList(_context.Set <TbPagamento>(), "IdPagamento", "FormaPagamento", tbCliente.IdPagamento);
            return(View(tbCliente));
        }
コード例 #5
0
        public async Task <IActionResult> Create([Bind("IdProfessor,IdCurriculo,Nome,Cpf,Endereco,Email,Telefone")] TbProfessor tbProfessor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tbProfessor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdCurriculo"] = new SelectList(_context.TbCurriculo, "IdCurriculo", "CursosRealizados", tbProfessor.IdCurriculo);
            return(View(tbProfessor));
        }
コード例 #6
0
        public async Task <IActionResult> Create([Bind("IdVendas,IdCursos,IdCliente,DataCompra")] TbVendas tbVendas)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tbVendas);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdCliente"] = new SelectList(_context.TbCliente, "IdCliente", "Email", tbVendas.IdCliente);
            ViewData["IdCursos"]  = new SelectList(_context.TbCursos, "IdCursos", "Ementa", tbVendas.IdCursos);
            return(View(tbVendas));
        }
コード例 #7
0
        public async Task <IActionResult> Create([Bind("IdDisciplinas,IdProfessor,IdCurso")] TbDisciplinas tbDisciplinas)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tbDisciplinas);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdCurso"]     = new SelectList(_context.TbCursos, "IdCursos", "Ementa", tbDisciplinas.IdCurso);
            ViewData["IdProfessor"] = new SelectList(_context.Set <TbProfessor>(), "IdProfessor", "Email", tbDisciplinas.IdProfessor);
            return(View(tbDisciplinas));
        }