public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Groupnomid,Deleted")] Nomencl nomencl) { if (id != nomencl.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(nomencl); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NomenclExists(nomencl.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["Groupnomid"] = new SelectList(_context.Groupnom.Where(b => !b.Deleted), "Id", "Name", nomencl.Groupnomid); return(View(nomencl)); }
public async Task <IActionResult> Create([Bind("Id,Name,Groupnomid,Deleted")] Nomencl nomencl) { if (ModelState.IsValid) { _context.Add(nomencl); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["Groupnomid"] = new SelectList(_context.Groupnom.Where(b => !b.Deleted), "Id", "Name", nomencl.Groupnomid); return(View(nomencl)); }