Front end: The Do,yuzu,-T.c_
Backend: Dinghow,Midori,『』
"Ding Dong" - an online book review and purchase system is a platform that provides users with a platform to purchase and review books. Users can query information about various books on this platform, view and interact with other people's evaluations of books, and at the same time comment on their thoughts. You can add books to favorites, shopping cart, purchase and other operations. The specific function points and corresponding requirements of the system are as follows.
Create a new user and initialize basic information, including username and password.
Users log in based on their registered account and password.
Users can modify basic information, including management of delivery addresses, etc.
Users can enter keywords to search, or search by book category, and the search results will be displayed.
Users can view specific information about the book on the book information page, including introduction, reviews, ratings, etc.
Users can view books that have been added to favorites.
Users can remove books added to favorites.
After completing the order, users can rate and evaluate the corresponding books.
Users can check the reviews of other people who have purchased this book on the book information page.
Users can add books to the shopping cart on the book page and homepage.
Users can view the current shopping cart information, including the books added to the shopping cart and their prices, the total shopping cart price, etc.
Users can move books added to the shopping cart to favorites, delete them, or modify the quantity.
After checking out the shopping cart, the user can submit and save the order information for this purchase.
Users can view signed and unsigned order information in the personal center.
For completed orders, users can delete them.
The administrator can log in to the backend management page according to the administrator account and password.
Administrators can search for specified users and display the results.
Administrators can ban specified users and delete their accounts from the database.
Administrators can add books, delete existing books, or modify information about existing books.
The "New Books on Shelves" on the homepage can dynamically display the 5 books with the latest shelf time.
The "Popular Recommendations" on the homepage can dynamically display the 5 books with the highest user ratings.
The "Recommended for You" section on the homepage can statically display 10 books recommended by the website administrator.
Windows, Mac OS, Chrome or IE 8 or above are recommended as browsers
The information data is stored in the database on the server side, and each user accesses it on the client side under the specified permissions, while realizing information sharing.
The background data cannot be changed at will, and it should be kept confidential and the user's private information cannot be leaked.
Users have specified access rights and cannot enter the administrator page.
The data information entered by users is restricted through regular verification and other methods, including data type and value range, etc., and the transmission of incorrect information is intercepted in a timely manner.
Add primary code constraints, foreign code constraints, and consistency constraints to tables in the database, and achieve and protect database data consistency and integrity by setting cascade operations, etc.
The interface is clean and friendly, making it easy for users to operate and quickly access the information they need.
2.1 Login and registration function
2.1.1 Login and registration function design
Users need to fill in some personal information when registering, including personal username, password and personal email. Register again. After the user successfully registers, the system will return to the login page, and then the user can log in based on his or her username and password as verification information. Users who are not logged in can view the home page information and perform search operations, but cannot perform any personal operations.
action sequence | describe |
---|---|
register | Users can complete the personal registration operation by entering their username, password, confirmation password, and personal email address. The above input information is required and must meet regulatory requirements. |
Registration successful | After successful registration, the system will return to the login page to allow the user to log in or cancel the login and return to the home page. |
Registration failed | After the registration fails, the information in all input boxes will be cleared and no operation will be performed. |
Log in | Users can log in by entering their username and password, and the input box information is required. |
Login successful | After successful login, the system will jump to the homepage. The user status is logged in and all user operations can be performed. |
Login failed | After the login fails, the system will clear the information in all input boxes and perform no operations. |
Cancel login | After the user clicks to cancel the login, the page jumps to the initial homepage. |
2.1.2 Implementation of login registration function
Figure 2.1 User login
Figure 2.2 User registration
Figure 2.3 Top bar - after login
2.2 Modify personal information
2.2.1 Modify personal information function design
Users can modify personal information on the personal information page, including modifying name, gender, personal email address, and password.
action sequence | describe |
---|---|
Enter personal page | When logged in, users can enter the personal information page through the "Personal Center" at the top of the page. |
Modify personal information | This action includes modifying the personal name, gender and email address. After the user modifies the three items of information, he or she can click the "Confirm Modification" button to save the modified information. The three items of information are required, otherwise they cannot be modified. |
Change password | Users need to enter the old password and new password to change the password. |
2.2.2 Implementation of the function of modifying personal information
Figure 2.4 Modify personal information
2.3 Address management
2.3.1 Address management function design
Users can enter the address management page on the personal center page to manage their own delivery addresses.
action sequence | describe |
---|---|
Enter address management | Users can enter the address management page through the personal center page while logged in. |
Add new address | After clicking "Add Address", users can fill in new address information in the pop-up window, including province, city, district, detailed address, name, zip code, and phone number. The above information is required. |
Delete address | The user clicks the "Manage" button to enter the selection operation, and then clicks on the address box to select or select all. After the selection is completed, click Delete to delete the address. |
2.3.2 Implementation of address management function
Figure 2.5 Managing personal addresses
Figure 2.6 Add new address
3.1 Search books
3.1.1 Book search function design
Users can enter keywords in the search box or click on categories to perform search operations. The results are displayed on the search page. At the same time, users can click on books to enter the corresponding details page.
action sequence | describe |
---|---|
Enter search | Users can enter keywords in the search box or click on categories to search, and then the search results will jump to the search page. |
View book details | Users can click on a book in the search results to jump to the book details page to view book details and other users' comments on the book. |
3.1.2 Implementation of book search function
Figure 3.1 Searching for books
Figure 3.2 Book details
3.2 Favorites
3.2.1 Favorites function design
Users can add their favorite books to favorites on the book details page and homepage. Users can enter personal favorites through the home page and perform management operations.
action sequence | describe |
---|---|
Add to favorites | Users can add books to favorites by clicking "Add to Favorites" on the book details page or by clicking "Favorites" above the corresponding book on the home page. |
Go to favorites | Users can enter the favorites page through "My Favorites" in "My Ding Dong" at the top of the homepage. |
Switch viewing mode | Users can click "Thumbnail mode" and "Detail mode" in the upper left corner of the favorites page to switch between different viewing modes. |
Delete book collection | The user clicks the "Manage" button to enter the selection operation, and then clicks on the book box to select or select all. After the selection is completed, click Delete to delete the book collection. |
3.2.2 Implementation of favorites function
Figure 3.3 Favorites-Thumbnail
Figure 3.4 Favorites-Details
Figure 3.5 Managing Favorites
3.3 Book Reviews
3.3.1 Book review function design
After the user completes the order, he or she can evaluate and rate the purchased book on the order receipt page. In addition, users can view book reviews on the details page.
action sequence | describe |
---|---|
Enter order | Users can enter the order page through "My Ding Dong" on the homepage, and switch to "Signed" to evaluate the book. |
Review books | Users can click "Evaluate" in the signed book order, click the star in the pop-up window to rate, enter the evaluation of the book in the input box, which is a required option, and click "Submit" to submit the review. |
3.3.2 Implementation of book review function
Figure 3.6 Book Reviews
4.1 Shopping cart
4.1.1 Shopping cart function design
Users can add their favorite books to the shopping cart on the book details page and homepage. Users can enter "My Shopping Cart" through the homepage to perform management operations.
action sequence | describe |
---|---|
Add to cart | Users can add books to their personal shopping cart by clicking "Add to Cart" on the book details page or by clicking "Add to Shopping" above the corresponding book on the homepage. |
Enter shopping cart | Users can enter the personal shopping cart page through the "Shopping Cart" on the home page. |
Modify quantity | Users can click the plus or minus sign in the corresponding book quantity column to modify the quantity of books in the shopping cart, and the total amount in the shopping cart will also be automatically modified accordingly. |
Move to favorites | Users can click "Move to Favorites" next to the corresponding book to add the book to favorites. |
delete | Users can click "Delete" next to the corresponding book or check the books themselves to delete the contents of the shopping cart in batches. |
Settlement | The user clicks the "Settlement" button to jump to the order module for settlement. |
4.1.2 Shopping cart function implementation
Figure 4.1 Shopping cart management
4.2 Order
4.2.1 Order function design
After checking out the shopping cart, the user enters the order page and confirms relevant information on this page, including the selection of the shipping address and the confirmation of the order content.
action sequence | describe |
---|---|
Enter order | After confirming the shopping cart settlement content, the user can click "Checkout" to enter the order page. |
Address selection | Users can click on the address box of an existing personal address to select the delivery address for this order, or click "Use New Address" to fill in the delivery address information for this order in the pop-up box. |
Return to cart | Users can click "Return to Shopping Cart" at the bottom of the page to terminate the transaction. |
Submit order | Users can click the "Submit Order" button to submit the order and jump to the feedback page. |
4.2.2 Order function implementation
Figure 4.2 Order management-not signed for
Figure 4.3 Order Management-Signed
Figure 4.4 Confirm order
Figure 4.5 Use new address when confirming order
4.3 Order management
4.3.1 Order management function design
After confirming the order, the user can enter the order management page through the user's "My Order" and confirm relevant information on this page, including the order number, book type, book quantity, book introduction, etc.
action sequence | describe |
---|---|
Enter order management | Users can click "My Orders" after entering the main page to enter the order management page. |
View order information | Users can confirm the details of the order, including the order number, types of books included, quantity of books, total order price, book introduction, etc. |
confirm the receipt of goods | Users can click the "Confirm Receipt" button to change the unreceived order to a received order. |
Delete order | The user can click the "Delete Order" button to delete the signed order that the user wants to delete. |
Review books | Users can click the "Comment" button to evaluate a single type of book in the order. |
4.3.2 Implementation of order management function
As shown in the figure, the user clicks "My Order" on the main page to enter the order management page.
As shown in the picture, the user can see the user's order details on the My Orders page.
As shown in the figure, users can change unreceived orders to signed orders.
As shown in the figure, the user can delete the signed order that he wants to delete.
As shown in the figure, the user can evaluate one of the books for which the order has been received.
5.1 Login
5.1.1 Login function design
Administrators can enter the administrator login mode through the administrator login interface at the bottom of the page. After successful login, they can perform all administrator operations.
action sequence | describe |
---|---|
Enter the login interface | Administrators can jump to the login interface after clicking "Administrator Login" at the bottom of the page. |
Log in | Administrators can log in by entering their username and password, and the input box information is required. |
Login successful | After the system successfully logs in, the administrator operation page will appear, and all administrator operations can be performed. |
Login failed | After the login fails, the system will clear the information in all input boxes and perform no operations. |
Cancel login | After the administrator clicks to cancel the login, the page jumps to the initial homepage. |
5.1.2 Login function implementation
Figure 5.1 Home page administrator entrance
Figure 5.2 Administrator login
5.2 Administrator operations
5.2.1 Administrator operation function design
After successfully logging in, the administrator can perform administrator operations on the administrator page, including user management and book management.
action sequence | describe |
---|---|
Enter the administrator page | After the administrator successfully logs in, he will jump to the administrator page. |
User management | After clicking "User Management", the administrator can enter keywords to search for users, and the searched users will be displayed below the search box. Administrators can click Delete to ban the corresponding user. |
add book | After clicking "Add Book", the administrator can add books by entering the corresponding information, including book title, ISBN, author, category, publisher, publication time, price, cover and introduction. The above information is required. |
Modify book information | After clicking "Modify Book Information", the administrator can enter keywords to search for books, and the searched books will be displayed below the search box. Administrators can click "Delete Book" to remove the corresponding book. In addition, you can click "Modify Book Information" to modify the information of the corresponding book in the pop-up window. |
5.2.2 Implementation of administrator operation functions
Figure 5.3 Administrator searches and manages users
Figure 5.4 Administrator searches and modifies book information
Figure 5.5 Administrator adds books
6.1 Database relationship diagram
6.2 Overall ER diagram
6.3 User module ER diagram
6.4 Book module ER diagram
6.5 Order module ER diagram
6.6 Comment module ER diagram
7.1 user table
Table 7-1 user table
Field name | data type | length | illustrate | Remark |
---|---|---|---|---|
ID | number | User ID | PK | |
name | varchar | 20 | User name | |
authority | varchar | 20 | Permissions | |
account | varchar | 20 | account number | |
password | varchar | 20 | password | Stored in the table is the md5 value of the actual password |
gender | varchar | 10 | gender | |
varchar | 40 |
7.2 address table
Table 7-2 address table
Field name | data type | length | illustrate | Remark |
---|---|---|---|---|
ID | number | 38 | Address ID | PK |
name | varchar | 20 | Consignee name | |
phone | varchar | 20 | Telephone | |
country | varchar | 20 | nation | |
province | varchar | 20 | province | |
city | varchar | 20 | City | |
district | varchar | 20 | district | |
post_code | number | 10 | post code | |
user_id | number | User ID | ||
location | varchar | 100 | specific address |
7.3 live table
Table 7-3 live table
Field name | data type | length | illustrate | Remark |
---|---|---|---|---|
user_ID | number | User ID | PK, FK, refer to the user's ID | |
address_ID | number | 38 | Address ID | PK, FK, refer to the ID of address |
7.4 book table
Table 7-4 book table
Field name | data type | length | illustrate | Remark |
---|---|---|---|---|
ID | number | 38 | Book ID | PK |
ISBN | varchar | 20 | Book ISBN | |
name | varchar | 30 | Book title | |
price | number | price | ||
image | varchar | 40 | Image path | |
category | varchar | 20 | Book classification | |
publisher | varchar | 100 | publishing house | |
Publish_time | varchar | 20 | Publication time | |
abstract | varchar | 400 | summary |
7.5 author table
Table 7-5 author table
Field name | data type | length | illustrate | Remark |
---|---|---|---|---|
ID | number | Author ID | PK | |
name | varchar | 20 | Name |
7.6 write table
Table 7-6 write table
Field name | data type | length | illustrate | Remark |
---|---|---|---|---|
author_ID | number | Author ID | PK, FK, refer to the author's ID | |
book_ID | number | Book ID | PK, FK, refer to the ID of the book |
7.7 category table
Table 7-7 category table
Field name | data type | length | illustrate | Remark |
---|---|---|---|---|
ID | number | Category ID | PK | |
name | varchar | 20 | name |
7.8 belong table
Table 7-8 belong table
Field name | data type | length | illustrate | Remark |
---|---|---|---|---|
book_ID | number | Book ID | PK, FK, refer to the ID of the book | |
category_ID | number | Category ID | PK.FK, refer to category ID |
7.9 orders table
Table 7-9 orders table
Field name | data type | length | illustrate | Remark |
---|---|---|---|---|
ID | number | Order ID | PK | |
user_ID | number | Purchaser ID | FK, refer to the user's ID | |
address_ID | number | Address ID | FK, refer to the ID of address | |
quantity | number | Total number of books | ||
price | number | total book price | ||
remark | varchar | 100 | Remark | |
time_start | varchar | 20 | Order time | |
time_get | varchar | 20 | Receiving time | |
status | varchar | 20 | Order status | Arrived or not arrived |
post_cost | number | Express fee |
7.10 order_include table
Table 7-10 order_include table
Field name | data type | length | illustrate | Remark |
---|---|---|---|---|
order_ID | number | Order ID | PK, FK, refer to the ID of the order | |
book_ID | number | Book ID | PK, FK, refer to the ID of the book | |
quantity | number | The number of books | ||
price | number | The total price of this book |
7.11 favorite list
Table 7-11 favorite table
Field name | data type | length | illustrate | Remark |
---|---|---|---|---|
user_ID | number | User ID | PK, FK, refer to the user's ID | |
book_ID | number | Book ID | PK, FK, refer to the ID of the book |
7.12 cart table
Table 7-12 cart table
Field name | data type | length | illustrate | Remark |
---|---|---|---|---|
user_ID | number | User ID | PK, FK, refer to the user's ID | |
quantity | number | Total number of books in shopping cart | ||
time_start | varchar | 20 | Add to cart time | |
post_cost | number | Express fee | ||
total_price | number | total cost |
7.13 cart_include table
Table 7-13 cart_include table
Field name | data type | length | illustrate | Remark |
---|---|---|---|---|
user_ID | number | User ID | PK, FK, refer to the user's ID | |
book_ID | number | Book ID | PK.FK, refer to the ID of the book | |
quantity | number | The total number of books | ||
total_price | number | The total price of the book |
7.14 comments table
Table 7-14 comments table
Field name | data type | length | illustrate | Remark |
---|---|---|---|---|
ID | number | Comment ID | PK | |
user_ID | number | User ID | FK, refer to the user's ID | |
book_ID | number | Book ID | FK, referring to the ID of the book | |
title | varchar | 100 | Comment title | |
content | varchar | 2000 | Comment content | |
time | varchar | 20 | Comment time | |
score | number | score | ||
total_like | varchar | 20 | Total number of likes | |
total_dislike | varchar | 20 | total opposition | |
total | number | 38 | The difference between the total number of thumbs up and the total number of thumbs down |
7.15 comment_feedback table
Table 7-15 comment_feedback table
Field name | data type | length | illustrate | Remark |
---|---|---|---|---|
user_ID | number | User ID | PK, FK, refer to the user's ID | |
comment_ID | number | Comment ID | PK, FK, refers to the ID of the comment | |
attitude | varchar | 20 | Attitude towards this review | |
time | varchar | 20 | Evaluation time |
This class represents the entity class in the EF structure and corresponds to the database on the server. Each member variable of type DBSet<> corresponds to a relationship instance in the database, and can be used for get and set operations.
Member variables:
public virtual DbSet < ADDRESS > ADDRESS { get ; set ; }
public virtual DbSet < AUTHOR > AUTHOR { get ; set ; }
public virtual DbSet < BOOK > BOOK { get ; set ; }
public virtual DbSet < CART > CART { get ; set ; }
public virtual DbSet < CART_INCLUDE > CART_INCLUDE { get ; set ; }
public virtual DbSet < CATEGORY > CATEGORY { get ; set ; }
public virtual DbSet < COMMENT_FEEDBACK > COMMENT_FEEDBACK { get ; set ; }
public virtual DbSet < COMMENTS > COMMENTS { get ; set ; }
public virtual DbSet < ORDER_INCLUDE > ORDER_INCLUDE { get ; set ; }
public virtual DbSet < ORDERS > ORDERS { get ; set ; }
public virtual DbSet < USERS > USERS { get ; set ; }
public virtual DbSet < WRITE > WRITE { get ; set ; }
public virtual DbSet < CARTLIST > CARTLIST { get ; set ; }
public virtual DbSet < PURCHASE > PURCHASE { get ; set ; }
public virtual DbSet < ZUOZHE > ZUOZHE { get ; set ; }
This type of class corresponds to the relational schema in the database. Its member variables are all attributes in the relational schema and their get and set methods, as well as records whose main code is referenced by other relations and foreign code constraints and the corresponding get and set methods.
The member variables of several of the more important classes are as follows:
public decimal ID { get ; set ; } public string ISBN { get ; set ; } public string NAME { get ; set ; } public Nullable < decimal > PRICE { get ; set ; } public string IMAGE { get ; set ; } public string CATEGORY { get ; set ; } public string PUBLISHER { get ; set ; } public string PUBLISHTIME { get ; set ; } public string ABSTRACT { get ; set ; } //BOOK关系的属性 [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Microsoft.Usage" , "CA2227:CollectionPropertiesShouldBeReadOnly" ) ] public virtual ICollection < CART_INCLUDE > CART_INCLUDE { get ; set ; } //其主码被CART_INCLUDE所引用为外码约束,下面类似 [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Microsoft.Usage" , "CA2227:CollectionPropertiesShouldBeReadOnly" ) ] public virtual ICollection < COMMENTS > COMMENTS { get ; set ; } [ System . Diagnostics . CodeAnalysis . SuppressMessage ( " Microsoft . Usage " , "CA2227 : CollectionPropertiesShouldBeReadOnly " ) ] public virtual ICollection < ORDER_INCLUDE > ORDER_INCLUDE { get ; set ; } [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Microsoft.Usage" , "CA2227:CollectionPropertiesShouldBeReadOnly" ) ] public virtual ICollection < WRITE > WRITE { get ; set ; } [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Microsoft.Usage" , "CA2227:CollectionPropertiesShouldBeReadOnly" ) ] public virtual ICollection < CATEGORY > CATEGORY1 { get ; set ; } [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Microsoft.Usage" , "CA2227:CollectionPropertiesShouldBeReadOnly" ) ] public virtual ICollection < USERS > USERS { get ; set ; }
public decimal ID { get ; set ; } 、 public string NAME { get ; set ; } public string GENDER { get ; set ; } public string EMAIL { get ; set ; } public string PASSWORD { get ; set ; } public string ACCOUNT { get ; set ; } public string AUTHORITY { get ; set ; } //USERS关系的属性 [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Microsoft.Usage" , "CA2227:CollectionPropertiesShouldBeReadOnly" ) ] public virtual ICollection < ADDRESS > ADDRESS { get ; set ; } //其主码被ADDRESS引用,下面类似 public virtual CART CART { get ; set ; } [ System . Diagnostics . CodeAnalysis . SuppressMessage ( " Microsoft . Usage " , "CA2227 : CollectionPropertiesShouldBeReadOnly " ) ] public virtual ICollection < CART_INCLUDE > CART_INCLUDE { get ; set ; } [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Microsoft.Usage" , "CA2227:CollectionPropertiesShouldBeReadOnly" ) ] public virtual ICollection < COMMENT_FEEDBACK > COMMENT_FEEDBACK { get ; set ; } [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Microsoft.Usage" , "CA2227:CollectionPropertiesShouldBeReadOnly" ) ] public virtual ICollection < COMMENTS > COMMENTS { get ; set ; } [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Microsoft.Usage" , "CA2227:CollectionPropertiesShouldBeReadOnly" ) ] public virtual ICollection < ORDERS > ORDERS { get ; set ; } [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Microsoft.Usage" , "CA2227:CollectionPropertiesShouldBeReadOnly" ) ] public virtual ICollection < BOOK > BOOK { get ; set ; } [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Microsoft.Usage" , "CA2227:CollectionPropertiesShouldBeReadOnly" ) ] public virtual ICollection < ADDRESS > ADDRESS1 { get ; set ; }
public decimal USER_ID { get ; set ; }
public Nullable < decimal > QUANTITY { get ; set ; }
public string TIME_START { get ; set ; }
public Nullable < decimal > POST_COST { get ; set ; }
public Nullable < decimal > TOTAL_PRICE { get ; set ; } //CART关系的属性
public decimal USER_ID { get ; set ; }
public decimal BOOK_ID { get ; set ; }
public Nullable < decimal > QUANTITY { get ; set ; }
public Nullable < decimal > TOTAL_PRICE { get ; set ; } //CART_INCLUDED关系的属性
In order to facilitate querying (such as querying the detailed information of books in shopping carts and orders, corresponding to authors and books), we have established some views in the database, and these views also have corresponding classes in Models, as follows:
Based on the CART_INCLUDE relationship and the BOOK relationship, you can know the information and purchase status of the books in the shopping cart:
public decimal USER_ID { get ; set ; }
public decimal BOOK_ID { get ; set ; }
public string NAME { get ; set ; }
public Nullable < decimal > PRICE { get ; set ; }
public string IMAGE { get ; set ; }
public Nullable < decimal > QUANTITY { get ; set ; }
public Nullable < decimal > TOTAL_PRICE { get ; set ; }
Based on the AUTHOR relationship, WRTIE relationship and BOOK relationship, the book information and author information are mapped according to the writing relationship:
public string AUTHOR_NAME { get ; set ; }
public decimal BOOK_ID { get ; set ; }
public decimal AUTHOR_ID { get ; set ; }
According to the ORDER_INCLUDE relationship, the BOOK relationship is generated, and you can know the information and purchase status of the books in the order:
public decimal ORDER_ID { get ; set ; }
public string NAME { get ; set ; }
public Nullable < decimal > PRICE { get ; set ; }
public string IMAGE { get ; set ; }
public Nullable < decimal > QUANTITY { get ; set ; }
public Nullable < decimal > TOTAL_PRICE { get ; set ; }
public string ABSTRACT { get ; set ; }
public string PUBLISHER { get ; set ; }
public string AUTHOR_NAME { get ; set ; }
public decimal ID { get ; set ; }
public decimal AUTHOR_ID { get ; set ; }
The Controllers class is a class in the controller, which is used to return the view display page and respond to operation requests on the page. The key issue is to complete the data transfer between the controller and the view. The Razor engine and ViewBag are mainly used to pass from the controller to the view; HtmlHelpers, Session and AJAX are used to pass from the view to the controller.
It mainly includes the display of the book details page and the method of responding to the request to add the book to the shopping cart. The member functions are as follows:
public ActionResult Index ( int ID ) //读取图书详情页面所需的所有数据,并返回视图进行展示,参数为图书ID
public ActionResult addCart ( cartSender cs ) //将该图书添加至用户购物车中,通过重定位刷新原页面,如果没有用户登录则不进行操作并跳转至登录页面,参数为利用HTTPPOST从视图传递数据的model
public int directAddCart ( int bookId ) //在首页将点击的图书添加至用户购物车,成功返回0,无用户登录则返回-1,参数为图书ID
It mainly includes the display of the favorites page and the method of responding to the request to change the favorites. The successful execution of all operations of this controller requires the user to log in. The member functions are as follows:
public ActionResult Index ( int ID ) //读取收藏夹页面所需的所有数据,并返回视图进行展示,在没有用户登录的情况下不进行操作并跳转至登录页面,参数为用户ID
public ActionResult addFav ( int ID ) //在图书详情页面将图书加入收藏夹,通过重定位刷新原页面,如果没有用户登录则不进行操作并跳转至登录页面,参数为图书ID
public int directAddFav ( int bookId ) //在首页将点击的图书添加至收藏夹,成功返回0,无用户登录则返回-1,参数为图书ID
public void DeleteFav ( int [ ] bookIds ) //将所有选中的图书移除收藏夹,参数为选中的图书的ID
It mainly includes the display of the shopping cart page and the methods to respond to all operation requests on the page. The successful execution of all operations of this controller requires the user to log in. The member functions are as follows:
public ActionResult Index ( int ID ) //读取购物车页面所需的所有数据,并返回视图进行展示,在没有用户登录的情况下不进行操作并跳转至登录页面,参数为用户ID
public void RemoveBook ( int bookId ) //将购物车中的某个图书项目移出购物车,参数为图书ID
public void AddFav ( int bookId ) //将购物车中的某个图书移入收藏并移出购物车,参数为图书ID
public void EditAmount ( int bookId , int bookAmount ) //通过购物车页面的加减按钮改变购物车中某一图书的数量,参数为用户ID和改变后的数量
public ActionResult AddAddress ( ADDRESS aDDRESS ) //响应购物车页面上方地址栏的添加新地址请求,参数为通过HTTPPOST传递的参数model
It mainly includes the display of the order management page and the order filling and completion page, as well as the methods to respond to all operation requests on these pages. All operations of this controller require the user to log in. The member functions are as follows:
public ActionResult Index ( int ID ) //读取订单管理页面所需的所有数据,并返回视图进行展示,在没有用户登录的情况下不进行操作并跳转至登录页面,参数为用户ID
public void StatusChange ( int orderId ) //在订单管理页面确认收货,参数为订单ID
public void DeleteOrder ( int orderId ) //删除已经签收的订单,参数为订单ID
public void SetComment ( int bookId , int grade , string content ) //对已经签收的图书进行评论,参数为图书ID,分数和评论内容
public int GetOrder ( int [ ] bookIds ) //将购物车中勾选的书目添加至session,返回用户ID
public ActionResult Process_CART ( int ID ) //读取购物车结算时的购买情况,据此返回一个显示订单填写页面,参数为用户ID
public void check ( int addrId ) //根据选择的地址和购买情况生成订单,参数为地址ID
public ActionResult Order_Complete ( ) //显示订单填写成功的页面
It mainly includes methods for displaying the administrator page and responding to all operation requests on the page. All operations of this controller require the administrator to log in. The main member functions are as follows:
public ActionResult Index ( string search_book , string search_user ) //返回管理员操作页面,参数为搜索的图书或用户的字符串
public ActionResult Login ( ) //返回管理员登录页面
public ActionResult Login ( LoginSender msg ) //管理员登录的验证,参数为利用HTTPPOST传递参数的model
public void deleteUser ( int ID ) //删除用户,参数为用户ID
public void deleteBook ( int ID ) //删除书籍,参数为图书ID
public void adjustBook ( int ID , string name , string ISBN , string writer , string category , string publisher , string time , string image , string intro ) //修改书籍