Đang tải... (xem toàn văn)
44 Table of Figures Figure 1: Questionnaire about the business application 1...Figure 2: Questionnaire about the business application 2...Figure 3: Questionnaire about the business appli
Trang 1ASSIGNMENT 2 FRONT SHEET
Trang 3Summative Feedback: Resubmission Feedback:
Internal Verifier’s Comments:
Trang 4Signature & Date:
Trang 5Table of Contents
I Chapter 1: Peer Review and Feedback Analysis (P4) 4
1 Format questionnaire to reviews the business application, problem definition statement, proposed solution and development strategy 4
2 Collect review feedbacks 6
II Chapter 2: Application Development (P5) 8
1 Folder structure of the application 8
2 Source code samples of the application 9
3 Final screenshots of the application 23
4 GitHub 32
III Chapter 3: Application Evaluation (P6) 34
1 Review the performance of the application 34
2 Conclusion 44
Table of Figures Figure 1: Questionnaire about the business application (1)
Figure 2: Questionnaire about the business application (2)
Figure 3: Questionnaire about the business application (3)
Figure 4: Folder structure
Figure 5: Customer Role (1)
Figure 6: Customer Role (2)
Figure 7: Customer Role (3)
Table of Tables Table 1: The result of survey
Table 2: Feedback
Trang 7I Chapter 1: Peer Review and Feedback Analysis (P4)
We've devised an online survey aimed at gathering user feedback post-launch, focusing on their livexperience with the website This survey serves to pinpoint any encountered navigational challenges asolicit recommendations for enhancing the user experience
The survey will cover aspects such as website layout, functionality, and overall user satisfaction, employinuncomplicated questions accessible to all visitors
Our goal is to gather user insights to enhance the website's user-friendliness All comments received will bcarefully reviewed and factored into future updates or improvements
Our primary objective is to ensure a seamless user experience, striving to identify issues and impleme
Trang 8Figure 1: Questionnaire about the business application (1)
Trang 9Figure 2: Questionnaire about the business application (2)
Trang 10Figure 3: Questionnaire about the business application (3)
Trang 112 Collect review feedbacks The result of Survey:
1 Is it realistic for us to not show every product on the fronpage?
One of the following: 1 Yes
3 Do you enjoy the user interface of our website?
One of the following: 1 Yes
2 No
4 How fast does our payment usually take?
One of the following: 1 A few seconds 2 One minute
3 More than one minute 4 Not clear
Trang 125 Does our registration system work properly and provide
correct page when logged in?
One of the following: 1 Yes
Trang 137 Rate our system from 1 to 10 A selection from 1 to 10 Table 1: The result of survey
Feedback:
After collating feedback from our colleagues and authorized individuals who have interacted with orbeen given permission to use our products, the rating for each response stands as follows:
1 Is it realistic for us to not show every product on the fro
3 Do you enjoy the user interface of our website? 78.6% of our feedback choose Ye21.4% of our feedback choose N
4 How fast does our payment usually take?
47.6% of our feedback choose A few seconds
21.4% of our feedback choose Ominute
21.4% of our feedback choose More than one minute
9.5% of our feedback choose Noclear
Trang 145 Does our registration system work properly and provid
the correct page when logged in?
83.3% of our feedback choose Ye16.7% of our feedback choose N
6 What is the typical time it takes for a webpage to fully
Trang 157 Rate our system from 1 to 10
26.2% of our feedback choose 1023.8% of our feedback choose 9 21.4% of our feedback choose 8 14.3% of our feedback choose 7 9.5% of our feedback choose 6 4.8% of our feedback choose 5 Table 2: Feedback
1 Folder structure of the application
Figure 4: Folder structure
To access the configuration file for the login and registration page, examine the Areas folder Here are thedesignated locations for various components within the application:
Trang 172 Source code samples of the application Customer Role:
Upon the initial login by the user, the homepage will integrate a specialized function expressly crafted toexhibit information concerning the availability of books This functionality will showcase an extensive inventory comprising all available books, thereby facilitating customers' effortless selection processes
public async Task<IActionResult> BookProduct() {
var book = await context.Books.ToListAsync(); return View(book);
(book != if null) {
var viewmodel = new Book() {
BookId = book.BookId, Name = book.Name, Quantity = book.Quantity, Price = book.Price,
Description = book.Description, UpdateDate = book.UpdateDate, Author = book.Author,
Image = book.Image,
CategoryId = book.CategoryId,
PublishCompanyId = book.PublishCompanyId
Trang 19The described function empowers clients to incorporate desired books into their basket, wherein thselected items within the cart are securely stored within individual customer accounts
publicasync Task<IActionResult> AddToCart(int id) {
Quantity = 1 };
cart_item.Total = cart_item.Quantity * cart_item.Book.Price; foreach (var item in context.Carts.Include(_ => _.Book).ToList()) {
if (item.BookId == cart_item.BookId) {
return RedirectToAction("CartIndex"); }
}
await context.Carts.AddAsync(cart_item); await context.SaveChangesAsync(); Thread.Sleep(2500);
return RedirectToAction("BookProduct", "Book");}
Trang 20return RedirectToAction("CartIndex"); }
Figure 6: Customer Role (2)
The presented feature facilitates customers in transitioning selected books from their basket to the Order list, enabling a seamless status change The items within the Order list will align with the specific accounts of individual customers
public async Task<IActionResult> OrderBook() {
Trang 21var identity = (ClaimsIdentity)User.Identity;
var claims = identity.FindFirst(ClaimTypes.NameIdentifier); var user = await context.ApplicationUsers.FindAsync(claims.Value); var customer = new Customer()
{
UserId = user.Id, Name = user.FullName, Email = user.Email, Address = user.Address, User = user
};
(!context.Customers.Contains(customer)) if {
await context.Customers.AddAsync(customer); await context.SaveChangesAsync();
}
var order = new Order() {
UserId = user.Id };
await context.Orders.AddAsync(order); await context.SaveChangesAsync();
var order_list = await context.Carts.Include(x => x.Book).ToListAsync(); foreach (var book order_list) in
{
Trang 22await context.AddAsync(orderDetail);
Trang 23await context.SaveChangesAsync(); }
foreach (var book in order_list) {
context.Carts.Remove(book); await context.SaveChangesAsync(); }
foreach (var order_book order_list) in {
var stored_book = await context.Books.FirstOrDefaultAsync(x => x.BookId == order_book.BookId);
int book_quantity_inStored = stored_book.Quantity; book_quantity_inStored -= order_book.Quantity; stored_book.Quantity = book_quantity_inStored; (stored_book.Quantity == 0) if
{
context.Books.Remove(stored_book); }
await context.SaveChangesAsync(); }
Trang 24[HttpPost] //dữ liệu t máy khách(client) lên máy chừ ủ(server) để ử x lý.
Trang 25publicasync Task<IActionResult> CreateCategory(AddCategoryViewModel CategoryModel) {
var category = new Category() {
Name = CategoryModel.Name,
Description = CategoryModel.Description };
await context.Categories.AddAsync(category); await context.SaveChangesAsync();
return RedirectToAction("CategoryIndex"); }
Description = category.Description };
returnawait Task.Run(() => View("ViewCategory", viewmodel)); //truyền đối tượng viewmodel
Trang 27(category != if null) {
context.Categories.Remove(category); await context.SaveChangesAsync(); return RedirectToAction("CategoryIndex"); }
return RedirectToAction("CategoryIndex"); }
Figure 11: Category (4)o Publishing Company:
The function provided below facilitates the StoreOwner in accessing and displaying Publishing Company information within the system
Trang 28{
return View(); }
Trang 29await context.PublicCompanies.AddAsync(company); await context.SaveChangesAsync();
return RedirectToAction("CompanyIndex"); }
{
company.Name = model.Name; company.Adress = model.Adress; await context.SaveChangesAsync(); return RedirectToAction("CompanyIndex"); }
return RedirectToAction("CompanyIndex"); }
Figure 14: PublishCompany (3)
The function described below enables the StoreOwner to remove Publishing Company information [HttpPost]
Trang 30publicasync Task<IActionResult> DeleteCompany(UpdateCompany model) {
company =
context.PublicCompanies.FindAsync(model.PublishingCompanyId); if (company != null)
{
context.PublicCompanies.Remove(company); await context.SaveChangesAsync();
return RedirectToAction("CompanyIndex");
Trang 31}
return RedirectToAction("CompanyIndex"); }
Figure 15: PublishCompany (4) o Book:
The following function enables the StoreOwner to access and exhibit information regarding books available within the system
Trang 32{
//lay các thu c tính raộ
Name = BookModel.Name, Quantity = BookModel.Quantity, Price = BookModel.Price,
Description = BookModel.Description, UpdateDate = BookModel.UpdateDate, Author = BookModel.Author,
Image = uniqueFileName,
FronImage = BookModel.FronImage, CategoryId = BookModel.CategoryId,
PublishCompanyId = BookModel.PublishCompanyId, Category = BookModel.Category,
Trang 33PublishCompany = BookModel.PublishCompany };
foreach (var bookitem context.Books.ToList()) in {
(book.Name == bookitem.Name) if {
var NewQuantity = bookitem.Quantity.ToString(); var StoredQuantity = book.Quantity.ToString();
int ToStoredQuantity = int.Parse(StoredQuantity) + int.Parse(NewQuantity); //số lượng sách
bookitem.Quantity = ToStoredQuantity; bookitem.UpdateDate = book.UpdateDate; await context.SaveChangesAsync(); return RedirectToAction("BookIndex"); }
}
context.Books.Attach(book); //đính kèm
context.Entry(book).State = EntityState.Added; await context.Books.AddAsync(book); await context.SaveChangesAsync(); return RedirectToAction("BookIndex"); }
Trang 34g p y_ ( p g p y"Name", model.PublishCompanyId);//render du lieu ra view
var book = await context.Books.FirstOrDefaultAsync(x => x.BookId == model.BookId); string change_img = UploadedFile(model);
(book != if null) {
book.Name = model.Name; book.Quantity = model.Quantity; book.Price = model.Price;
book.Description = model.Description; book.UpdateDate = model.UpdateDate; book.Author = model.Author;
(change_img !if = null) {
Trang 35book.Image = change_img; }
book.CategoryId = model.CategoryId;
book.PublishCompanyId = model.PublishCompanyId; await context.SaveChangesAsync();
} else {
return NotFound("Book Not Found"); }
await context.SaveChangesAsync(); return RedirectToAction("BookIndex"); }
Trang 51Upon successful registration and subsequent login as a customer, the screen will display the registered Gmail account information, affirming the successful login process
Following a successful login as a customer, the Shop screen will be presented, showcasing a variety of products, particularly books, for customers to browse through and purchase
Trang 53The displayed shopping cart page exhibits the products that the customer has added from the system's home page
The displayed page contains the detailed information regarding the confirmed Order that the customer proceeded with from the shopping cart page
Trang 54StoreOwner Role:
Trang 55Below is the screen after logging in as a Storeowner The Gmail account information will be displayed on the screen to confirm the successful login
Upon logging in as a Storeowner, the screen will display the Gmail account information to confirm the successful login process
Trang 57The provided page serves as the management interface for Store Owners, enabling actions such as displaying the book list, creating new entries, accessing book details, performing edits, and deleting bookwithin the system
The presented page serves as the interface for Store Owners to oversee Categories, facilitating actions such as displaying the category list, creating new categories, and performing edits to existing categories within the system
Trang 59The provided page serves as the interface for Store Owners to manage Publishing Companies, enabling actions such as displaying the list of Publishing Companies, creating new entries, and performing edits toexisting Publishing Company information within the system
Admin Role:
Upon successful login as an admin, the screen will confirm the login by displaying the Gmail account information.
Trang 61Below is the page that the Admin uses to manage customer account including displaying the list of customer account, remove customer account, and reset password
The presented page serves as the interface for the Admin to oversee customer accounts, facilitating actiosuch as displaying the list of customer accounts, removing specific accounts, and resetting passwords focustomers within the system.
Trang 63The provided page acts as the interface for the Admin to oversee the comprehensive list of accepted Categories managed by Store Owners, allowing actions such as deleting specific Categories within the system
Trang 67III Chapter 3: Application Evaluation (P6)
1 Review the performance of the application
1 Register Register page of the website
Update Category pageof the website
Add Book
(StoreOwner) page of the website
Trang 68Category Approval (Admin) page of the website
Trang 6915
Category Reject (Admin)
Category Reject (Admin) page of the website
16
Manage StoreOwner Account (Admin)
Manage StoreOwner Account (Admin) page of the website
17 Manage Customer Account (Admin)
Manage Customer Account (Admin) page of the website
Trang 74Figure Test case 5 37
Trang 75Figure Test case 6 38
Trang 82Figure Test case 9 43
Trang 84Figure Test case 11 45
Trang 85Figure Test case 12 46
Figure Test case 13 47
Trang 87Figure Test case 14 48
However, from the consumer perspective, there's substantial room for improvement within the systemSeveral anticipated features typically found on a bookstore website are missing Consequently, customehave created a Google Form detailing their suggestions and requirements to propose enhancements instance, they've noted issues such as the inability to complete payment after placing an order, a desire a suggestion feature in the search field, delays in book display times on the screen, and confusion arisi
Trang 88a suggestion feature in the search field, delays in book display times on the screen, and confusion arisifrom presenting all books in the selection and search
Link GitHub: https://github.com/thangpdgcd/FPT_BOOKMVC.git