예제 #1
0
 public bool AddInstructorBook(InstructorBook v)
 {
     db.InstructorBooks.Add(v);
     if (!Save())
     {
         return(false);
     }
     return(true);
 }
예제 #2
0
 public bool AddInstructorBook(InstructorBook v)
 {
     db.InstructorBooks.Add(v);
     if (!Save())
     {
         return false;
     }
     return true;
 }
예제 #3
0
 public bool UpdateInstructorBook(InstructorBook v)
 {
     if (!db.InstructorBooks.Local.Contains(v))
     {
         db.InstructorBooks.Attach(v);
     }
     db.Entry <InstructorBook>(v).State = EntityState.Modified;
     if (!Save())
     {
         return(false);
     }
     return(true);
 }
예제 #4
0
 public bool RemoveInstructorBook(InstructorBook v)
 {
     if (!db.InstructorBooks.Local.Contains(v))
     {
         db.InstructorBooks.Attach(v);
     }
     db.InstructorBooks.Remove(v);
     if (!Save())
     {
         return(false);
     }
     return(true);
 }
 public ActionResult CheckOut(FormCollection c)
 {
     using (InstManager)
     {
         var item = new InstructorBook();
         item.InstructorID = Convert.ToInt32(c[0]);
         item.TextBookID = Convert.ToInt32(c[1]);
         var success = InstManager.AddInstructorBook(item);
         if (!success)
         {
             ModelState.AddModelError("", "Unable to checkout textbook. Please try again.");
         }
         return RedirectToAction("Details", new { id = item.InstructorID });
     }
 }
예제 #6
0
 public bool UpdateInstructorBook(InstructorBook v)
 {
     if (!db.InstructorBooks.Local.Contains(v))
     {
         db.InstructorBooks.Attach(v);
     }
     db.Entry<InstructorBook>(v).State = EntityState.Modified;
     if (!Save())
     {
         return false;
     }
     return true;
 }
예제 #7
0
 public bool RemoveInstructorBook(InstructorBook v)
 {
     if (!db.InstructorBooks.Local.Contains(v))
     {
         db.InstructorBooks.Attach(v);
     }
     db.InstructorBooks.Remove(v);
     if (!Save())
     {
         return false;
     }
     return true;
 }