コード例 #1
0
 public HttpResponseMessage UpdateReader([FromBody]Reader reader)
 {
     plibrarydbEntities db = new plibrarydbEntities();
     db.UpdateReader(reader.reader_id, reader.userid, reader.first_name, reader.last_name, reader.email, reader.has_book);
     return new HttpResponseMessage(HttpStatusCode.OK);
 }
コード例 #2
0
 public HttpResponseMessage UpdateLoan([FromBody]Loan loan)
 {
     plibrarydbEntities db = new plibrarydbEntities();
     db.UpdateLoan(loan.loan_id, loan.userid, loan.reader_id, loan.book_id, loan.loan_date, loan.if_closed);
     return new HttpResponseMessage(HttpStatusCode.OK);
 }
コード例 #3
0
 public String GetAllBooks(string userid)
 {
     plibrarydbEntities db = new plibrarydbEntities();
     var books = db.GetAllBooks(userid);
     return JsonConvert.SerializeObject(books);
 }
コード例 #4
0
 public HttpResponseMessage UpdateBook([FromBody]Book book)
 {
     plibrarydbEntities db = new plibrarydbEntities();
     db.UpdateBook(book.book_id, book.userid, book.title, book.genre, book.publication_year, book.authors, book.book_status, book.cover);
     return new HttpResponseMessage(HttpStatusCode.OK);
 }
コード例 #5
0
 public String InsertLoan([FromBody]Loan loan)
 {
     plibrarydbEntities db = new plibrarydbEntities();
     var loan_id = db.InsertLoan(loan.userid, loan.reader_id, loan.book_id, loan.loan_date, loan.if_closed);
     return JsonConvert.SerializeObject(loan_id);
 }
コード例 #6
0
 public String GetBookByID(int bookID)
 {
     plibrarydbEntities db = new plibrarydbEntities();
     var book = db.GetBookByID(bookID);
     return JsonConvert.SerializeObject(book);
 }
コード例 #7
0
 public String InsertReader([FromBody]Reader reader)
 {
     plibrarydbEntities db = new plibrarydbEntities();
     var reader_id = db.InsertReader(reader.userid, reader.first_name, reader.last_name, reader.email, reader.has_book);
     return JsonConvert.SerializeObject(reader_id);
 }
コード例 #8
0
 public String InsertBook([FromBody]Book book)
 {
     plibrarydbEntities db = new plibrarydbEntities();
     var book_id = db.InsertBook(book.userid, book.title, book.genre, book.publication_year, book.authors, book.book_status, book.cover);
     return JsonConvert.SerializeObject(book_id);
 }
コード例 #9
0
 public HttpResponseMessage DeleteLoan(int loan_id)
 {
     plibrarydbEntities db = new plibrarydbEntities();
     db.DeleteLoan(loan_id);
     return new HttpResponseMessage(HttpStatusCode.OK);
 }
コード例 #10
0
 public HttpResponseMessage DeleteReader(int reader_id)
 {
     plibrarydbEntities db = new plibrarydbEntities();
     db.DeleteReader(reader_id);
     return new HttpResponseMessage(HttpStatusCode.OK);
 }
コード例 #11
0
 public HttpResponseMessage DeleteBook(int book_id)
 {
     plibrarydbEntities db = new plibrarydbEntities();
     db.DeleteBook(book_id);
     return new HttpResponseMessage(HttpStatusCode.OK);
 }