public void CustReturn(int Custid) { using (BookLibraryEntities1 Return = new BookLibraryEntities1()) { Cust obj_table = Return.Custs.First(x => x.CustID == Custid); Return.Custs.Remove(obj_table); Return.SaveChanges(); } }
public void BookRemove(int BookID) { using (BookLibraryEntities1 BookRemove = new BookLibraryEntities1()) { BookTable obj_table = BookRemove.BookTables.First(x => x.BookNo == BookID); BookRemove.BookTables.Remove(obj_table); BookRemove.SaveChanges(); } }
public void BookUpdate(int BookID, string BookName, string BookAuthor, int Copies) { using (var BooktableObj = new BookLibraryEntities1()) { var UPbook = BooktableObj.BookTables.SingleOrDefault(b => b.BookNo == BookID); if (UPbook != null) { UPbook.BookName = BookName; UPbook.BookAuthor = BookAuthor; UPbook.Copies = Copies; BooktableObj.SaveChanges(); } } }
protected void ButtonLogin_Click(object sender, EventArgs e) { String User = LoginTextbox.Text; String Pass = PassTextBox.Text; BookLibraryEntities1 db = new BookLibraryEntities1(); string query = (from c in db.Usertables where c.Username == User && c.Password == Pass select c.Username).FirstOrDefault(); if (query != null) { Response.Redirect("BookPage.aspx"); } else { Response.Write("Check You username or password"); } }