public ActionResult Edit(TraineeAttendance traineeattendance) { if (ModelState.IsValid) { db.Entry(traineeattendance).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(traineeattendance); }
public ActionResult Create(TraineeAttendance traineeattendance) { if (ModelState.IsValid) { traineeattendance.AttendanceGuid = Guid.NewGuid(); traineeattendance.UserID = User.Identity.Name.Split(',')[0]; traineeattendance.CreateTime = DateTime.Now; db.TraineeAttendances.Add(traineeattendance); db.SaveChanges(); return RedirectToAction("Index"); } return View(traineeattendance); }