public async Task <IActionResult> Edit(int id, [Bind("Id,NameKyrg,NameRus,CreateDate,DictStatusId,DeactiveDate")] DictMediaLangType dictMediaLangType) { if (id != dictMediaLangType.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(dictMediaLangType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DictMediaLangTypeExists(dictMediaLangType.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["DictStatusId"] = new SelectList(_context.DictStatus, "Id", "Id", dictMediaLangType.DictStatusId); return(View(dictMediaLangType)); }
// GET: GlobalDicts/DictMediaLangTypes/Create public IActionResult Create() { ViewData["DictStatusId"] = new SelectList(_context.DictStatus, "Id", "Name"); DictMediaLangType model = new DictMediaLangType(); model.CreateDate = DateTime.Now; return(View(model)); }
public async Task <IActionResult> Create([Bind("Id,NameKyrg,NameRus,CreateDate,DictStatusId,DeactiveDate")] DictMediaLangType dictMediaLangType) { if (ModelState.IsValid) { _context.Add(dictMediaLangType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["DictStatusId"] = new SelectList(_context.DictStatus, "Id", "Name", dictMediaLangType.DictStatusId); return(View(dictMediaLangType)); }