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)); }
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)); }