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