//[Route("UpdateBooksDetails")] public IActionResult UpdateCustomerDetails(BooksDetailsModel customer) { var CustomerResult = this.bookDetailsManager.UpdateBookDetails(customer); try { if (CustomerResult != null) { return(this.Ok(new Response(HttpStatusCode.OK, "The Customer Data", CustomerResult))); } return(this.NotFound(new Response(HttpStatusCode.NotFound, "customer Data Not Found", CustomerResult))); } catch (Exception) { return(this.BadRequest(new Response(HttpStatusCode.BadRequest, "List of customer data not displayed", null))); } }
public BooksDetailsModel AddBookDetails(BooksDetailsModel books) { try { SqlCommand sqlCommand = new SqlCommand("sp_AddBookDetails", sqlConnection); sqlCommand.CommandType = CommandType.StoredProcedure; sqlCommand.Parameters.AddWithValue("@BookAuther", books.BookAutherName); sqlCommand.Parameters.AddWithValue("@BookDes", books.BookDescription); sqlCommand.Parameters.AddWithValue("@bookName", books.BookName); sqlCommand.Parameters.AddWithValue("@BookPrice", books.BookPrice); sqlCommand.Parameters.AddWithValue("@BookQuantity", books.BookQuantity); sqlConnection.Open(); sqlCommand.ExecuteNonQuery(); sqlConnection.Close(); return(books); } catch (Exception e) { throw new Exception("Value not added" + e); } }
public BooksDetailsModel UpdateBookDetails(BooksDetailsModel books) { return(bookDetails.UpdateBookDetails(books)); }
public BooksDetailsModel AddBookDetails(BooksDetailsModel books) { return(bookDetails.AddBookDetails(books)); }