Tải bản đầy đủ (.pdf) (88 trang)

unit 30 application development 1

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (6.1 MB, 88 trang )

<span class="text_page_counter">Trang 1</span><div class="page_container" data-page="1">

ASSIGNMENT 2 FRONT SHEET

</div><span class="text_page_counter">Trang 3</span><div class="page_container" data-page="3">

Summative Feedback: Resubmission Feedback:

Internal V<b>erifier’s</b> Comments:

</div><span class="text_page_counter">Trang 4</span><div class="page_container" data-page="4">

Signature & Date:

</div><span class="text_page_counter">Trang 5</span><div class="page_container" data-page="5">

Table 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 ...

</div><span class="text_page_counter">Trang 7</span><div class="page_container" data-page="7">

I. 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

</div><span class="text_page_counter">Trang 8</span><div class="page_container" data-page="8">

Figure 1: Questionnaire about the business application (1)

</div><span class="text_page_counter">Trang 9</span><div class="page_container" data-page="9">

Figure 2: Questionnaire about the business application (2)

</div><span class="text_page_counter">Trang 10</span><div class="page_container" data-page="10">

Figure 3: Questionnaire about the business application (3)

</div><span class="text_page_counter">Trang 11</span><div class="page_container" data-page="11">

2. Collect review feedbacks

The result of Survey:

1 <sup>Is it realistic for us to not show every product on the fron</sup><sub>page?</sub>

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

</div><span class="text_page_counter">Trang 12</span><div class="page_container" data-page="12">

5 <sup>Does our registration system work properly and provide</sup>

correct page when logged in?

One of the following: 1. Yes

</div><span class="text_page_counter">Trang 13</span><div class="page_container" data-page="13">

7 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 <sup>Is it realistic for us to not show every product on the fro</sup>

3 Do you enjoy the user interface of our website? <sup>78.6% of our feedback choose Ye</sup><sub>21.4% of our feedback choose N</sub>

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

</div><span class="text_page_counter">Trang 14</span><div class="page_container" data-page="14">

5 <sup>Does our registration system work properly and provid</sup>

the correct page when logged in?

83.3% of our feedback choose Ye16.7% of our feedback choose N

6 <sup>What is the typical time it takes for a webpage to fully </sup>

</div><span class="text_page_counter">Trang 15</span><div class="page_container" data-page="15">

7 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:

</div><span class="text_page_counter">Trang 17</span><div class="page_container" data-page="17">

2. 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

</div><span class="text_page_counter">Trang 19</span><div class="page_container" data-page="19">

The 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");}

</div><span class="text_page_counter">Trang 20</span><div class="page_container" data-page="20">

return 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() {

</div><span class="text_page_counter">Trang 21</span><div class="page_container" data-page="21">

var 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

{

</div><span class="text_page_counter">Trang 22</span><div class="page_container" data-page="22">

await context.AddAsync(orderDetail);

</div><span class="text_page_counter">Trang 23</span><div class="page_container" data-page="23">

await 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(); }

</div><span class="text_page_counter">Trang 24</span><div class="page_container" data-page="24">

[HttpPost] //dữ liệu t máy khách(client) lên máy chừ ủ(server) để ử x lý.

</div><span class="text_page_counter">Trang 25</span><div class="page_container" data-page="25">

publicasync 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

</div><span class="text_page_counter">Trang 27</span><div class="page_container" data-page="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.

</div><span class="text_page_counter">Trang 28</span><div class="page_container" data-page="28">

{

return View(); }

</div><span class="text_page_counter">Trang 29</span><div class="page_container" data-page="29">

await 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]

</div><span class="text_page_counter">Trang 30</span><div class="page_container" data-page="30">

publicasync Task<IActionResult> DeleteCompany(UpdateCompany model) {

company =

context.PublicCompanies.FindAsync(model.PublishingCompanyId); if (company != null)

{

context.PublicCompanies.Remove(company); await context.SaveChangesAsync();

return RedirectToAction("CompanyIndex");

</div><span class="text_page_counter">Trang 31</span><div class="page_container" data-page="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..

</div><span class="text_page_counter">Trang 32</span><div class="page_container" data-page="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,

</div><span class="text_page_counter">Trang 33</span><div class="page_container" data-page="33">

PublishCompany = 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"); }

</div><span class="text_page_counter">Trang 34</span><div class="page_container" data-page="34">

g 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) {

</div><span class="text_page_counter">Trang 35</span><div class="page_container" data-page="35">

book.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"); }

</div><span class="text_page_counter">Trang 51</span><div class="page_container" data-page="51">

Upon 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.

</div><span class="text_page_counter">Trang 53</span><div class="page_container" data-page="53">

The 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.

</div><span class="text_page_counter">Trang 54</span><div class="page_container" data-page="54">

StoreOwner Role:

</div><span class="text_page_counter">Trang 55</span><div class="page_container" data-page="55">

Below 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.

</div><span class="text_page_counter">Trang 57</span><div class="page_container" data-page="57">

The 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.

</div><span class="text_page_counter">Trang 59</span><div class="page_container" data-page="59">

The 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.

</div><span class="text_page_counter">Trang 61</span><div class="page_container" data-page="61">

Below 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.

</div><span class="text_page_counter">Trang 63</span><div class="page_container" data-page="63">

The 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..

</div><span class="text_page_counter">Trang 67</span><div class="page_container" data-page="67">

III. Chapter 3: Application Evaluation (P6)

1. Review the performance of the application

<small>1 </small> <sub>Register </sub> <small>Register page of the website </small>

<small>Update Category pageof the website </small>

<small>Add Book </small>

<small>(StoreOwner) page of the website </small>

</div><span class="text_page_counter">Trang 68</span><div class="page_container" data-page="68">

<small>Category Approval (Admin) page of the website </small>

</div><span class="text_page_counter">Trang 69</span><div class="page_container" data-page="69">

<small>15 </small>

<small>Category Reject (Admin) </small>

<small>Category Reject (Admin) page of the website </small>

<small>16 </small>

<small>Manage StoreOwner Account (Admin) </small>

<small>Manage StoreOwner Account (Admin) page of the website </small>

<small>17 </small> <sub>Manage Customer </sub><small>Account (Admin) </small>

<small>Manage Customer Account (Admin) page of the website </small>

</div><span class="text_page_counter">Trang 74</span><div class="page_container" data-page="74">

<small>Figure Test case 5 37</small>

</div><span class="text_page_counter">Trang 75</span><div class="page_container" data-page="75">

<small>Figure Test case 6 38</small>

</div><span class="text_page_counter">Trang 82</span><div class="page_container" data-page="82">

<small>Figure Test case 9 43</small>

</div><span class="text_page_counter">Trang 84</span><div class="page_container" data-page="84">

<small>Figure Test case 11 45</small>

</div><span class="text_page_counter">Trang 85</span><div class="page_container" data-page="85">

<small>Figure Test case 12 46</small>

<small>Figure Test case 13 47</small>

</div><span class="text_page_counter">Trang 87</span><div class="page_container" data-page="87">

<small>Figure Test case 14 48</small>

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

</div><span class="text_page_counter">Trang 88</span><div class="page_container" data-page="88">

a 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:

</div>

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×