public async Task <IActionResult> Create([Bind("PartId,Name,Supplier")] Part part) { if (ModelState.IsValid) { _context.Add(part); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(part)); }
public async Task <IActionResult> Create([Bind("ProductId,Name,Description")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(product)); }
public async Task <IActionResult> Create([Bind("BomId,Quantity,PartId,ProductId")] Bom bom) { if (ModelState.IsValid) { _context.Add(bom); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["PartId"] = new SelectList(_context.Part, "PartId", "Name", bom.PartId); ViewData["ProductId"] = new SelectList(_context.Product, "ProductId", "Name", bom.ProductId); return(View(bom)); }