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