public ActionResult DeleteConfirmed(int id) { checkIN checkIN = db.Checkin.Find(id); db.Checkin.Remove(checkIN); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,CheckInDate,name")] checkIN checkIN) { if (ModelState.IsValid) { db.Entry(checkIN).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(checkIN)); }
// GET: checkINs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } checkIN checkIN = db.Checkin.Find(id); if (checkIN == null) { return(HttpNotFound()); } return(View(checkIN)); }
public ActionResult Create([Bind(Include = "ID,CheckInDate,name")] checkIN checkIN) { if (ModelState.IsValid) { var Tlist = db.NewDrivers.Find(checkIN.ID); string iname = " "; iname = Tlist.DriverFullName; checkIN.name = iname; checkIN.CheckInDate = System.DateTime.UtcNow; db.Checkin.Add(checkIN); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(checkIN)); }