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); }
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); }
public String GetAllBooks(string userid) { plibrarydbEntities db = new plibrarydbEntities(); var books = db.GetAllBooks(userid); return JsonConvert.SerializeObject(books); }
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); }
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); }
public String GetBookByID(int bookID) { plibrarydbEntities db = new plibrarydbEntities(); var book = db.GetBookByID(bookID); return JsonConvert.SerializeObject(book); }
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); }
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); }
public HttpResponseMessage DeleteLoan(int loan_id) { plibrarydbEntities db = new plibrarydbEntities(); db.DeleteLoan(loan_id); return new HttpResponseMessage(HttpStatusCode.OK); }
public HttpResponseMessage DeleteReader(int reader_id) { plibrarydbEntities db = new plibrarydbEntities(); db.DeleteReader(reader_id); return new HttpResponseMessage(HttpStatusCode.OK); }
public HttpResponseMessage DeleteBook(int book_id) { plibrarydbEntities db = new plibrarydbEntities(); db.DeleteBook(book_id); return new HttpResponseMessage(HttpStatusCode.OK); }