コード例 #1
0
        public void UpdateStatus(int BookID, int userID, int Status)
        {
            BookTransitionTable bookList = db.BookTransitionTables.Where(x => x.UserID == userID).Where(x => x.BookID == BookID).Single();

            bookList.StatusID = Status;
            db.SaveChanges();
        }
コード例 #2
0
        public void UpdatestatusToHaveNotRead(int BookID, int userID)
        {
            BookTransitionTable bookList = db.BookTransitionTables.Where(x => x.UserID == userID).Where(x => x.BookID == BookID).Single();

            bookList.StatusID = 1;
            db.SaveChanges();
        }
コード例 #3
0
        public void addNew(int BookID, int userID)
        {
            BookTransitionTable newElement = new BookTransitionTable();

            newElement.BookID   = BookID;
            newElement.StatusID = 1;
            newElement.UserID   = userID;
            newElement.Read     = true;

            db.BookTransitionTables.Add(newElement);
            db.SaveChanges();
        }