public ActionResult Create(tblEmployee tblemployee) { if (ModelState.IsValid) { tblemployee.EmpID = Guid.NewGuid(); tblemployee.CreateTime = System.DateTime.Now; tblemployee.LatestModifiedTime= System.DateTime.Now; tblemployee.InOffice = false; tblemployee.del = false; db.tblEmployees.Add(tblemployee); db.SaveChanges(); return RedirectToAction("Index"); } return View(tblemployee); }
public ActionResult Edit(tblEmployee tblemployee) { if (ModelState.IsValid) { db.Entry(tblemployee).State = EntityState.Modified; tblemployee.LatestModifiedTime = System.DateTime.Now; db.SaveChanges(); return RedirectToAction("Index"); } return View(tblemployee); }