//续借 public ActionResult Continue(PreKey key) { int bid = key.bookID; int rid = key.readerID; DateTime lendDate = key.lendTime; Record record = (from i in db.Record where i.readerID == rid && i.bookID == bid && i.lendTime == lendDate select i).First(); record.wellTime = DateTime.Now; db.SaveChanges(); return RedirectToAction("Index"); }
// // GET: /Record/Details/5 public ActionResult Details(PreKey key) { int bid = key.bookID; int rid = key.readerID; DateTime lendDate = key.lendTime; Record record = (from i in db.Record where i.readerID == rid && i.bookID == bid && i.lendTime == lendDate select i).First(); if (record == null) { return HttpNotFound(); } return View(record); }
public ActionResult DeleteConfirmed(PreKey key) { int bid = key.bookID; int rid = key.readerID; DateTime lendDate = key.lendTime; Record record = (from i in db.Record where i.readerID == rid && i.bookID == bid && i.lendTime == lendDate select i).First(); record.returnTime = DateTime.Now ; var n = (from e in db.Book where e.bookID == record.bookID select e).First(); n.bookState = "在架"; db.SaveChanges(); return RedirectToAction("Index"); }