public bool AddInstructorBook(InstructorBook v) { db.InstructorBooks.Add(v); if (!Save()) { return(false); } return(true); }
public bool AddInstructorBook(InstructorBook v) { db.InstructorBooks.Add(v); if (!Save()) { return false; } return true; }
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); }
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 }); } }
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; }
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; }