public async Task <IActionResult> Edit(long id, [Bind("TechnicianId,TechnicianName,CreatedAtTech,ModifyAtTech")] TechnicianTbl technicianTbl) { if (ModelState.IsValid) { try { technicianTbl.TechnicianId = id; technicianTbl.ModifyAtTech = DateTime.Now; _context.Update(technicianTbl); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TechnicianTblExists(technicianTbl.TechnicianId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(technicianTbl)); }
public async Task <IActionResult> Create([Bind("TechnicianId,TechnicianName,CreatedAtTech,ModifyAtTech")] TechnicianTbl technicianTbl) { if (ModelState.IsValid) { technicianTbl.CreatedAtTech = DateTime.Now; technicianTbl.ModifyAtTech = DateTime.Now; _context.Add(technicianTbl); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(technicianTbl)); }