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