Exemple #1
0
        public async Task <IActionResult> Create([Bind("PecaDeRoupaId,TipoDeRoupa,Quantidade")] PecaDeRoupa pecaDeRoupa)
        {
            if (ModelState.IsValid)
            {
                _context.Add(pecaDeRoupa);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(pecaDeRoupa));
        }
Exemple #2
0
        public async Task <IActionResult> Create([Bind("ConfeccaoId,PecaDeRoupaId,Data")] Confeccao confeccao)
        {
            if (ModelState.IsValid)
            {
                _context.Add(confeccao);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PecaDeRoupaId"] = new SelectList(_context.PecaDeRoupa, "PecaDeRoupaId", "PecaDeRoupaId", confeccao.PecaDeRoupaId);
            return(View(confeccao));
        }