Example #1
0
 public void InsertBooks(Entities.book bkObj)
 {
     //NewsoftEntities dbCtx = new NewsoftEntities();
     Entities.LibEntities dbCtx = new Entities.LibEntities();
     dbCtx.books.Add(bkObj);
     dbCtx.SaveChanges();
 }
Example #2
0
        public void DeleteBooks(string bookID)
        {
            Entities.LibEntities dbCtx    = new Entities.LibEntities();
            Entities.book        bkUpdate = dbCtx.books.First(b => b.BookID == bookID);
            dbCtx.books.Remove(bkUpdate);

            dbCtx.SaveChanges();
        }
Example #3
0
        public void UpdateBooks(Entities.book bkObj, string bookID)
        {
            Entities.LibEntities dbCtx    = new Entities.LibEntities();
            Entities.book        bkUpdate = dbCtx.books.First(b => b.BookID == bookID);
            BaseRepository.CopyPropertyValues(bkObj, bkUpdate);

            dbCtx.SaveChanges();
        }