public async Task <IActionResult> Edit(int id, [Bind("Id,NameKyrg,NameRus,CreateDate")] DictMonumentType dictMonumentType) { if (id != dictMonumentType.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(dictMonumentType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DictMonumentTypeExists(dictMonumentType.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dictMonumentType)); }
// GET: GlobalDicts/DictMonumentTypes/Create public IActionResult Create() { DictMonumentType model = new DictMonumentType(); model.CreateDate = DateTime.Now; model.NameKyrg = "NULL"; return(View(model)); }
public async Task <IActionResult> Create([Bind("Id,NameKyrg,NameRus,CreateDate")] DictMonumentType dictMonumentType) { if (ModelState.IsValid) { _context.Add(dictMonumentType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(dictMonumentType)); }