public async Task <IActionResult> Edit(int id, [Bind("RefTLMLanguageId,TLMLanguageCode,TLMLanguage")] RefTLMLanguage refTLMLanguage) { if (id != refTLMLanguage.RefTLMLanguageId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(refTLMLanguage); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RefTLMLanguageExists(refTLMLanguage.RefTLMLanguageId)) { return(NotFound()); } else { throw; } } TempData["messageType"] = "success"; TempData["messageTitle"] = "RECORD UPDATED"; TempData["message"] = "Record successfully updated"; return(RedirectToAction(nameof(Index))); } return(View(refTLMLanguage)); }
public async Task <IActionResult> Create([Bind("RefTLMLanguageId,TLMLanguageCode,TLMLanguage")] RefTLMLanguage refTLMLanguage) { if (ModelState.IsValid) { _context.Add(refTLMLanguage); await _context.SaveChangesAsync(); TempData["messageType"] = "success"; TempData["messageTitle"] = "RECORD CREATED"; TempData["message"] = "New record successfully created"; return(RedirectToAction(nameof(Index))); } return(View(refTLMLanguage)); }