Пример #1
0
 //续借
 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");
 }
Пример #2
0
 //
 // 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);
 }
Пример #3
0
 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");
 }