Exemplo n.º 1
0
 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();
     }
 }
Exemplo n.º 2
0
 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();
     }
 }
Exemplo n.º 3
0
        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();
                }
            }
        }
Exemplo n.º 4
0
        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");
            }
        }