SIM UNIVERSITY SCHOOL OF SCIENCE AND TECHNOLOGY NAIL PRODUCTS WEBSITE DEVELOPMENT STUDENT : LEE SZE HUI (J0805304) SUPERVISOR : DR. YOONG CHEAH HUEI PROJECT CODE : JUL2010/ICT/007 A project report submitted to SIM University in partial fulfilment of the requirements for the degree of Bachelor of Science (Information Technology and Business) May 2011 1 ABSTRACT X-Nail Pte Ltd has been operating in many countries for more than 10 years. Now, the company is expanding its sales through an online web store. The development of this software will benefit its customers and own administrators. With the advancement of technology especially in E-Commerce, it is becoming increasingly popular for consumers to shop online. The online website is a powerful tool for business to boost sales as it definitely cost lesser to set up an online store compared to physical store. The physical space available in the store is also limited while a company can basically hold as many products as possible on an online store. Online shopping has no doubt become increasingly convenient for consumers as they do not have to waste time travelling to the store and they can have an overview of all the products available in a click. Nowadays, it has become a norm for companies to develop a website for their store. Some companies do not even have a physical store and simply operate with the online store. Thus, with the increasing trend seen in online shopping in recent years, X-Nail Pte Ltd, a company which sells nail products, is looking into developing an online store to reach out to more consumers to generate more sales. In this project, a nail product website is required to allow users to browse the catalogue and place an order online. The online database will also be developed, it will hold the list of products and product details, allowing administrators to add, modify or delete the items 2 ACKNOWLEDGEMENT I will like to thank everyone who has helped me in one way or another to the completion of this project, especially my project supervisor, Dr Andrew Yoong. I am thankful for his invaluable support and guidance to the different matters related to this project. I am equally grateful to my brother, Joseph Lee, for his time and encouragement by explaining and correcting my doubts throughout the entire project phase. Without his guidance, overcoming the difficulties which I experienced would be of utmost challenge. Last but not least, I will like to thank my supervisor at work for being understanding and at times allowing me to take time off to complete my project. 3 TABLE OF CONTENTS Page ABSTRACT..................................................................................................................................... 2 ACKNOWLEDGEMENT................................................................................................................ 3 CHAPTER 1: INTRODUCTION..................................................................................................... 7 1.1 Project Objectives....................................................................................................... .............. 7 1.2 Overall Objectives..................................................................................................................... 7 1.3 Literature Review........................................................................................................ .............. 7 1.4 Project Approach....................................................................................................................... 7 1.5 Components of a System................................................................................................... ........ 9 CHAPTER 2: PROJECT METHODOLOGY................................................................................ 11 2.1 System Development Life Cycle............................................................................................ ...11 2.1.1 Feasibility..................................................................................................................... .... 12 2.1.2 System Analysis...................................................................................................... ..........12 2.1.3 System Design.......................................................................................................... ........ 12 2.1.4 System Development........................................................................................................ 12 2.1.5 System Implementation.................................................................................................. .. 12 2.1.6 Testing.............................................................................................................................. 12 2.1.7 Maintenance ........................................................................................................... .......... 12 2.1.8 Advantages of Waterfall Approach.................................................................................. 13 2.1.9 Disadvantages of Waterfall Approach.............................................................................. 13 2.2Equipment and Resource........................................................................................................... 13 2.2.1 Technologies..................................................................................................................... 13 2.2.1.1 ASP.Net................................................................................................................. 13 2.2.1.2 Visual Basic........................................................................................................... 13 2.2.1.3 SQL Statements..................................................................................................... 14 2.2.2 Hardware........................................................................................................................... 14 2.2.3 Software............................................................................................................................ 14 2.2.3a Visual Studio 2010 Professional............................................................................ 14 2.2.3b Microsoft SQL 2008 Server................................................................................... 15 2.2.3c Microsoft Words 2007........................................................................................... 15 2.2.3d Adobe Photoshop CS5........................................................................................... 15 2.2.4 Resources.......................................................................................................................... 15 2.3 Database Design Methodology................................................................................................. 15 CHAPTER 3: SYSTEM ANALYSIS............................................................................................... 17 3.1 Information Gathering............................................................................................................... 17 3.1.1 Information Sources.......................................................................................................... 17 3.1.1a People.................................................................................................................... 17 3.1.1b Documentation...................................................................................................... 17 3.2 User Needs Identification.......................................................................................................... 17 3.2.1 Questionnaires.......................................................................................................... 18 3.2.2 Prototyping............................................................................................................... 18 3.2.3 Use Cases................................................................................................................. 18 3.2.4 Scenario.................................................................................................................... 19 3.3 Activity Diagram......................................................................................................... .............. 21 3.4 Sequence Diagram......................................................................................................... ............ 21 3.4.1 Customer Registration.............................................................................................. 22 3.4.2 Customer/Admin Login............................................................................................ 22 3.4.3 Administrator – Add a new product......................................................................... 23 CHAPTER 4: SYSTEM DESIGN.................................................................................................... 24 4.1 User Interface Design................................................................................................................ 24 4.1.1 Approach to Design Principles......................................................................................... 24 4.2 Proposed User Interface Design................................................................................................ 24 4.2.1 Evaluating the Proposed Interface Design........................................................................ 26 4.3 Constraints and Assumptions.................................................................................................... 26 4 4.4 Database Design........................................................................................................................ 27 4.5System Architecture Design...................................................................................................... 28 CHAPTER 5: SYSTEM IMPLEMENTATION............................................................................. 29 5.1 Software Development.............................................................................................................. 29 5.2 Database Development..................................................................................................... ........ 29 5.2.1 Conceptual Schema.......................................................................................................... 29 5.2.2 External Schema........................................................................................................ ....... 29 5.2.3 Physical or Internal Schema............................................................................................. 30 5.3 User Acceptance Test.............................................................................................................. 30 CHAPTER 6: SYSTEM TESTING.................................................................................................. 31 6.1 Database Integrity Testing............................................................................................... ..........31 6.2 SQL Statements......................................................................................................................... 31 6.3Functional Testing..................................................................................................................... 35 6.3.1 Password Strength.......................................................................................................... .. 35 6.3.2 Username Already Exist................................................................................................. . 36 6.3.3 Login Successful....................................................................................................... ....... 37 6.3.4 Browse Catalogue............................................................................................................ 38 6.3.5 Shopping Cart.......................................................................................................... ........ 39 6.3.6 Admin Functions............................................................................................................. 40 CHAPTER 7: PROJECT MANAGEMENT................................................................................... 42 7.1 Project Life Cycle...................................................................................................................... 42 7.1.1 Initiating............................................................................................................. ............... 42 7.1.2 Planning............................................................................................................................ 43 7.1.3 Executing.............................................................................................................. ............ 43 7.1.4 Monitoring and Controlling.............................................................................................. 43 7.1.5 Closing................................................................................................................ .............. 44 7.2 Work Breakdown Structure....................................................................................................... 44 7.3 Gantt Chart.............................................................................................................. .................. 46 7.4 Risk Management..................................................................................................................... 47 CHAPTER 8: CRITICAL REVIEW AND EVALUATION......................................................... 48 8.1 Database Development.............................................................................................................. 48 8.2 System Development....................................................................................................... ......... 48 8.3 Project Management................................................................................................................. 48 CHAPTER 9: CONCLUSION AND FUTURE WORK................................................................ 49 9.1 Conclusion...................................................................................................................... ........... 49 9.2 Future Enhancements............................................................................................. ................... 49 9.2.1 Use Macromedia Flash to enhance the website appearance............................................. 49 9.2.2 Product Categories.................................................................................................... ........ 50 9.2.3 Product Search.................................................................................................................. 50 9.2.4 Order History.................................................................................................................... 50 9.2.5 Stored Password Security................................................................................................. 50 CHAPTER 10: REFLECTION........................................................................................................ 51 10.1 Problems Encountered............................................................................................................. 51 10.1.1 Lack of Programming Experience.................................................................................. 51 10.1.2 Time Constraint....................................................................................................... ....... 51 10.1.3 Software Expiry.............................................................................................................. 51 10.1.4 System Incompatibility................................................................................................... 52 10.1.5 Renaming filenames....................................................................................................... 52 10.2 Personal Reflection.................................................................................................................. 53 REFERENCES................................................................................................................................... 54 APPENDIX A: Activity Diagram..................................................................................................... 56 APPENDIX B: User Interface Design Screen Shots....................................................................... 57 5 APPENDIX C: User Interface Design Screen Shots (Admin)........................................................61 APPENDIX D: Entity Relation Model............................................................................................. 63 APPENDIX E: Entity Definition Table............................................................................................ 64 APPENDIX F: Source Codes – Default.aspx................................................................................... 65 APPENDIX G: Source Codes – Login.aspx..................................................................................... 67 APPENDIX H: Source Codes – Register.aspx.................................................................................69 APPENDIX I: Source Codes – ChangePassword.aspx...............,,.................................................. 71 APPENDIX J: Source Codes – ViewProducts.aspx........................................................................ 73 APPENDIX K: Source Codes – WhatsNew.aspx............................................................................ 78 APPENDIX L: Source Codes – NailCare.aspx................................................................................ 80 APPENDIX M: Source Codes – ContactUs.aspx............................................................................ 81 APPENDIX N: Source Codes – OrderItem.aspx............................................................................ 83 APPENDIX O: Source Codes – LoginAdmin.aspx......................................................................... 86 APPENDIX P: Source Codes – MainMenuAdmin.aspx.................................................................88 APPENDIX Q: Source Codes – ProductAdmin.aspx..................................................................... 90 APPENDIX R: Source Codes – UpdateProductAdmin.aspx......................................................... 93 APPENDIX S: Source Codes – Checkout.aspx.............................................................................. 98 APPENDIX T: Source Codes – OrderInformation.aspx............................................................... 102 APPENDIX U: Source Codes – Confirmation.aspx....................................................................... 107 6 CHAPTER ONE: INTRODUCTION 1.1 Project Objectives The project objective is to create an online shopping catalogue for customers to generate more sales for the X-Nail Pte Ltd, while they reach out to more customers via the internet technology. The online database will also be developed, it will hold the list of products and product details, allowing administrators to add, modify or delete. The project will require extensive research on online retailing and web based database inventory. There will be a need to explore in details about Visual Basic and MS SQL so that the exact system based on the documentation can be developed. After the requirements have been stated, modules can be integrated together and system will be tested about 28 days before date line. Lastly, a prototype web site with about 90% of all planned features and information will be available for testing 21 days before date line 1.2 Overall Objectives The main aim of this project is to benefit customers who are interested in the company’s products and as well as the company’s administrator, who can easily track and monitor stock inventory. With the development of an online shopping catalogue, customers can browse the available products at their convenience, anytime and anywhere, as long as their computer is connected to the internet. Some customers may find making a trip down to the physical store time consuming, while some others may dislike the process of combing through a store for the products they want. Also, unlike a physical store, the catalogue is available online for 24 hours a day. With the development of an online database, the company can save space, without having to display the products out physically, thus saving cost. The administrator can track stock level easily and access or modify stock availability and status when required, and with consistency, the company’s inventory can be maintained neatly, saving the trouble and time for unaccountable missing figures. Internet technology is a powerful tool; the online catalogue will reach out to more audience and draw more sales if making online purchases are made convenient and affordable to customers. 7 1.3 Literature Review With the advancement in technology, there is no doubt internet retailing has emerged as a dramatic new mode of business. Internet retailing is about having one party, the provider, selling products or providing services on an online website and the other party being the customers, buying products or services from them through a computer connected to the internet. (Zhang et al., 2010). As many companies try to globalize their sales, it is through the internet where they can promote and advertise their products to the world. Many companies already have one or more retail stores but are looking into adding web pages because online ordering has taken over mail and phone orders drastically over the years. Judging from this aspect, X-Nail Pte Ltd should join in the trend to try to reach out to more customers by putting up its catalogue online. There are many advantages to shopping online for consumers. One of the advantages of using an Internet retailer from a consumer’s point of view is the convenience factor and the potential reduction in shopping time. If consumers view time as valuable, then the ease with which an Internet site can be searched and shopped may have implications for the Internet retailer. (Yannis, 1991). Also, while physical stores operate during office hours, online web stores are up usually 24 hours a day. During the closing hours of the physical store, customers are most likely to go online to view catalogue or make purchases. In order not to lose customers to other competitors during normal non-operating hours, it is to X-Nail Pte Ltd’s benefit to launch an online web store which can cater to customers’ needs around the clock. X-Nail Pte Ltd is a company that sells nail polishes, which often come in different colours and colour shades. For such products, it is important to provide customers more choices since there are so many colours and many different shades in the market. In online shopping, there is "infinite shelf space". “Consumers desire a variety of products because they look for the right product that will fully satisfy them. There is infinite variety of products available online because online shopping allows consumers to browse through products that are made all around the world without geographical boundaries.” (Lee, n.d.). Online shopping also allows customers to do comparison among companies. For example, when a customer goes online to search for nail polishes, she will tend to compare the product 8 from different websites. If X-Nail Pte Ltd has a website, there is a chance that the customer will consider making the purchase from the company. In this way, X-Nail Pte Ltd is able to draw new customers and keep existing customers by providing them products and services round the clock. Generally, for a small business that has few products and product lines, an online ordering system usually will do a decent job. However, if the business is big, with many products for sale, the business will require a store-building, catalogue-managing system, that can produce and manage the product pages for each item it puts up for sale. (Wilson et al., 2006). A storebuilding system is one system which can build and manage both an e-commerce site’s web pages and its ordering system and a good online shopping website has to provide convenience, security, and efficient handling of customers' order. As we can see from www.piggypolish.com, at the catalogue page, customers can view the nail polishes according to “all colours”, “collections” or “shades”. The customer can also view “By the bottle” or “Consumers Collection”. The website clearly makes use of category hierarchy as it categorizes products by a single dimension. (Lee, et al, n.d.). The website requires customers to have a registered account before an order can be made. This should be the basic features that X-Nail Pte Ltd’s website will have since www.piggypolish.com will be its direct competitor. Thus, with the above investigations, I felt that X-Nail Pte Ltd has a realistic goal and objective to expand their sales online. With the advancement of technology, X-Nail Pte Ltd has explored another opportunity to generate more sales and expand customer base. 1.4 Project Approach Browsing products along a category hierarchy is the most popular navigation method and it is used by most online product catalogues. It is familiar and easy to understand for most users. As nail polishes come in all sort of colours, it is a good choice to have them sorted according to colour shades and/or collection theme names. The online shopping catalogue should be able to facilitate efficient navigation of the product information space. To make online shopping convenient, the catalogue will be straightforward and allow customers to view product details or add items to cart with a few 9 clicks. Some websites will bring the customers to another page where unrelated product details are displayed where customers may feel that their privacy is compromised. The customers will have to choose the category under which their item is listed (for e.g. Pink shades), and then they can select the item that they are looking for. Once the desired nail polish colour has been chosen, the customer can add the item to cart by clicking on the “add to cart” button. The customers can continue to shop around and add on to their list, which will be displayed upon checking out. The shopping cart will allow customers to modify or delete any item before the order is made. The customer will then fill up billing and shipping information before the order is finalised. The system administrators’ functions will be more straightforward. They will be able to access the system to maintain the inventory, such as to add, update and delete items. The online catalogue and database will be integrated on a website using Visual Studio as well as MS SQL database. 1.5 Components of a System The components of a system usually consist of a web client, which is usually a browser, a web server, application server and a database server. Information entered into form from a web client is sent to an application server which interfaces with back-end database servers to carry out transactions. HTTP request SQL Database Plugins Web application Web Client Web Server Web application Database Web application HTTP reply (VB script) Fig 1.5a Components of a System 10 CHAPTER TWO: PROJECT METHODOLOGY 2.1 System Development Life Cycle The System Development Life Cycle (SDLC) process applies to information system development projects ensuring that all functional and user requirements and agency strategic goals and objectives are met. It is a conceptual model which describes and tracks each stage of the development. In this project, we will be using the waterfall approach, which composes of 7 stages. One distinctive feature of the waterfall approach is that each stage has to be completed before the next stage can begin. Feasibility System Analysis System Design System Development System Implementatio n Testing Maintenance Fig 2.1a Waterfall Approach with backtracking to previous stage 2.1.1 Feasibility At the initial stage, a feasibility study is carried out to determine if the project gets the “go ahead”. While stakeholders are usually identified at this stage, project and budget plans would also be created for future works to start taking place. At this stage, a project proposal is submitted to the supervisor. 11 2.1.2 System Analysis The system analysis stages deals with defining the functions and end user requirement. Requirement analysis, mainly fact-gathering techniques such as conducting an interview or a survey, will be carried out at this stage and system analyst will start to analyze end users information needs. The purpose of the project and its proposed content and functionality will also be determined. The functional specifications of the system is developed here. 2.1.3 System Design The design stage describes the desired features and layout of the system and will fulfil the requirements as stated in the analysis stage. Using the previous information gathered, the system specification is produced. 2.1.4 System Development The purpose of the development phase is to translate the design of the system into code in a given programming language. During this stage, the system will be heavily involved in coding. The project will be done using Visual Studio where ASP.net will be used. 2.1.5 System Implementation The implementation stage will translate the design into coding. Software programmers will be involved to interpret the business rule and pseudo code to build the website. Different high level programming languages will be used for coding. 2.1.6 Testing The system will be tested as an individual module, as well as a whole system. The system analyst will make sure that the system works according to the requirements and make any changes if there is any flaw in the system. The system will be tested and accepted at this stage. 2.1.7 Maintenance The maintenance stage will be ongoing since the system will require ongoing monitoring and systematic checking even after the product has been delivered to the customer. In this 12 stage, the system analyst will make future corrections, addition or deletion according to the changing requirements. 2.1.8 Advantages of Waterfall Approach In a waterfall approach, the problems are divided into different phases which allow departmentalization and managerial control. The stages are clearly defined and can help to plan and schedule a project. Problems can be verified at the end of each phase before moving on to the next one which will cause a minimal impact compared to only identifying the problems at the last stage of the project. The progress of the project is also easily measureable. 2.1.9 Disadvantages of Waterfall Approach One of the main disadvantages of a water approach is that it does not allow iteration. This approach assumes that the requirements will not change at any part of the project and thus, when there is a change, the entire system has to restart from scratch. As The client usually only has a vague idea of exactly what is required from the software product, this WM has difficulty accommodating the natural uncertainty that exists at the beginning of the project. 2.2 Equipment and Resource There are various technologies, equipments and resources available in the market for use. The following are some of the reasons why I have chosen the specific tools for this project: 2.2.1 Technologies 2.2.1.1 ASP.Net ASP.Net is a powerful technology which allows users to build dynamic web pages and applications. ASP.Net basically came with the Visual Studio under Microsoft and was free to use. 2.2.1.2 Visual Basic I programmed with JAVA and PERL when I was in my Polytechnic school days but only for minor projects and assignments. This was the first time I was exposed to Visual Basic and after reading up about the various programming languages 13 available, I chose Visual Basic. Visual Basic programming, compared to other programming languages, is easy to pick up. Various Visual Basic programming codes which I came across were understandable and easy to interpret. Since I have never created a website using any programming languages before, other than using HTML, I challenged myself to build a strong foundation in Visual Basic by the end of the project. 2.2.1.3 SQL Statements During my course of study in UniSim, I took up Database Processing modules in my second year. SQL statements were not unfamiliar to me as I have learnt and applied my knowledge on database processing on my projects. There were also many reference books in the library which I could borrow to refresh my memory if necessary. 2.2.2 Hardware Before the start of any software development, it is important to ensure the system meets the minimum requirements. As proposed by the school, the minimum requirements for this project include a notebook that runs on Windows OS at least 2Gb of RAM 40GB of Hard disk 2.2.3 Software All of the following softwares have been chosen to develop my website because I already have them installed in my computer. All of the softwares are free and downloaded from the internet. 2.2.3a Visual Studio 2010 Professional The Visual Studio 2010 Professional is an easy to use program to create website for my project. It is extremely helpful for a person who has little experience in developing web pages. The enhanced version is user-friendly and has an in-built MS SQL 2008 server customized for the VS 2010 environment. 14 2.2.3b Microsoft SQL 2008 Server Using the Structured Query Language (SQL) to manage information is becoming very common for many companies nowadays. For people like me, who has been using Microsoft products for the past few years will find that the MS SQL 2008 server is less intimidating than other software, especially when most Microsoft products have similar interface. Another reason for choosing MS SQL 2008 server is that when dealing with large information, the system will not crush easily and thus, providing stability. 2.2.3c Microsoft Words 2007 Microsoft Words 2007 is a saviour to my project, as without this software, I would have to auto correct my grammar and spelling error manually. Microsoft Words document is recognized internationally and has become a popular choice among students. The Microsoft Words 2007 was already installed in my computer, thus there was no need to waste time downloading. 2.2.3d Adobe Photoshop CS5 The Adobe Photoshop is a professional standard digital picture and photo-editing software. It comes with extensive amount of features which allow me to edit and beautify images for use on my website. This software is one of the most popular image editors in the market and it is available to trial download for use of 60 days. 2.2.4 Resource The school has provided us with an online database of previous work done by students over the past few years. There are also library books and free access to journals and publications to prepare for my project. Together with the help of my project supervisor, I was able to complete my project on time. 2.3 Database Design Methodology The database design methodology uses "procedures, techniques, tools and documentation aids to support and facilitate the process of design." (University College Cork, n.d.). It is made up of three main phases; conceptual database design, logical database design and Physical database design. 15 In the conceptual database design, a model of the information used, independent of all physical considerations, is constructed. 16 CHAPTER THREE: SYSTEM ANALYSIS During the system analysis phase, a detailed study of the system will be carried out and the requirements of the system are defined. 3.1 Information Gathering 3.1.1 Information sources Information about the proposed system can be gathered from the following sources. 3.1.1a People The users of the web based inventory system will include general users such as the customers and web administrator. It is important to gather information from them since they will have an impact on the requirement of the system 3.1.1b Documentation This may include publicly available descriptions of other similar systems and standard operating procedures. For example, we will refer to websites like OPI.com, an established nail polish brand website, to look for idea. Other than that, a well maintained system will also have a standard operating procedure that the administrator will follow to replenish the stocks. 3.2 User Needs Identification Once user data has been collected, the analyst can start identifying user needs by using several methods. There are a number of information gathering techniques to understand and refine the system requirements. Some of these techniques can also be combined and used together. 3.2.1 Questionnaires Questions can be closed or open-ended. Open-ended questions are useful for experienced users who are able to explain their needs and problems well. However they can result in too much data, making analysis difficult. 17 Closed ended questions are more focused and best used when the users are not good in expressing themselves. However they limit the responses and may distort results by suggesting options that might not otherwise occur to the user. Examples of open-ended question: “How do you like the products to be arranged on the homepage?” Example of closed ended question: “Do you think a <stock availability> button is required?” 3.2.2 Prototyping Prototyping is a relatively modern technique for gathering requirements. In this approach, you gather preliminary requirements that you use to build an initial version of the solution — a prototype. You show this to the client, who then gives you additional requirements. You change the application and cycle around with the client again. This repetitive process continues until the product meets the critical mass of business needs or for an agreed number of iterations 3.2.3 Use cases Use cases are basically stories that describe how discrete processes work. The stories include people (actors) and describe how the solution works from a user perspective. Use cases may be easier for the users to articulate, although the use cases may need to be distilled later into the more specific detailed requirement. In our project, the actors are identified as the customers, the administrator and the online system. The use case diagram has been developed in the next figure. (Fig 3.2.3a) 18 Delete product Add new product Log in Browse catalogue Place order <<Includes> > Provide payment information Administrator Check order status Customer Update product Edit product Cancel order Delete product Fig 3.2.3a Use Case Diagram 3.2.4 Scenarios We can go through the sequence of actions for a particular situation to accomplish a certain task using the proposed system. Scenarios will be useful to us since they can show the user the operation of the proposed system in a way that they can understand and additional requirements may then be revealed as a result. Scenario for Customer 1. The customer logs on to the internet and access the nail polish website. She will be directed to the home page 2. On the home page, the customer will log in into the account by clicking on the “login” link 3. The customer keys in the UserId and Password 19 4. The system confirms the UserId and Password match and directs the user to the product catalogue page 5. The product details such as number, name, description and price will be displayed 6. The customer adds the product she fancies into the cart 7. The customer can continue shopping or go to checkout 8. The customer will fill up billing information for checkout to complete 9. After the system has taken down the order, the order information will be displayed 10. The customer can click on the “log out” link after shopping is done Alternative Scenario for Customer 1. The customer logs on to the internet and access the nail polish website. She will be directed to the home page 2. On the home page, the customer does not have an account with X-Nail Pte Ltd, thus she signs up by clicking on the “Register Now” link 3. The system will direct her to the Registration page 4. The customer fills up all the necessary user information 5. The customer submits the registration form 6. The system will display a success message 7. The system will direct her to the login page 8. The user will go through steps 3-10 of the previous scenario for Customer Scenario for Administrator 1. The administrator logs on to the internet and access the administrator log in page 2. The administrator keys in the UserId and Password 3. The system confirms the UserID and Password match and directs him to the admin main page 4. The administrator clicks on the respective link (Add item, Delete item, Modify item) - Add item: The administrator keys in the product details and click the “add” button 20 - Delete item: The administrator clicks the “delete” item which is next to the product - Edit item: The administrator clicks on the “edit” button next to the product and make changes to the product number, name, description or price. 5. The administrator clicks on the “done” button to return to main menu 6. The administrator clicks on “log out” after he is done Alternative Scenario for Administrator 1. The administrator logs on to the internet and access the administrator log in page 2. The administrator keys in the UserId and Password 3. UserID and Password do not match 4. The system displays an error message 5. The administrator click on “reset password” 6. The system will prompt the administrator for password hint question and answer 7. Password is reset if answer matches question 8. The system will direct administrator to administrator log in page again 9. The administrator will go through steps 2-6 from previous scenario for Administrator 3.3 Activity Diagram An activity diagram describes the workflow behaviour of a system. It describes the sequence of activities performed by the system from start point to end point. The activity diagram (Appendix B) shows how the system behaves when a customer places an order with the nail polish website. 3.4 Sequence Diagram The sequence diagram is a visual representation of the logic flow within the system. It shows how objects in a system interact and is a popular UML artifact used to identify the behaviour within a system. Some examples of the sequence diagrams used in this project are as follow. 21 3.4.1 Customer Registration For a non member, the customer will click on the “register now” link on the main page to sign up. The customer will be directed to the register screen to fill up user details. The system will create a new user and save the details in the database. Once the userid is registered and stored in the database, the customer is registered successfully. The system will then display a success message on the screen and prompt the user to login screen to sign in. (Fig 3.4.1a) RegisterUser Register Screen Database Customer click register User details createUser Save user userid Registered successfully showMessage Fig 3.4.1a Customer Registration Sequence Diagram 3.4.2 Customer/Administrator Login When the user, both customer and administrator, clicks on the “log in” link on the main page, she will be directed to the login page where she will be prompted to key in the UserId and Password. The system will validate the user by calling checkUserDetails to retrieve match from the database. The database will then produce the result if there is correct match and display the welcome message on the screen. If the result is negative, the system will display an error message to prompt user to log in again. (Fig 3.4.2a) 22 Login Screen Database ValidateUser User click on log in validateUser(userid,password) checkUserDetails UserDetails result showMessage validateUser() Fig 3.4.2a Customer Login Sequence Diagram 3.4.3 Administrator – Add a product The administrator clicks on the “add product” button and will be directed to the add product screen. The administrator will then key in all the product details required and click on “add product” button. The product will be saved and stored into the database and a product ID will be generated. (Fig. 3.4.3a) Add product screen Database AddProduct User Click on “Add product” addProduct)productDetails) Save Product Product ID productID result Fig 3.4.3a Add A Product Sequence Diagram 23 CHAPTER FOUR: SYSTEM DESIGN 4.1 User Interface Design 4.1.1 Approach to Design Principles A user will define how the website will look like; using what kind of fonts and colours as knowing the demographics first is an important task. A good user interface design will be able to provide user with good affordance, visibility and feedback, making use of interface metaphors and direct manipulation. In addition to these design principles, more detailed guidelines are centred on three considerations: match the user, match the task and match the situation. User Designing user interfaces Situation Task Fig 1.6.1a User Interface Design Inputs 4.2 Proposed User Interface Design Userid: Password: What’s new Products Nail Care Tips My Shopping Bag Not a member yet? Welcome! Fig 4.2a Welcome Screen 24 Userid: Password: What’s New Products New arrivals Nail Care Tips (D) Not a member yet? My Shopping Cart Colour shades (A) Search Catalogue (C) Welcome! (B) (E) PRODUCTS Main Page Image Image Image Image What’s New Item name .... ... ... Nail Care SHOPPING CART My Shopping Bag Price ... ... ... Main Page Add to cart Image Add to cart Image Add to cart Image Add to cart Image What’s New Item name .... ... ... Products Nail Care Quantity ... ... ... Price ... ... ... Check Out Fig 4.2b Interaction for a scenario 25 4.2.1 Evaluating the Proposed User Interface In (A), a drop down menu is useful because it reveals the contents of a tab simply by placing the cursor over the main menu navigation bar. Drop down menu conserves screen space and prevents users from entering erroneous data, since it only limited choices. Design principle involved: Using appropriate widgets and components and requiring minimum memory work from the user. In (B), (C) and (E), a user can simply click on the menu tab to get to and back to the screen he wants. Every screen has similar layout which will enable user to be familiar with navigation from screen to screen. An action button is used since it is easy to understand and straight forward. Design principles involved: Maintaining consistency, maintaining natural flow among screens and using appropriate widgets and components. In (D), the text field allows user to input text (userid) into the one line area and the password field works exactly the same except that whatever is entered into the field will show up as dots on the screen to prevent others from reading the password on screen. Design principles involved: Using appropriate widgets and components. 4.3 Constraints and Assumptions Constraint 1: The shopping cart will be cleared once user logs out Constraint 2: The administrator cannot mass edit the products Constraint 3: Only registered member can view the product catalogue 26 Constraint 4: Only registered member can place an order Assumption 1: All users have internet connection Assumption 2: There is only 1 administrator assigned 4.4 Database Design Database design and the creation of an entity relationship diagram (ERD) is an important yet sometimes overlooked part of the application development lifecycle. Effective database design allows developer to spend less time reworking and reducing unnecessary project development cost. 4.4.1 Entity Relationship Diagram An entity relationship diagram (ERD) is a diagram that represents the structural contents in tables for an entire schema, in a database. Additionally, included are the schematic representations of relationships between entities, represented by various types of relationships, plus primary and foreign keys. (Powell, p408). The ER diagram is developed in the early stage of the project and can be found in Appendix E. The entity table can also be found in Appendix F. 27 4.5 System Architecture Design According to Thacker (1997), the three-tier architecture refers to separating the application process into three specific layers in a web application development. The three-tier makes up of the presentation tier, business logic tier and data tier. The presentation tier is the layer which users will see when they open a browser. It is presented to the user on the client side within their web browser. The business logic tier is also known as the application tier. This is the layer where the classes and source codes are defined in ASP.net. Fig 4.4a System Architecture Design 28 CHAPTER FIVE: SYSTEM IMPLEMENTATION The system implementation phase includes software development, system testing and user acceptance test activities. 5.1 Software Development Software programmers may install purchased software or develop new, custom designed software. Due to the limited time available, Microsoft Visual Studio 2010 is used. To develop a program, we need to describe and analyze the problem or needs and come out with detailed logic of the program. The coding of the program using computer language like Visual Basic is used for this project. The source codes developed for the project can be found from Appendix F to Appendix U. 5.2 Database Development During database development, database designers will decide on the database model that suits the project's needs. The three-schema architecture consists of the conceptual schema, external schema and physical or internal schema. 5.2.1 Conceptual Schema The conceptual schema is also known as the conceptual model. It is derived at the system analysis phase where data is defined. 5.2.2 External Schema The external schema is also known as the logical design. The logical design is developed during the system design phase where a logical schema is created, followed by the normalization of data. 5.2.3 Physical or Internal Schema The physical schema is developed during the system implementation phase where the organization, storage and manipulation of the data are found inside the application itself. It also creates the actual data storage. 5.3 User Acceptance Test 29 The user interface design is a set of things that allow you to interact with the computer which could include an action button, hyperlink text and drop down menu etc. A good user interface design generally saves you time when you work because you do not have to look all over the place for a particular button or link. The system is then implemented for user to use and provide feedback or conclude with the acceptance testing. The following points are some ways in which a good user interface design can be achieved. Maintain the flow of navigation within a screen Standardize all designs, such as labels and buttons, so that there is consistency across all screens Use colours appropriately especially when the background is white, avoid using light coloured fonts Group things together so that it is easier for the user to find the right thing at first glance Name the widget effectively, if “go back” means returning to “HOME PAGE”, it will be more effective to name the widget “home” The screen shots of the website can be found in Appendix B (User Interface) and Appendix C (Admin Interface). 30 CHAPTER SIX: SYSTEM TESTING 6.1 Database Integrity Testing According to Kelly (n.d.)., data integrity and database integrity test techniques verify that data is being stored by the system in a manner where the data is not compromised by updating, restoration, or retrieval. By performing data integrity test, we can ensure the completeness of the stored data. 6.2 SQL Statement Several SQL statements were used to test the entity integrity of the database. To test if the system is able to allow the administrator to add, modify or delete products, the SQL statements, SELECT, INSERT, DELETE and UPDATE, were used. The tables below illustrate the testing of the database using SQL statements. 6.2.1 SELECT To test if the products can be listed out from the aspnet_Products table, the SELECT statement is used: SELECT * FROM aspnet_Products; Result: All products in aspnet_Products table were listed out. 31 6.2.2 INSERT The INSERT statement can be used to add product into the existing database. In this case, a new product called “Purr Purr Dream” is added to the table: INSERT INTO aspnet_Products (ItemCode, ItemName, ItemDesc, Price, Quantity, ImageURL, Status) VALUES (986, ‘Purr Purr Dreams’, This dreamy purple shade will set you up for sweet dreams tonight!’, 8.9, 4, ‘~Image/OPI5.gif’, ‘Y’); SELECT * FROM aspnet_Products Result: Upon executing the SELECT statement, the new product is being added to the database. 32 6.2.3 UPDATE The UPDATE statement allows changes to be made to the existing products in the database. To test this, the quantity of the product “Green Leaf” or ItemNum = 223, is changed to 2 instead of 3. UPDATE aspnet_Products SET Quantity=2 WHERE (ItemNum = 223); SELECT * FROM aspnet_Products 33 6.2.4 DELETE The DELETE statement simply removes the data from the database. In this example, ItemCode #106 will be deleted from the aspnet_Products table. DELETE FROM aspnet_Products WHERE (ITEMCODE=106); SELECT * FROM aspnet_Products Result: The “Groovy Hot Pink” or Item # 106 was removed from the database. 34 6.3 Functional Testing A functional testing is carried out to verify that the system has all the functions that fulfil the requirements stated in the beginning. The codes developed earlier are also tested at this stage to ensure they are workable. 6.3.1 Password Strength To prevent others from making easy guess on member’s password, the password requirement is to have minimum 7 letters or number and a non-alphanumeric character. A password which consists of 7 letters only is entered and the following error message was observed. Error: Password length minimum: 7 Non alphanumeric characters required: 1 Fig. 6.3.1a Password Error 35 6.3.2 Username already exist When the system’s database already stores a particular username, the user will be denied registration. The system will prompt the user to enter another username. Once a new username is entered, the system will prompt a success message. Error: Please enter a different username. Fig. 6.3.2a Enter a different name 36 Fig. 6.3.2b Account created successfully 6.3.3 Login Successful The system will display the username when the user log-in is successful. Once logged in, the user can choose to change password, shop or log out. Only a registered user with XNail Pte Ltd can browse the product catalogue and make purchase. Fig. 6.3.3a Successful Login 37 6.3.4 Browse Catalogue The registered user can browse the catalogue after logging in into the system. The products will be displayed in the catalogue and the user can select the product she wants and add it to cart Fig. 6.3.4a Product Catalogue 38 6.3.5 Shopping Cart The user is able to click “select” on the catalogue page and add the item to card. From there, she will be directed to the checkout page. Fig. 6.2.5b Shopping Cart Fig. 6.3.5a Product Selected Fig. 6.3.5b Shopping Cart 39 6.3.6 Admin Functions At the admin login page, an error message will be displayed if the username and password do not match. (Fig. 6.3.6a) Error: Your login attempt was not successful. Please try again. Fig. 6.3.6a Login Unsuccessful The system will display a welcome message if log in is successful. (Fig. 6.3.6b) 40 The admin is able to add and delete product and update the database by clicking on the hyperlink text. (Fig. 6.3.6c) Fig. 6.3.6d Add a Product Fig. 6.3.6e Edit/Delete Product 41 CHAPTER SEVEN: PROJECT MANAGEMENT Project management refers to “the application of knowledge, skills, tools and techniques to project activities to meet the project requirements.” (International Institute of Learning, 2009). With project management, project goals and objectives can be accomplished with proper planning, organizing and managing of resources. It is important to effectively manage a project because it will reduce the risk of getting hit by an unwanted issue and communicate the project plan to the team. 7.1 Project Life Cycle The project life cycle refers to “a logical sequence of activities to accomplish the project’s goals or objectives.” (Visitask.com, 2004). The step-by-step process helps to break down complicated tasks into smaller parts, allowing easy execution. The typical project life cycle will consist of the initiation phase, planning phase, execution and controlling phase and closure phase. Initiation Closure Planning Execution & Controlling Fig 7.1a Project Life Cycle 7.1.1 Initiation The purpose of the initiation phase is to employ portfolio management technique to 6.3.6e Edit/Delete Product establish prioritization of projects andFig. programs, in terms of organizational value. The development of project methodology and processes are defined during this stage during which portfolio management uses a governance body to employ established criteria for initiatives selection. 42 To begin with the project, the business needs of this project were established and analyses to justify those needs were raised. The authorization to start the project is obtained at this stage after a project proposal and requirements are presented to the project supervisor. 7.1.2 Planning When the business or customer requirements are collected, the planning process follows. The project scope is defined and the tasks are further decomposed to produce a project scope baseline. According to IIL (2009), the scope baseline will comprise of project scope statement, a work breakdown structure (WBS) and WBS dictionary. During this stage, a detailed identification and assignment of each task until the end of the project was identified. A project schedule plan was presented to the project supervisor so that the project progress can be monitored and completed on time. The project schedule plan includes a Gantt chart and a Work Breakdown Structure which can be found in the Fig 7.2b and Fig 7.3a respectively. The planning phase also involved a process called risk analysis, where potential threats were identified and analysed. The risk analysis allowed me to decide on the actions to be taken to counter the risks and to minimize on the impact of damage on the project. The project supervisor then reviews the project plan and authorizes the project to be executed. 7.1.3 Execution and Controlling According to Visitask.com (2004), the most important issue in this phase is to ensure project activities are properly executed and controlled. During the execution phase, the planned solution is implemented to solve the problem specified in the project's requirements. This phase usually takes up the longest time and requires the most resources. As this is the most critical phase, regular meet-ups with the project supervisors ensure that the project is on schedule and allow me to clarify problems encountered during the execution. Any problems encountered were dealt with as soon as they were detected so that the problems will not have an accumulated destructive impact on the project. The integrity of baselines is maintained when the project performance is constantly being tracked, reviewed and regulated. 43 The project supervisor also provided feedback and evaluated on my performance which allowed me to understand better what I need to improve on or focus on. 7.1.4 Closure During the project closure, all activities across the project management process groups are finalized to complete the project. The project management will be wrapped up by a written formal report. The final report will contain the final acceptance and project deliverables which have been accomplished. It should include critical review of the project, as well as future recommendations. The report will be submitted to the school in May 2011, followed by a formal poster and presentation which officially closes the project. 7.2 Work Breakdown Structure In project management, a work breakdown structure (WBS) helps to decompose a project into smaller tasks so that they can be schedules, executed, monitored and controlled. It is a comprehensive tool for establishing a project baseline that is used for project monitoring and control. The work breakdown structure of this project can be found in Fig 7.2b. Step 5: Verify the degree of decomposition of the work is necessary and sufficient Step 4: Develop and assign identification codes to the WBS components Step 3: Decompose the upper WBS levels into lower lever detailed components Step 2: Structure and organize the WBS Step 1: Identify and analyze the deliverables and related work Fig. 7.2a WBS Decomposition (Courtesy of IIL) 44 Task ID 1.0 1.1 1.2 1.3 1.4 1.5 1.6 2.0 2.1 2.2 2.3 2.4 2.5 2.6 3.0 3.1 3.2 3.3 3.4 3.5 4.0 4.1 4.2 4.3 4.4 5.0 5.1 5.2 6.0 6.1 6.2 6.3 6.4 6.5 7.0 7.1 7.2 Task Description Feasibility Define user requirements Prepare requirement specification Review requirements specification Prepare proposal Compile requirements specification documentation End of feasibility phase Analysis Gather information Analyze different approaches Evaluate the different approaches Seek supervisor's approval to adopt a particular approach Compile analysis documentation End of Analysis phase Design Design the program layout and user interface Design database structure and software procedures Prototyping Compile design documentation End of Design phase Development Produce program coding Testing on individual modules Compile development documentation End of Development phase Implementation Implement the system End of Implementation phase Testing Design test plan Testing of integrity Test program functionality to meet user requirements Compile testing documentation End of Testing phase Maintenance Support system with patches and updates End of Maintenance phase Fig. 7.2b Work Breakdown Structure 45 7.3 Gantt Chart Fig. 7.3a Gantt Chart 46 7.4 Risk Management 7.4.1 Risk assessment Risk assessment is a process, used to access the likelihood of a risk occurring during project progress. Risks will affect the entire project management process in terms of schedule delay, cost overrun and quality of product. Thus, we must take control measures to minimize the chance of a risk happening. Risks Probability of occurrence Misunderstanding of user or client requirement Unlikely Misinterpretation of requirements during requirement definition phase Incomplete or incomprehensible design specifications Incompetent in using development tools Probable System malfunctions or program bugs detected when using the project product Probable Very Likely Very Likely Existing Control Measures Clarify all doubts and discuss project requirement with supervisor Validate requirements during meet up with supervisor Additional Actions - Communicat e with supervisor often - Follow progress chart, set milestone, try to achieve every step planned Refer to programming books and Read up online tutorials extensively on Visual Basic and ASP.net coding Do checking after every phase, Read up on any problem should be debugging addressed before moving on Fig. 7.4.1 Risk assessment 47 CHAPTER EIGHT: CRITICAL REVIEW AND EVALUATION 8.1 Database Design The initial ER model designed lacked of several data, including the Admin table. The administrator is one of the main users of the system. Initially, I only focused on creating the webpage for users to browse catalogue and make purchase. Only later, do I realise I need an administrator interface as well. Thus the ER diagram was re-drawn several times along the way but it is worth it because by having a good database design, it will make the implementation phase much easier. It took me quite awhile to draw up the finalized ER diagram (Appendix D). 8.2 System Development The most challenging part of the project has to be the problems I encountered during coding. Being relatively weak in programming, I often refer to online forums and tutorials, including walk-through, to come out with workable codes. The toughest part was the creation of the shopping cart which took me about 8 weeks to get the codes working. Every time when I execute the query or codes, there will be errors all over. Having to troubleshoot the program was also one of the most difficult tasks during the system development. Overall, the system developed achieved the basic requirements of this project and worked during the implementation stage. Some flaws encountered were corrected and improvements were also made along the way. 8.3 Project Management In my opinion, I find that being equipped with Project Management skills has greatly benefitted me in this project. Without project management process, I might miss out some important steps while executing the project. I was able to break down the project into smaller tasks and find that it makes execution and monitoring easier. I was able to monitor how much I have progress or if I was way behind schedule. The Gantt chart was also very helpful since it tracks my project progress. With effective time management, I was able to complete the project on time. 48 CHAPTER NINE: CONCLUSION & FUTURE WORK 9.1 Conclusion The objectives of the project are to allow users to browse an online catalogue and to place an order with the company. The company, on the other side, has an administrator, who oversees the basic functions of “INSERT”, “DELETE”, “UPDATE” and “MODIFY” to the inventory database. All these objectives were met and the website was successfully developed. The website was developed in a way which allows users, even beginners, to access the online store without much difficulty. By having an online website, customers can save time on making trips down to physical store and save the trouble comparing products across different brand by running to different stores. Therefore, it is important for a user to feel at ease when using the developed web site to make a purchase. The website, which was developed over the past eleven months, was able to meet the project aims and objectives. By applying various techniques which were taught in school, such as Project Management, it ensures that important requirements and project activities were not missed out. With a well developed project schedule plan and effective project management, the website was successfully developed completed on time. The development of a nail polish website is a typical IT project which requires the blending knowledge of programming and database processing skills. When it comes to system development, the Database processing modules which I took in my year 2 proved to be beneficial as I was already familiar with SQL query. Precious learning skills and experience, especially time management, have been picked up along the way and I hope that I will be able to apply them especially in my job in the future. 9.2 Future Enhancement 9.2.1 Use Macromedia Flash to enhance the website appearance 49 Current situation The website is made up of several pictures and colourful designs. Recommendations: Use Flash to create animated banners and movie especially on the home page so that users will be attracted to the page and be impressed. 9.2.2 Product Categories Current situation: All the products are displayed and listed on the product catalogue page without any sequencing or sorting. Recommendation: Categorize all products according to colour shades or collection. This will allow user to search for the relevant product easily. 9.2.3 Product Search Current situation: All the products are displayed and listed on the product catalogue page without any sequencing or sorting. Recommendation: Create a product search function to allow users to search for a relevant product according to product name. 9.2.4 Order History Current situation: Once the user has placed an order, a confirmation message will be displayed on the screen informing the user order has been confirmed. Recommendation: Create a database to store past transaction so that user can review order history when they are logged in. 9.2.5 Stored Password Security Current situation: Members and administrator have to key in userid and password at each log-in. Recommendation: Allow password to be stored so that members or administrator can save time in typing in the entire userid and password each time they want to access the site. 50 CHAPTER 10: REFLECTION 10.1 Problems Encountered 10.1.1 Lack of Programming Experience This was the first major IT project which I took up since my polytechnic days. The previous project I took up was a group project and hence, not as challenging as the current project. I have made time extension on numerous occasions especially during the development stage where heavy coding was involved. There were errors every time I tried to execute or build the webpage on Visual Studio. I had to borrow many books from the library and watch online tutorials to refresh my memory and strengthen my programming foundation. As the Visual Studio I am using for the project is a much newer version that the Visual Studio which I learned many years ago, there was lots of reading up and hands-on practice to be done. After reading up and modifying source codes from online examples, I was able to produce a simple web site with all the necessary functions and components 10.1.2 Time Constraint It was very tiring during the last year in school as I had to work in the day and attend classes in the evening, and hold a final year project on hand. Every time by the time I reach home, I had to force myself to stay up for a few more hours to work on the project. There were times I had to cope with TMA, quiz, classes and project that I felt like giving up. Time management is the critical key to the success of this project. Hence, I came out with a list of tasks to be completed on a fortnight basis and stick post-it notes around my room to remind me of critical datelines. I have also learnt to prioritize what had to be done first and made sacrifices with friends and family so that I could spend more time on the project. I was then able to get the most important things done and move one step at a time to complete other less important tasks. 10.1.3 Software Expiry 51 The Adobe Photoshop software which I downloaded online was valid for trial use only for 90 days. By the time I reach the design stage, I realised the software has expired. To continue using the software, I would have to pay. Fortunately for me, I have another laptop and was able to download the Adobe Photoshop software again for another 90 days. This time round to play safe, I try to edit as many photos as I can, especially the images to be used on the home page. I even pasted a stick-on note in my room to remind me the software expiry date. 10.1.4 System Incompatibility In the beginning of the development, I was working on the project on my desk top computer. All the software were already downloaded and installed and I started working on it until I realized that it would be better to work on my laptop since I can present the website using a laptop as well. Transferring all the data and re-downloading the software posed an issue when I tried to develop the website using a Mac Book. Some of the previously used software were incompatible to the operating system, and there were program conflicts. I reckon that it would be better if I start everything over again using the Mac Book and spent some time downloading the correct version and operating system which are compatible with my lap top. Although it wasted me one day to fix this problem, I felt safer, in case half way through the project, incompatibility issues arise again. 10.1.5 Renaming filenames At some point during the testing stage, I tried to rename my .aspx filenames as I thought a catalogue.aspx would sound better than productlist.aspx page. Some errors occurred after renaming the file and I tried to copy the entire source codes onto a new page, without saving the original source codes. It never occurred to me that changing the filename would be so drastic as my pages could not link each other and there were many errors during debugging. I spent lots of time on restoring the original productlist.aspx page but to no avail, thus, to redo the whole page from scratch would be a better idea. I wasted another 2 days on the page but was relatively relieved when everything starts to work again. 52 10.2 Personal Reflections The capstone project is by far, the most challenging project which I have done. It requires immense self discipline and massive concentration throughout the two semesters. As a working adult, juggling between school and work has been one of the toughest problems to overcome. The lack of programming experience also added difficulty to the project. The project was overall challenging and required a lot of commitment from start to end. I often refer to online resources such as forums whenever I could not fix the codes. I have also learnt to prioritize important task to be completed first so that the project will not be behind schedule. Essential time management was crucial during the whole project development as I had to make sacrifices at times just to make sure that the tasks assigned to me are completed on time before the next meeting with the supervisor. I was fortunate to have taken up IT Project Management while I did the capstone project. This module has taught me project management skills to break down some activities to smaller task so that it would guide me step by step. I could not recall how many times I was intimidated by the complexity of the building of the system. However, my project supervisor has been encouraging and he would evaluate on my work and provide feedbacks to me for improvements. As I was relatively weak in programming, Mr Yoong has been extremely patient with me and I thank him for the support he has given me. Overall, the successful completion of this project has brought out the best in me as I learnt to persevere and often go beyond my limit. As I juggled between work and school, I developed a more mature mentality. I was able to effectively multi-task and devote the same amount of commitment in all aspects. I strongly believe the sense of accomplishment will motivate me to excel in my future endeavours and the personal skills which I have picked up will definitely benefit me in my job. (9420 words) 53 REFERENCES Books International Institute for Learning. (2009). Project Management Fundamentals for Information Technology Professionals. New York, NY. Kroenke, D., M. (2009). Database Processing: Fundamentals, Design and Implementation. NJ: Prenhall. Kurniawan, B. (2003). Real World .NET Applications. NY: APress. Moore, K. (2002). Karl Moore’s Visual Basic .NET: The Tutorials. California: Apress. Websites Fabiola, G. (2006). The Many Advantages And Benefits Of Online Shopping. Retrieved from http://ezinearticles.com/?The-Many-Advantages-And-Benefits-Of-OnlineShopping&id=337891 Kalita, S. (2007). Analysis of Resource Inventory and Emergent Relief Needs. Retrieved from http://elearning.nic.in/student-trainee-report/analysis-of-resource-inventory-and-emergentrelief-needs/mca-project-report-to-college.doc Kelly, M. (n.d.). Data and Database Integrity Testing. Retrieved from http://www.michaeldkelly.com/pdfs/Data_and_Database_Integrity_Testing.PDF Lee, J. (n.d.). Online Shopping. Retrieved from http://www.ocf.berkeley.edu/~jinnie/contact.html Lee, J.Y., Lee, H.S., & Wang, P. (n.d.). Analytical Product Selection Using a Highly-Dense Interface for Online Product Catalogs. Retrieved from http://researchweb.watson.ibm.com/iac//papers/VOPC.pdf MERTTOL. (2009). Web Site Development Life Cycle. Retrieved from http://www.merttol.com/articles/web/web-site-development-life-cycle.html Mohan, A., Vasing, V., & Kamlesh, N.K. (n.d.). Online Shopping Portal. Retrieved from http://www.scribd.com/doc/20467513/CaseStudy-Online-Shopping-Cart Thacker, N. (1997). 3-Tier Web Application Development. Retrieved from http://www.shiningstar.net/blog/3tierWebApps.aspx University College Cork. (n.d.). Database Design methodology. Retrieved from http://www.cs.ucc.ie/~abf/CS507-8/l37c.pdf Visitask.com. (2004). Project Life Cycle - Project cycle Management. Retrieved from http://www.visitask.com/project-life-cycle.asp 54 Wong, H. (2001). Introduction to Database Systems. Retrieved from http://www.cs.cityu.edu.hk/~helena/cs34622000B/DBDesign.pdf (No Author’s work) Database Development Process. (2001). Retrieved from http://www.siue.edu/~dbock/cmis450/2-databasedevelopment.htm Introduction to System Analysis and Design (n.d.). Retrieved from http://www.scribd.com/doc/4052801/Introduction-to-System-Analysis-and-Design Relational Database Design. (n.d.). Retrieved from http://www.relationaldbdesign.com/relational-database-design/module3/schemaarchitecture.php 55 APPENDICES Appendix A: Activity Diagram Is user registered ? No User registers Yes User enters user ID and password Yes No Is password correct? User enters search criteria Is there at least one selection? System displays notification Yes System presents list of selections Yes No User selects a product System presents details about selected product Does user want to purchase the product? Yes User adds product to shopping cart System displays shopping cart Does user want to continue shopping? No User proceeds to check out User enters payment details User confirms order System returns confirmation message 56 Appendix B: User Interface Design Screen Shots 5.1c Main page 5.1b Registration 57 5.1c Login 5.1d What’s New 58 5.1d Nail Care 5.1e Catalogue 59 5.1d What’s New 5.1e Shopping Cart 60 Appendix C: User Interface Design Screen Shots (Admin) 6.1a Administrator Login 5.1f Administrator Login 5.1g Administrator Main Page 61 5.1h Administrator Add product 5.1i Administrator Edit/Delete/Update 62 Appendix D: ER Model ORDERITEM ∞ ORDER OrderID ADMIN ItemID CUSTOMER CustID 1 1 ∞ OrderID ItemName CustID QtyOrdered AdminID FirstName FirstName PhoneNum ∞ LastName InvoiceNum 1 LastName INVENTORY 1 Email ItemID Email 1 ItemNum 1 QtyInStock ItemDesc 1 UnitPrice 1 CUSTADD BILLING CustID CustAdd CustName CustId BlkNum AddressType ∞ StreetName Street Unit PostalCode PostalCode PhoneNum Fig. 4.4.1a ER Model 63 Appendix E: Entity Definition Table CUSTOMER CUSTOMER CUSTOMER CUSTOMER Column (Field) CustID FirstName LastName Email Data Type Number, Long integer (Table key) Text, 50 Text, 20 Varchar (50) Table CUSTADD CUSTADD CUSTADD CUSTADD CUSTADD Column (Field) CustID Address PostalCode PhoneNum Country Data Type Number, Long integer (Table key) String Number, integer Number, integer String Table ORDER ORDER ORDER ORDER Column (Field) OrderID CustID InvoiceNum OrderID Data Type Number, Long integer (Table key) Number, Long integer Number, Long integer Number, Long integer (Table key) Table ORDERITEM ORDERITEM ORDERITEM ORDERITEM Column (Field) OrderID ItemNum QtyOrdered Price Data Type Number, Long integer (Table key) String, 10 Number, integer Number (2,2) Table INVENTORY INVENTORY INVENTORY INVENTORY INVENTORY Column (Field) ItemID ItemName QtyInStock ItemDesc UnitPrice Data Type Number, integer (Table key) Varchar (100) Number, integer Text, 500 Number (2,2) Table ADMIN ADMIN ADMIN ADMIN Column (Field) AdminID FirstName LastName Email Data Type Number, Long integer (Table key) Text, 50 Text, 20 Varchar(50) Table BILLING BILLING BILLING BILLING BILLING BILLING BILLING Column (Field) CustID CustName BlkNum StreetName Unit PhoneNum PostalCode Data Type Number, integer (Table Key) String Number, Integer Text, 20 Varchar(10) Number, Integer Number, Integer (6) 64 Appendix F: Source Codes – Default.aspx Default.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <style type="text/css"> .style1 { font-size: x-large; font-weight: bold; text-align: center; } .style2 { font-family: Tahoma; font-size: xx-large; color: #FFFFFF; } #form1 { text-align: center; } .style3 { color: #FFFFFF; } .style4 { font-size: small; } </style> </head> <body bgcolor="#333333"> <form id="form1" runat="server"> <div class="style1" style="background-color: #333333"> <br /> <asp:Image ID="Image2" runat="server" Height="139px" ImageUrl="~/Image/X-NAIL333.jpg" Width="760px" /> <span class="style2"> <br /> <br /> <br /> </span> <asp:Button ID="Button1" runat="server" BackColor="Gray" ForeColor="Black" style="font-weight: 700" Text="Nail Care Tips" Width="195px" PostBackUrl="~/Nailcare.aspx" /> <asp:Button ID="Button2" runat="server" BackColor="Gray" style="font-weight: 700" Text="What's New" Width="208px" PostBackUrl="~/WhatsNew.aspx" /> 65 <asp:Button ID="Button3" runat="server" BackColor="Gray" style="font-weight: 700; margin-left: 0px" Text="Contact Us" Width="192px" /> <br /> <asp:Image ID="Image1" runat="server" Height="441px" ImageUrl="~/Image/main.jpg" Width="606px" /> <br /> </div> <br /> &nbsp;&nbsp; <asp:LoginView ID="LoginView1" runat="server"> <AnonymousTemplate> You are not logged in. Click the link below to login or <asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl="~/Register.aspx">Register</asp:HyperLink> &nbsp;now. </AnonymousTemplate> <LoggedInTemplate> <span class="style3">Welcome!! You are logged in as </span>&nbsp;&nbsp;<asp:LoginName ID="LoginName1" runat="server" /> &nbsp;&nbsp;&nbsp; &nbsp;<asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="~/cart.aspx">SHOP NOW!</asp:HyperLink> <br /> <br /> <br /> <br /> <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/MembersPage/ChangePassword.aspx" style="font-size: small">Change Password</asp:HyperLink> </LoggedInTemplate> </asp:LoginView> &nbsp;<br /> <br /> <span class="style4">&nbsp;</span><asp:LoginStatus ID="LoginStatus1" runat="server" CssClass="style4" /> &nbsp; <br /> <br /> <br /> </form> </body> </html> 66 Appendix G: Source Codes – Login.aspx Login.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Login.aspx.vb" Inherits="Login" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <style type="text/css"> .style1 { font-family: Tahoma; font-size: xx-large; font-weight: bold; color: #FFFFFF; text-align: center; } </style> </head> <body> <form id="form1" runat="server" style="background-color: #333333"> <div class="style1"> <br /> <asp:Image ID="Image1" runat="server" Height="158px" ImageUrl="~/Image/X-NAIL333.jpg" Width="712px" /> <br /> <br /> LOG-IN PAGE</div> <br /> <br /> <asp:Login ID="Login1" runat="server" BackColor="#F7F6F3" BorderColor="#E6E2D8" BorderPadding="4" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#333333" Height="226px" Width="269px" align="center" DestinationPageUrl="~/ViewProduct.aspx"> <InstructionTextStyle Font-Italic="True" ForeColor="Black" /> <LoginButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284775" /> <TextBoxStyle Font-Size="0.8em" /> <TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.9em" ForeColor="White" /> </asp:Login> <br /> <br /> <asp:ValidationSummary ID="ValidationSummary1" runat="server" align="center" style="color: #FFFFFF; margin-bottom: 19px;" /> <p align="center"> <br /> <asp:HyperLink ID="HyperLink1" runat="server" align="center" NavigateUrl="Register.aspx" style="text-align: right">Register</asp:HyperLink> </p> <p> &nbsp;<p> &nbsp;<p> 67 &nbsp;<p> &nbsp;<p> &nbsp;<p> &nbsp;<p> &nbsp;<p> &nbsp;<p> &nbsp;<p> <br /> </form> </body> </html> </p> 68 Appendix H: Source Codes – Register.aspx Register.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Register.aspx.vb" Inherits="Register" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <style type="text/css"> .style1 { font-family: Tahoma; font-weight: bold; font-size: xx-large; color: #FFFFFF; } </style> </head> <body> <form id="form1" runat="server"> <div align="center" style="background-color: #333333"> <br /> <span class="style1"> <br /> <asp:Image ID="Image1" runat="server" Height="134px" ImageUrl="~/Image/X-NAIL333.jpg" Width="704px" /> <br /> <br /> REGISTRATION</span><br /> <br /> <br /> <br /> <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" BackColor="#F7F6F3" BorderColor="#E6E2D8" BorderStyle="Solid" BorderWidth="1px" ContinueDestinationPageUrl="~/Default.aspx" Font-Names="Verdana" Font-Size="0.8em" Height="243px" Width="285px"> <ContinueButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" /> <CreateUserButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" /> <TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <WizardSteps> <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server" /> <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server" /> </WizardSteps> <HeaderStyle BackColor="#5D7B9D" BorderStyle="Solid" Font-Bold="True" Font-Size="0.9em" ForeColor="White" HorizontalAlign="Center" /> <NavigationButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" /> <SideBarButtonStyle BorderWidth="0px" Font-Names="Verdana" 69 ForeColor="White" /> <SideBarStyle BackColor="#5D7B9D" BorderWidth="0px" Font-Size="0.9em" VerticalAlign="Top" /> <StepStyle BorderWidth="0px" /> </asp:CreateUserWizard> <br /> <br /> <br /> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default.aspx">Home</asp:HyperLink> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> </div> </form> </body> </html> 70 Appendix I: Source Codes – ChangePassword.aspx ChangePassword.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="ChangePassword.aspx.vb" Inherits="MembersPage_ChangePassword" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <style type="text/css"> .style1 { font-size: xx-large; font-weight: bold; font-family: Tahoma; color: #FFFFFF; text-align: center; } </style> </head> <body> <form id="form1" runat="server" style="background-color: #333333"> <div class="style1"> <asp:Image ID="Image1" runat="server" Height="150px" ImageUrl="~/Image/X-NAIL333.jpg" Width="669px" /> <br /> <br /> CHANGE PASSWORD</div> <p> &nbsp;</p> ‘use the ChangePassword function to create the wizard for member to change password <asp:ChangePassword ID="ChangePassword1" runat="server" BackColor="#F7F6F3" BorderColor="#E6E2D8" BorderPadding="4" BorderStyle="Solid" BorderWidth="1px" ContinueDestinationPageUrl="~/Default.aspx" Font-Names="Verdana" Align="center" Font-Size="0.8em" Height="268px" Width="377px"> <CancelButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" FontSize="0.8em" ForeColor="#284775" /> <ChangePasswordButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" FontSize="0.8em" ForeColor="#284775" /> <ContinueButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" FontSize="0.8em" ForeColor="#284775" /> <InstructionTextStyle Font-Italic="True" ForeColor="Black" /> <PasswordHintStyle Font-Italic="True" ForeColor="#888888" /> <TextBoxStyle Font-Size="0.8em" /> <TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.9em" ForeColor="White" /> </asp:ChangePassword> <br /> 71 <br /> <br /> <br /> <br /> <br /> <br /> <br /> </form> </body> </html> 72 Appendix J: Source Codes – ViewProducts.aspx ViewProducts.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="ViewProduct.aspx.vb" Inherits="ViewProduct" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <style type="text/css"> .style1 { font-family: Tahoma; font-size: xx-large; font-weight: bold; } .style2 { color: #FFFFFF; } .style3 { text-align: center; } </style> </head> <body> <form id="form1" runat="server"> <div style="background-color: #000000" class="style3"> <div class="style3"> <asp:Image ID="Image1" runat="server" ImageUrl="~/Image/X-NAIL.jpg" /> <span class="style1"> <br /> <br /> <span class="style2">Product Catalogue</span></span><br class="style1" /> <br class="style1" /> </div> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ItemCode" DataSourceID="SqlDataSource1" AllowPaging="True" AllowSorting="True" OnRowCommand="GridView1_RowCommand" align="center" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical"> <AlternatingRowStyle BackColor="White" /> <Columns> <asp:TemplateField HeaderText="Image" InsertVisible="False" SortExpression="Image"> <ItemTemplate> <asp:Image ID="Pic" runat="server" ImageUrl='<%# 73 Bind("ImageURL") %>' /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Item Code" InsertVisible="False" SortExpression="ItemCode"> <EditItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("ItemCode") %>'></asp:Label> </EditItemTemplate> <ItemTemplate> <asp:Label ID="lblItemCode" runat="server" Text='<%# Bind("ItemCode") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Item Name" SortExpression="ItemName"> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ItemName") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label2" runat="server" Text='<%# Bind("ItemName") %>'></asp:Label> </ItemTemplate> <FooterTemplate> <asp:TextBox ID="ItemNameTextBox" Runat="server"></asp:TextBox> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Item Description" SortExpression="ItemDesc"> <EditItemTemplate> <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("ItemDesc") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label3" runat="server" Text='<%# Bind("ItemDesc") %>'></asp:Label> </ItemTemplate> <FooterTemplate> <asp:TextBox ID="ItemDescTextBox" Runat="server"></asp:TextBox> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Price" SortExpression="Price"> <EditItemTemplate>$ <asp:TextBox ID="txtPrice" runat="server" Text='<%# Bind("Price") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate>$ <asp:Label ID="lblPrice" runat="server" Text='<%# Bind("Price") %>'></asp:Label> </ItemTemplate> <FooterTemplate>$ <asp:TextBox ID="txtPrice2" Runat="server"></asp:TextBox> </FooterTemplate> </asp:TemplateField> <asp:CommandField ShowSelectButton = "True" /> 74 </Columns> <FooterStyle BackColor="#CCCC99" /> <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" /> <RowStyle BackColor="#F7F7DE" /> <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" /> <SortedAscendingCellStyle BackColor="#FBFBF2" /> <SortedAscendingHeaderStyle BackColor="#848384" /> <SortedDescendingCellStyle BackColor="#EAEAD3" /> <SortedDescendingHeaderStyle BackColor="#575357" /> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NailWebConnectionString %>" ProviderName="System.Data.SqlClient" SelectCommand="SELECT [Price],[ImageURL],[ItemCode], [ItemName], [ItemDesc] FROM [aspnet_Products]"> <DeleteParameters> <asp:Parameter Name="ItemCode" Type="String" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="ItemName" Type="String" /> <asp:Parameter Name="ItemDesc" Type="String" /> <asp:Parameter Name="ItemCode" Type="String" /> <asp:Parameter Name="Price" Type="Decimal" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="ItemName" Type="String" /> <asp:Parameter Name="ItemDesc" Type="String" /> </InsertParameters> </asp:SqlDataSource> <p> <asp:Button ID="btnCheckout" runat="server" Text="View Shopping Bag" /> </p> </div> </form> </body> </html> ViewProducts.aspx.vb Imports System.Data.SqlClient Partial Class ViewProduct Inherits System.Web.UI.Page Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand Dim connectionString As String = System.Configuration.ConfigurationManager.ConnectionStrings("NailWebConnectionString") .ToString() Dim conn As SqlConnection = New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("NailWebConn 75 ectionString").ToString()) Try If e.CommandName.Equals("Select") Then 'Dim row As GridViewRow = e.CommandSource.SelectedRow() 'Dim a As String = row.Cells(2).Text 'Dim aa As String = a 'Dim 'Dim 'Dim 'Dim myGridView As GridView = e.CommandSource myGridViewRow As GridViewRow = myGridView.SelectedRow a As String = GridView1.SelectedRow.Cells(1).Text i As Integer = 1 'Dim txtItemCode As Label = btnSelect.FindControl("Label11") 'Dim a As String = txtItemCode.Text 'Dim txtItemCode As Label = row.FindControl("Label1") ' Dim i As String = txtItemCode.Text ' Response.Redirect("http://localhost:53472/WebSite1/ViewProductLogin.aspx?Qty=") ' var strUrl="./ShoppingPage.aspx?Actn=Update&quantity='+qty+'&itemUpId='+upItemId"; 'document.location.href = strUrl 'Dim btnNew As LinkButton = e.CommandSource 'Dim row As GridViewRow = btnNew.NamingContainer 'If row Is vbNullString Then ' Return 'End If 'Dim txtItemName As TextBox = row.FindControl("ItemNameTextBox") 'Dim txtDescription As TextBox = row.FindControl("ItemDescTextBox") 'Dim cmd As SqlCommand = New SqlCommand("INSERT INTO [Categories] ([CategoryName], [Description]) VALUES (@CategoryName, @Description)", conn) 'cmd.Parameters.AddWithValue("ItemName", txtItemName.Text) 'cmd.Parameters.AddWithValue("ItemDesc", txtDescription.Text) 'conn.Open() 'If cmd.ExecuteNonQuery() = 1 Then ' GridView1.DataBind() 'End If End If Catch ex As Exception MsgBox(ex.Message) 76 End Try conn.Close() End Sub Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then Dim price As Label = e.Row.Cells(0).FindControl("lblPrice") price.Text = Decimal.Parse(price.Text).ToString("#0.00") End If End Sub Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged Dim itemCode As Label = GridView1.SelectedRow.Cells(0).FindControl("lblItemCode") Dim price As Label = GridView1.SelectedRow.Cells(0).FindControl("lblPrice") Response.Redirect("OrderItem.aspx?itemcode=" + itemCode.Text.Trim) End Sub Protected Sub btnCheckout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCheckout.Click Response.Redirect("Checkout.aspx") End Sub End Class 77 Appendix K: Source Codes –WhatsNew.aspx WhatsNew.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="WhatsNew.aspx.vb" Inherits="WhatsNew" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <style type="text/css"> .style1 { baseline; text-align: center; } .style3 { width: 100%; background-color: #333333; } </style> </head> <body> <form id="form1" runat="server" style="background-color: #333333"> <div class="style1" style="background-color: #333333"> <br /> <br /> <asp:Image ID="Image4" runat="server" Height="154px" ImageUrl="~/Image/X-NAIL333.jpg" Width="667px" /> <br /> <br /> </div> <p style="text-align: center"> <asp:Button ID="Button1" runat="server" BackColor="Gray" ForeColor="Black" style="font-weight: 700" Text="Home" Width="195px" PostBackUrl="~/Default.aspx" /> <asp:Button ID="Button2" runat="server" BackColor="Gray" style="font-weight: 700" Text="Nail Care Tips" Width="208px" PostBackUrl="~/Nailcare.aspx" /> <asp:Button ID="Button3" runat="server" BackColor="Gray" style="font-weight: 700; margin-left: 0px" Text="Contact Us" Width="192px" /> </p> <p style="text-align: center"> <asp:Image ID="Image1" runat="server" Height="166px" ImageUrl="~/Image/whatsnew.jpg" style="text-align: center; position: relative; top: -19px; left: 0px" Width="637px" /> <asp:Image ID="Image3" runat="server" Height="402px" ImageUrl="~/Image/blingz.jpg" style="text-align: center" Width="640px" /> </p> <table class="style3"> <tr> <td> &nbsp;</td> 78 </tr> <tr> <td> &nbsp;</td> </tr> </table> </form> </body> </html> 79 Appendix L: Source Codes –NailCare.aspx NailCare.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Nailcare.aspx.vb" Inherits="Nailcare" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <style type="text/css"> .style1 { text-align: center; } .style2 { font-family: Tahoma; font-weight: bold; font-size: xx-large; color: #FFFFFF; } </style> </head> <body bgcolor="#333333"> <form id="form1" runat="server"> <div align="center" class="style1" style="background-color: #333333"> <span class="style2"><br /> <asp:Image ID="Image3" runat="server" Height="152px" ImageUrl="~/Image/X-NAIL333.jpg" Width="711px" /> </span> <br /> <br /> <asp:Button ID="Button1" runat="server" BackColor="Gray" ForeColor="Black" style="font-weight: 700" Text="Home" Width="195px" PostBackUrl="~/Default.aspx" /> <asp:Button ID="Button2" runat="server" BackColor="Gray" style="font-weight: 700" Text="What's New" Width="208px" PostBackUrl="~/WhatsNew.aspx" /> <asp:Button ID="Button3" runat="server" BackColor="Gray" style="font-weight: 700; margin-left: 0px" Text="Contact Us" Width="192px" /> <br /> <asp:Image ID="Image1" runat="server" Height="220px" ImageUrl="~/Image/Nailcaretips.jpg" Width="639px" /> <br /> <asp:Image ID="Image2" runat="server" Height="860px" ImageUrl="~/Image/NailTips.jpg" Width="634px" /> </div> </form> </body> </html> 80 Appendix M: Source Codes – ContactUs.aspx Contactus.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="contactus.aspx.vb" Inherits="contactus" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> #form1 { text-align: center; } .style1 { font-size: xx-large; color: #FFFFFF; font-weight: bold; } .style2 { color: #FFFFFF; font-size: large; } </style> </head> <body bgcolor="#000000"> <form id="form1" runat="server"> <div style="background-color: #333333"> <asp:Image ID="Image1" runat="server" align="center" ImageUrl="~/Image/X-NAIL333.jpg" Height="182px" ImageAlign="Middle" Width="754px" /> <br /> <br /> <asp:Button ID="Button4" runat="server" BackColor="Gray" style="font-weight: 700; margin-left: 0px" Text="Home" Width="192px" PostBackUrl="~/Default.aspx" /> <asp:Button ID="Button5" runat="server" BackColor="Gray" ForeColor="Black" style="font-weight: 700" Text="Nail Care Tips" Width="195px" PostBackUrl="~/Nailcare.aspx" /> <asp:Button ID="Button6" runat="server" BackColor="Gray" style="font-weight: 700" Text="What's New" Width="208px" PostBackUrl="~/WhatsNew.aspx" /> <br /> <br /> <br class="style1" /> <span class="style1">Contact Us</span><br /> <br /> <br /> <br /> <span class="style2">Please email us at </span><span class="style2"> <a href="mailto:contactus.xnail@yahoo.com.sg">contactus.xnail@yahoo.com.sg</a></span><br /> <br class="style2" /> <span class="style2">We will respond to all queries and feedback within 2 working days.<br /> 81 </span> <br class="style2" /> <span class="style2">Alternatively, you may wish to contact us at (65) 6123 4567 from 10am to 8pm, Monday to Saturday.</span><br class="style2" /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br class="style2" /> <br /> <br /> <br /> <br /> </div> <p style="text-align: &nbsp;</p> </form> <p style="text-align: &nbsp;</p> <p style="text-align: &nbsp;</p> <p style="text-align: &nbsp;</p> <p style="text-align: &nbsp;</p> </body> </html> center"> center"> center"> center"> center"> 82 Appendix N: Source Codes – OrderItem.aspx OrderItem.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="OrderItem.aspx.vb" Inherits="OrderItem" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .style1 { width: 100%; } .style2 { width: 163px; color: #FFFFFF; } .style3 { width: 222px; } .style4 { width: 163px; color: #FFFFFF; } </style> </head> <body bgcolor="#000000"> <form id="form1" runat="server"> <asp:Image ID="Image1" runat="server" Height="178px" ImageUrl="~/Image/X-NAIL333.jpg" Width="754px" /> <br /> <br /> <div> </div> <table class="style1"> <tr> <td class="style3" rowspan="5"> <asp:Image ID="productImage" runat="server" /> </td> <td class="style4"> Item Code :</td> <td> <asp:Label ID="lblItemCode" runat="server" style="color: #FFFFFF"></asp:Label> </td> </tr> <tr> <td class="style2"> Name :</td> <td style="color: #FFFFFF"> <asp:Label ID="lblName" runat="server"></asp:Label> </td> </tr> <tr> 83 <td class="style2"> Item Description :</td> <td> <asp:Label ID="lblItemDesc" runat="server" style="color: #FFFFFF"></asp:Label> </td> </tr> <tr> <td class="style2"> Price : $</td> <td> <asp:Label ID="lblPrice" runat="server" style="color: #FFFFFF"></asp:Label> </td> </tr> <tr> <td class="style2"> Quantity</td> <td> <asp:TextBox ID="txtQty" runat="server" Width="41px">1</asp:TextBox> </td> </tr> </table> <asp:Button ID="btnOk" runat="server" Text="Add" Width="80px" /> <br /> <br /> <br /> <br /> <br /> &nbsp;<asp:Button ID="Button2" runat="server" PostBackUrl="~/ViewProduct.aspx" Text="Back" /> &nbsp; <asp:Button ID="Button1" runat="server" PostBackUrl="~/Checkout.aspx" Text="Done" /> &nbsp;</form> </body> </html> OrderItem.aspx.vb Imports System.Data.SqlClient Imports System.Data Partial Class OrderItem Inherits System.Web.UI.Page Private itemcode As String Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load itemcode = Request.QueryString("itemcode") Dim connectionString As String = System.Configuration.ConfigurationManager.ConnectionStrings("NailWebConnectionString") .ToString() Dim errCode As Integer = 0 Using connection As New SqlConnection() 84 connection.ConnectionString = connectionString Dim dr As SqlDataReader Dim cmd As New SqlCommand cmd.CommandTimeout = 60 cmd.Connection = connection cmd.CommandType = CommandType.Text connection.Open() If connection.State = ConnectionState.Open Then cmd.CommandText = "SELECT ItemName,ItemDesc,Price,ImageURL FROM aspnet_Products where ItemCode = '" + itemcode + "' and Status = 'Y'" dr = cmd.ExecuteReader(CommandBehavior.SingleResult) If dr.HasRows = True Then dr.Read() lblItemCode.Text = itemcode lblItemDesc.Text = dr("ItemDesc") lblName.Text = dr("ItemName") lblPrice.Text = Decimal.Parse(dr("Price").ToString()).ToString("#0.00") productImage.ImageUrl = dr("ImageURL") Else errCode = 1 'No row found End If Else errCode = 2 ' Error connecting to database End If connection.Close() End Using If errCode = 1 Then MsgBox("Error in retrieving information on the product selected.", vbOKOnly) ElseIf errCode = 2 Then MsgBox("Error in connecting to the database. Please try again later", vbOKOnly) End If End Sub Protected Sub btnOk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOk.Click If Session("OrderList") Is Nothing Then Dim orderlist As New ArrayList orderlist.Add(New shoppingCart(itemcode, lblName.Text, Integer.Parse(txtQty.Text), Decimal.Parse(lblPrice.Text), productImage.ImageUrl)) Session("OrderList") = orderlist Else Dim orderlist As ArrayList = CType(Session("OrderList"), ArrayList) orderlist.Add(New shoppingCart(itemcode, lblName.Text, Integer.Parse(txtQty.Text), Decimal.Parse(lblPrice.Text), productImage.ImageUrl)) Session("OrderList") = orderlist End If End Sub End Class 85 Appendix O: Source Codes – LoginAdmin.aspx LoginAdmin.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="LoginAdmin.aspx.vb" Inherits="Admin_LoginAdmin" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <style type="text/css"> .style1 { font-size: x-large; font-weight: bold; font-family: Tahoma; text-align: center; } .style2 { color: #FFFFFF; } .style4 { color: #808080; } </style> </head> <body> <form id="form1" runat="server" style="background-color: #000000"> <div class="style1"> <span class="style2"> <br /> <asp:Image ID="Image1" runat="server" Height="147px" ImageUrl="~/Image/X-NAIL.jpg" Width="638px" /> <br /> <br /> <br /> </span><span class="style4">ADMINISTRATOR</span><br /> <br /> </div> ‘use the Login function to create a wizard that checks for username and password <asp:Login ID="Login1" runat="server" BackColor="#FFFBD6" BorderColor="#FFDFAD" BorderPadding="4" BorderStyle="Solid" BorderWidth="1px" align="center" FontNames="Verdana" Font-Size="0.8em" ForeColor="#333333" Height="268px" TextLayout="TextOnTop" Width="305px" DestinationPageUrl="~/Admin/mainMenuAdmin.aspx" style="text-align: center"> <InstructionTextStyle Font-Italic="True" ForeColor="Black" /> <LoginButtonStyle BackColor="White" BorderColor="#CC9966" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#990000" /> <TextBoxStyle Font-Size="0.8em" /> <TitleTextStyle BackColor="#990000" Font-Bold="True" Font-Size="0.9em" ForeColor="White" /> </asp:Login> <br /> 86 <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> </form> </body> </html> 87 Appendix P: Source Codes – MainMenuAdmin.aspx MainMenuAdmin.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="mainMenuAdmin.aspx.vb" Inherits="Admin_mainMenuAdmin" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <style type="text/css"> .style3 { text-align: center; } .style5 { color: #808080; font-size: x-large; } .style6 { font-size: xx-large; } </style> </head> <body bgcolor="#000000"> <form id="form1" runat="server"> <div class="style3"> W<br /> <asp:Image ID="Image1" runat="server" Height="149px" align="center" ImageUrl="~/Image/X-NAIL.jpg" style="text-align: center" Width="665px" ImageAlign="Middle" /> <br /> <br /> <span class="style5">Welcome, Admin!</span><br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Admin/productAdmin.aspx" Target="_self" CssClass="style6">Add New Product</asp:HyperLink> <br class="style6" /> <br class="style6" /> <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/Admin/updateProductAdmin.aspx" CssClass="style6">Update Products</asp:HyperLink> <br class="style6" /> <br /> <br /> </div> </form> 88 </body> </html> 89 Appendix Q: Source Codes – ProductAdmin.aspx ProductAdmin.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="productAdmin.aspx.vb" Inherits="Admin_productAdmin" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <style type="text/css"> .style1 { width: 100%; } .style2 { } .style3 { font-family: Tahoma; font-size: xx-large; } .style4 { width: 464px; } .style5 { width: 174px; } </style> </head> <body bgcolor="Black" style="width: 780px; height: 468px"> <form id="form1" runat="server" style="background-color: #000000"> <p> </p> <div style="background-color: #000000"> <span class="style3"> <asp:Image ID="Image1" runat="server" ImageUrl="~/Image/X-NAIL.jpg" Height="132px" Width="621px" /> </span> <br /> </div> <p> </p> <p> </p> <p> </p> <table class="style1"> <p> </p> <p> </p> <p style="background-color: #000000"> </p></panel><tr> 90 <td bgcolor="#FFFFCC" class="style5" style="background-color: #000000"> &nbsp;</td> <td bgcolor="#FFFFCC" class="style4" style="background-color: #000000"> &nbsp;</td> </tr> <tr> <td bgcolor="#FFFFCC" class="style5" style="background-color: #000000"> <asp:Label ID="Label8" runat="server" ForeColor="White" Text="Item Code : "></asp:Label> </td> <td bgcolor="#FFFFCC" class="style4" style="background-color: #000000"> <asp:TextBox ID="ItemCode" runat="server"></asp:TextBox> </td> </tr> <tr> <td bgcolor="#FFFFCC" class="style5" style="background-color: #000000"> <asp:Label ID="Label1" runat="server" Text="Item Name : " ForeColor="White"></asp:Label> </td> <td bgcolor="#FFFFCC" class="style4" style="background-color: #000000"> <asp:TextBox ID="Name" runat="server" Width="261px"></asp:TextBox> </td> </tr> <tr> <td bgcolor="#FFFFCC" class="style5" style="background-color: #000000"> <asp:Label ID="Label2" runat="server" Text="Description : " ForeColor="White"></asp:Label> </td> <td bgcolor="#FFFFCC" class="style4" style="background-color: #000000"> <asp:TextBox ID="Desc" runat="server" Width="422px"></asp:TextBox> </td> </tr> <tr> <td bgcolor="#FFFFCC" class="style5" style="background-color: #000000"> <asp:Label ID="Label3" runat="server" Text="Price ($) :" ForeColor="White"></asp:Label> </td> <td bgcolor="#FFFFCC" class="style4" style="background-color: #000000"> <asp:TextBox ID="Price" runat="server" Width="65px"></asp:TextBox> </td> </tr> <tr> <td bgcolor="#FFFFCC" class="style5" style="background-color: #000000"> <asp:Label ID="Label5" runat="server" Text="Quantity:" ForeColor="White"></asp:Label> </td> <td bgcolor="#FFFFCC" class="style4" style="background-color: #000000"> <asp:TextBox ID="Qty" runat="server" Width="42px"></asp:TextBox> </td> </tr> <tr> <td bgcolor="#FFFFCC" class="style5" style="background-color: #000000"> <asp:Label ID="Label6" runat="server" ForeColor="White" Text="Image URL :"></asp:Label> </td> <td bgcolor="#FFFFCC" class="style4" style="background-color: #000000"> <asp:TextBox ID="ImageURL" runat="server" Width="260px"></asp:TextBox> </td> </tr> <tr> <td bgcolor="#FFFFCC" class="style5" style="background-color: #000000"> 91 <asp:Label ID="Label7" runat="server" ForeColor="White" Text="Status Active :"></asp:Label> </td> <td bgcolor="#FFFFCC" class="style4" style="background-color: #000000"> <asp:DropDownList ID="cmbStatus" runat="server"> <asp:ListItem Selected="True">Y</asp:ListItem> <asp:ListItem>N</asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td bgcolor="#FFFFCC" class="style5" style="background-color: #000000"> &nbsp;</td> <td bgcolor="#FFFFCC" class="style4" style="background-color: #000000"> &nbsp;</td> </tr> <tr> <td bgcolor="#FFFFCC" class="style2" style="background-color: #000000" colspan="2"> <asp:Label ID="lblstatus" runat="server" ForeColor="White"></asp:Label> </td> </tr> </table> <br /> <br /> <br /> <br /> <asp:Button ID="OK" runat="server" Text="Ok" Height="25px" Width="48px" /> &nbsp;&nbsp;&nbsp;&nbsp; <asp:Button ID="Button1" runat="server" PostBackUrl="~/Admin/mainMenuAdmin.aspx" Text="Cancel" /> <br /> <br /> </form> </body> </html> 92 Appendix R: Source Codes – UpdateProductAdmin.aspx UpdateProductAdmin.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="updateProductAdmin.aspx.vb" Inherits="Admin_updateProductAdmin" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> </head> <body> <form id="form1" runat="server" style="background-color: #000000"> <div> <asp:Image ID="Image1" runat="server" Height="139px" ImageUrl="~/Image/X-NAIL.jpg" Width="754px" /> </div> <p> &nbsp;</p> ‘using the GridView from sqlDataSource1 to display the products <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ItemCode" DataSourceID="SqlDataSource1" AllowPaging="True" AllowSorting="True" OnRowCommand="GridView1_RowCommand" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical"> <AlternatingRowStyle BackColor="White" /> <Columns> ‘sort the product listing according to itemcode <asp:TemplateField HeaderText="Item Code" InsertVisible="False" SortExpression="ItemCode"> <EditItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("ItemCode") %>'></asp:Label> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("ItemCode") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Item Name" SortExpression="ItemName"> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ItemName") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label2" runat="server" Text='<%# Bind("ItemName") %>'></asp:Label> </ItemTemplate> <FooterTemplate> <asp:TextBox ID="ItemNameTextBox" Runat="server"></asp:TextBox> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Item Description" SortExpression="ItemDesc"> 93 <EditItemTemplate> <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("ItemDesc") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label3" runat="server" Text='<%# Bind("ItemDesc") %>'></asp:Label> </ItemTemplate> <FooterTemplate> <asp:TextBox ID="ItemDescTextBox" Runat="server"></asp:TextBox> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Price" SortExpression="Price"> <EditItemTemplate>$ <asp:TextBox ID="txtPrice" runat="server" Text='<%# Bind("Price") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate>$ <asp:Label ID="lblPrice" runat="server" Text='<%# Bind("Price") %>'></asp:Label> </ItemTemplate> <FooterTemplate>$ <asp:TextBox ID="PriceTextBox" Runat="server"></asp:TextBox> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Quantity" SortExpression="Quantity"> <EditItemTemplate> <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Quantity") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label5" runat="server" Text='<%# Bind("Quantity") %>'></asp:Label> </ItemTemplate> <FooterTemplate> <asp:TextBox ID="QuantityTextBox" Runat="server"></asp:TextBox> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Image URL" SortExpression="ImageURL"> <EditItemTemplate> <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("ImageURL") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label6" runat="server" Text='<%# Bind("ImageURL") %>'></asp:Label> </ItemTemplate> <FooterTemplate> <asp:TextBox ID="ImageURLTextBox" Runat="server"></asp:TextBox> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Status" SortExpression="Status"> <EditItemTemplate> <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("Status") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label7" runat="server" Text='<%# Bind("Status") %>'></asp:Label> 94 </ItemTemplate> <FooterTemplate> <asp:TextBox ID="StatusTextBox" Runat="server"></asp:TextBox> </FooterTemplate> </asp:TemplateField> <asp:CommandField ShowDeleteButton="True" ShowEditButton="True"/> </Columns> <FooterStyle BackColor="#CCCC99" /> <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" /> <RowStyle BackColor="#F7F7DE" /> <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" /> <SortedAscendingCellStyle BackColor="#FBFBF2" /> <SortedAscendingHeaderStyle BackColor="#848384" /> <SortedDescendingCellStyle BackColor="#EAEAD3" /> <SortedDescendingHeaderStyle BackColor="#575357" /> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NailWebConnectionString %>" DeleteCommand="DELETE FROM [aspnet_Products] WHERE [ItemCode] = @ItemCode" InsertCommand="INSERT INTO [Categories] ([CategoryName], [Description]) VALUES (@CategoryName, @Description)" ProviderName="System.Data.SqlClient" SelectCommand="SELECT [ItemCode], [ItemName], [ItemDesc],[Price],[Quantity],[ImageURL],[Status] FROM [aspnet_Products]" UpdateCommand="UPDATE [aspnet_Products] SET [ItemName] = @ItemName, [ItemDesc] = @ItemDesc,[Price] = @Price,[Quantity] = @Quantity,[ImageURL] = @ImageURL,[Status] = @Status WHERE [ItemCode] = @ItemCode"> <DeleteParameters> <asp:Parameter Name="ItemCode" Type="String" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="ItemName" Type="String" /> <asp:Parameter Name="ItemDesc" Type="String" /> <asp:Parameter Name="ItemCode" Type="String" /> <asp:Parameter Name="Price" Type="Decimal" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="ItemName" Type="String" /> <asp:Parameter Name="ItemDesc" Type="String" /> </InsertParameters> </asp:SqlDataSource> <p> &nbsp;</p> <p> &nbsp;</p> <p> <asp:Button ID="Button1" runat="server" PostBackUrl="~/Admin/mainMenuAdmin.aspx" Text="Done" Height="31px" Width="53px" /> </p> <p style="text-align: center"> &nbsp;</p> <p style="text-align: center"> &nbsp;</p> 95 <p style="text-align: &nbsp;</p> <p style="text-align: &nbsp;</p> <p style="text-align: &nbsp;</p> <p style="text-align: &nbsp;</p> <p style="text-align: &nbsp;</p> <p style="text-align: &nbsp;</p> <p style="text-align: &nbsp;</p> </form> </body> </html> center"> center"> center"> center"> center"> center"> center"> UpdateProductAdmin.aspx.vb Imports System.Data.SqlClient Partial Class Admin_updateProductAdmin Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand Dim connectionString As String = System.Configuration.ConfigurationManager.ConnectionStrings("NailWebConnectionString") .ToString() Dim conn As SqlConnection = New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("NailWebConn ectionString").ToString()) Try If e.CommandName.Equals("New") Then Dim btnNew As LinkButton = e.CommandSource Dim row As GridViewRow = btnNew.NamingContainer If row Is vbNullString Then Return End If Dim txtItemName As TextBox = row.FindControl("ItemNameTextBox") Dim txtDescription As TextBox = row.FindControl("ItemDescTextBox") Dim cmd As SqlCommand = New SqlCommand("INSERT INTO [Categories] ([CategoryName], [Description]) VALUES (@CategoryName, @Description)", conn) cmd.Parameters.AddWithValue("ItemName", txtItemName.Text) cmd.Parameters.AddWithValue("ItemDesc", txtDescription.Text) 96 conn.Open() If cmd.ExecuteNonQuery() = 1 Then GridView1.DataBind() End If End If Catch ex As Exception End Try conn.Close() End Sub Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then Try Dim price As Label = e.Row.Cells(0).FindControl("lblPrice") price.Text = Decimal.Parse(price.Text).ToString("#0.00") Dim price2 As TextBox = e.Row.Cells(0).FindControl("txtPrice") price2.Text = Decimal.Parse(price2.Text).ToString("#0.00") Catch ex As Exception End Try End If End Sub Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged End Sub End Class 97 Appendix S: Source Codes – CheckOut.aspx CheckOut.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Checkout.aspx.vb" Inherits="Checkout" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .style1 { text-align: center; } .style2 { font-size: x-large; color: #FFFFFF; font-weight: bold; } </style> </head> <body> <form id="form1" runat="server" style="background-color: #000000"> <div class="style1"> <asp:Image ID="Image1" runat="server" Height="157px" ImageUrl="~/Image/X-NAIL.jpg" Width="757px" /> <br /> <br class="style2" /> <span class="style2">YOUR SHOPPING CART<br /> <br /> </span> </div> <asp:GridView ID="checkoutGridView" runat="server" AutoGenerateColumns="False" Width="744px" style="color: #ffffff" align="center"> <Columns> <asp:BoundField DataField="No" HeaderText="No." /> <asp:ImageField DataImageUrlField="Image" HeaderText="Image"> </asp:ImageField> <asp:BoundField DataField="ItemCode" HeaderText="Item Code" /> <asp:BoundField DataField="ItemName" HeaderText="Item Name" /> <asp:BoundField DataField="Price" HeaderText="Price" /> <asp:BoundField DataField="Quantity" HeaderText="Quantity" /> <asp:CommandField HeaderText="Delete?" ShowCancelButton="False" ShowDeleteButton="True" /> </Columns> </asp:GridView> <asp:Label ID="lblmsg" runat="server" ForeColor="White"></asp:Label> <p> &nbsp;</p> <p style="background-color: #000000"> &nbsp;</p> <div class="style1"> <asp:Button ID="Button1" runat="server" PostBackUrl="~/ViewProduct.aspx" Text="Cancel" style="text-align: center" /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 98 <asp:Button ID="Button2" runat="server" align="center" Text="Place Order" PostBackUrl="~/OrderInformation.aspx" /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> </div> </form> </body> </html> Checkout.aspx.vb Imports System.Data Partial Class Checkout Inherits System.Web.UI.Page Dim a As New DataTable("View") Dim MembershipProvider As DataTable Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'Dim n As Integer = checkoutGridView.Rows. If Session("OrderList") Is Nothing Then lblmsg.Text = "Your shopping bag is empty." Else Dim orderlist As ArrayList = CType(Session("OrderList"), ArrayList) Dim dt As DataTable dt = a dt.Columns.Add(New DataColumn("No", GetType(Integer))) dt.Columns.Add(New DataColumn("Image", GetType(String))) dt.Columns.Add(New DataColumn("ItemCode", GetType(String))) dt.Columns.Add(New DataColumn("ItemName", GetType(String))) dt.Columns.Add(New DataColumn("Price", GetType(String))) dt.Columns.Add(New DataColumn("Quantity", GetType(String))) 'checkoutGridView.DataMember = "View" 99 Dim dr As DataRow For i = 0 To orderlist.Count - 1 dr = dt.NewRow Dim sc As shoppingCart 'Dim pic As New Image sc = orderlist.Item(i) dr.Item(0) = (i + 1).ToString 'pic.ImageUrl = sc.ImageURL dr.Item(1) = ResolveUrl(sc.ImageURL.Trim) dr.Item(2) = sc.ItemCode dr.Item(3) = sc.ItemName dr.Item(4) = sc.ItemPrice dr.Item(5) = sc.ItemQty dt.Rows.Add(dr) Next i checkoutGridView.DataSource = dt checkoutGridView.DataBind() End If End Sub Protected Sub checkoutGridView_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles checkoutGridView.RowCommand End Sub Protected Sub checkoutGridView_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles checkoutGridView.RowDeleting Dim rowid As String = e.RowIndex If a.Rows.Count > 0 Then a.Rows(rowid).Delete() If a.Rows.Count = 0 Then Dim DT1 As DataTable DT1 = checkoutGridView.DataSource DT1.Clear() a.Clear() checkoutGridView.DataSource = DT1 checkoutGridView.DataBind() lblmsg.Text = "Your shopping bag is empty." Session("OrderList") = Nothing Else lblmsg.Text = "" Dim DT As DataTable DT = checkoutGridView.DataSource Dim newOrderList As New ArrayList 100 For i = 0 To DT.Rows.Count - 1 newOrderList.Add(New shoppingCart(DT.Rows(i).Item(2).ToString, DT.Rows(i).Item(3).ToString, Integer.Parse(DT.Rows(i).Item(5).ToString), Decimal.Parse(DT.Rows(i).Item(4).ToString), DT.Rows(i).Item(1).ToString)) Next Session("OrderList") = Nothing Session("OrderList") = newOrderList Dim dr As DataRow DT.Clear() For i = 0 To newOrderList.Count - 1 dr = DT.NewRow Dim sc As shoppingCart 'Dim pic As New Image sc = newOrderList.Item(i) dr.Item(0) = (i + 1).ToString 'pic.ImageUrl = sc.ImageURL dr.Item(1) = ResolveUrl(sc.ImageURL.Trim) dr.Item(2) = sc.ItemCode dr.Item(3) = sc.ItemName dr.Item(4) = sc.ItemPrice dr.Item(5) = sc.ItemQty DT.Rows.Add(dr) Next i a = DT 'checkoutGridView.Dispose() checkoutGridView.DataSource = DT checkoutGridView.DataBind() End If End If End Sub Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click End Sub Private Function MembershipUser() As DataTable Throw New NotImplementedException End Function End Class 101 Appendix T: Source Codes – OrderInformation.aspx OrderInformation.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="OrderInformation.aspx.vb" Inherits="OrderInformation" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .style1 { color: #FFFFFF; } .style2 { color: #FFFFFF; font-weight: bold; } </style> </head> <body bgcolor="#000000"> <form id="form1" runat="server"> <div> <asp:Image ID="Image1" runat="server" CssClass="style1" Height="158px" ImageUrl="~/Image/X-NAIL.jpg" Width="732px" /> </div> <p> <span class="style2">Membership Username : </span><b> <asp:Label ID="lblusername" runat="server" CssClass="style1"></asp:Label> </b><span class="style2">&nbsp;&nbsp;&nbsp; </span> </p> <p> <span class="style1">Credit Card Type : </span> <asp:DropDownList ID="cmbCreditType" runat="server" CssClass="style1" ForeColor="Black"> <asp:ListItem Selected="True">VISA</asp:ListItem> <asp:ListItem>MASTERCARD</asp:ListItem> <asp:ListItem>AMEXPRESS</asp:ListItem> </asp:DropDownList> </p> <p> <span class="style1">Credit Card Number : </span> <asp:TextBox ID="txtCreditNum" runat="server" Width="278px" CssClass="style1" ForeColor="Black"></asp:TextBox> </p> <p> <span class="style1">Delivery Block No :</span><asp:TextBox ID="txtDblk" runat="server" Width="67px" CssClass="style1" ForeColor="Black"></asp:TextBox> </p> <p> 102 <span class="style1">Delivery Street:</span><asp:TextBox ID="txtDStreet" runat="server" Width="389px" CssClass="style1" ForeColor="Black"></asp:TextBox> </p> <p> <span class="style1">Delivery Unit:</span><asp:TextBox ID="txtDUnit" runat="server" CssClass="style1" ForeColor="Black"></asp:TextBox> </p> <p> <span class="style1">Delivery Postal Code :</span><asp:TextBox ID="txtDPostal" runat="server" CssClass="style1" ForeColor="Black"></asp:TextBox> </p> <p> <span class="style1">Billing Block No:</span><asp:TextBox ID="txtBBlk" runat="server" Width="67px" CssClass="style1" ForeColor="Black"></asp:TextBox> </p> <p> <span class="style1">Billing Street:</span><asp:TextBox ID="txtBStreet" runat="server" CssClass="style1" ForeColor="Black"></asp:TextBox> </p> <p> <span class="style1">Billing Unit:</span><asp:TextBox ID="txtBUnit" runat="server" CssClass="style1" ForeColor="Black"></asp:TextBox> </p> <p> <span class="style1">Billing Postal Code:</span><asp:TextBox ID="txtBPostal" runat="server" CssClass="style1" ForeColor="Black"></asp:TextBox> </p> <asp:GridView ID="checkoutGridView" runat="server" AutoGenerateColumns="False" Width="744px" style="color: #ffffff" align="center" CellPadding="4" ForeColor="#333333" GridLines="None"> <AlternatingRowStyle BackColor="White" /> <Columns> <asp:BoundField DataField="No" HeaderText="No." /> <asp:ImageField DataImageUrlField="Image" HeaderText="Image"> </asp:ImageField> <asp:BoundField DataField="ItemCode" HeaderText="Item Code" /> <asp:BoundField DataField="ItemName" HeaderText="Item Name" /> <asp:BoundField DataField="Price" HeaderText="Price" /> <asp:BoundField DataField="Quantity" HeaderText="Quantity" /> </Columns> <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" /> <RowStyle BackColor="#FFFBD6" ForeColor="#333333" /> <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /> <SortedAscendingCellStyle BackColor="#FDF5AC" /> <SortedAscendingHeaderStyle BackColor="#4D0000" /> <SortedDescendingCellStyle BackColor="#FCF6C0" /> <SortedDescendingHeaderStyle BackColor="#820000" /> </asp:GridView> <asp:Label ID="lblmsg" runat="server" CssClass="style1"></asp:Label> <p> <span class="style1">Total Price : $</span><asp:Label ID="lbltotal" runat="server" CssClass="style1"></asp:Label> </p> <asp:Button ID="btnConfirm" runat="server" Text="Confirm" CssClass="style1" 103 ForeColor="Black" PostBackUrl="~/Confirmation.aspx" /> </form> </body> </html> OrderInformation.aspx.vb Imports System.Data Imports System.Data.SqlClient Partial Class OrderInformation Inherits System.Web.UI.Page Dim a As New DataTable("View") Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load lblusername.Text = Membership.GetUser.UserName If Session("OrderList") Is Nothing Then lblmsg.Text = "Your shopping bag is empty." Else Dim orderlist As ArrayList = CType(Session("OrderList"), ArrayList) Dim dt As DataTable dt = a dt.Columns.Add(New DataColumn("No", GetType(Integer))) dt.Columns.Add(New DataColumn("Image", GetType(String))) dt.Columns.Add(New DataColumn("ItemCode", GetType(String))) dt.Columns.Add(New DataColumn("ItemName", GetType(String))) dt.Columns.Add(New DataColumn("Price", GetType(String))) dt.Columns.Add(New DataColumn("Quantity", GetType(String))) 'checkoutGridView.DataMember = "View" Dim total As Decimal total = 0 Dim dr As DataRow For i = 0 To orderlist.Count - 1 dr = dt.NewRow Dim sc As shoppingCart 'Dim pic As New Image sc = orderlist.Item(i) dr.Item(0) = (i + 1).ToString 'pic.ImageUrl = sc.ImageURL dr.Item(1) = ResolveUrl(sc.ImageURL.Trim) dr.Item(2) = sc.ItemCode dr.Item(3) = sc.ItemName dr.Item(4) = sc.ItemPrice total = total + Convert.ToDecimal(sc.ItemPrice) dr.Item(5) = sc.ItemQty dt.Rows.Add(dr) Next i lbltotal.Text = total.ToString() 104 checkoutGridView.DataSource = dt checkoutGridView.DataBind() End If End Sub Protected Sub btnConfirm_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnConfirm.Click Dim connectionString As String = System.Configuration.ConfigurationManager.ConnectionStrings("NailWebConnectionString") .ToString() Using connection As New SqlConnection() connection.ConnectionString = connectionString connection.Open() Dim sqlTran As SqlTransaction = connection.BeginTransaction() ' Enlist a command in the current transaction. Dim command As SqlCommand = connection.CreateCommand() command.Transaction = sqlTran Try ' Execute two separate commands. command.CommandText = _ "INSERT INTO aspnet_OrderHeader(CustId,CreditCardNo,CreditCardType,DeliveryBlk,DeliveryStreet,Deliv eryUnit,DeliveryPostal,BillingBlk,BillingStreet,BillingUnit,BillingPostal,Total,Purcha seDate) VALUES('" + lblusername.Text + "','" + txtCreditNum.Text + "','" + cmbCreditType.Text + "','" + txtDblk.Text + "','" + txtDStreet.Text + "','" + txtDUnit.Text + "','" + txtDPostal.Text + "','" + txtBBlk.Text + "','" + txtBStreet.Text + "','" + txtBUnit.Text + "','" + txtBPostal.Text + "'," + lbltotal.Text + ",'" + Today + "')" command.ExecuteNonQuery() ' Commit the transaction sqlTran.Commit() Catch ex As Exception ' Handle the exception if the transaction fails to commit. 'lblstatus.Text = "Error : " + ex.Message Try ' Attempt to roll back the transaction. sqlTran.Rollback() Catch exRollback As Exception ' Throws an InvalidOperationException if the connection ' is closed or the transaction has already been rolled ' back on the server. ' lblstatus.Text = lblstatus.Text + "\nRollBack Error : " + exRollback.Message End Try End Try connection.Close() connection.Open() 105 Dim orderheaderid As Integer Dim sqlComm As New SqlCommand("SELECT Max(OrderId) as ID FROM aspnet_OrderHeader", connection) Dim r As SqlDataReader = sqlComm.ExecuteReader() While r.Read() orderheaderid = CInt(r("ID")) End While r.Close() Dim orderlist As ArrayList = CType(Session("OrderList"), ArrayList) Dim sqlTran2 As SqlTransaction = connection.BeginTransaction() ' Enlist a command in the current transaction. Dim command2 As SqlCommand = connection.CreateCommand() command2.Transaction = sqlTran2 Try For i = 0 To orderlist.Count - 1 'Dim ab As String = 'command.CommandText = "a" command2.CommandText = "INSERT INTO aspnet_OrderDetail(OrderHeaderId,ItemCode,ItemName,Price,Quantity) VALUES(" + orderheaderid.ToString + ",'" + orderlist.Item(i).ItemCode.ToString + "','" + orderlist.Item(i).ItemName.ToString + "'," + orderlist.Item(i).ItemPrice.ToString + "," + orderlist.Item(i).ItemQty.ToString + ")" command2.ExecuteNonQuery() ' Commit the transaction Next ' Execute two separate commands. sqlTran2.Commit() Catch ex As Exception ' Handle the exception if the transaction fails to commit. 'lblstatus.Text = "Error : " + ex.Message Try ' Attempt to roll back the transaction. sqlTran2.Rollback() Catch exRollback As Exception ' Throws an InvalidOperationException if the connection ' is closed or the transaction has already been rolled ' back on the server. ' lblstatus.Text = lblstatus.Text + "\nRollBack Error : " + exRollback.Message End Try End Try End Using End Sub End Class 106 Appendix U: Source Codes – Confirmation.aspx Confirmation.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Confirmation.aspx.vb" Inherits="Confirmation" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .style1 { color: #FFFFFF; font-size: xx-large; text-align: center; } .style2 { color: #FFFFFF; font-size: x-large; text-align: center; } </style> </head> <body style="background-color: #000000"> <form id="form1" runat="server"> <div style="text-align: center"> <asp:Image ID="Image1" runat="server" align="center" Height="168px" ImageUrl="~/Image/X-NAIL.jpg" Width="727px" style="text-align: center" /> </div> <p> &nbsp;</p> <p class="style1"> &nbsp;</p> <p class="style2"> Thank you for your purchase! </p> <p class="style2"> &nbsp;Your order has been confirmed.</p> <p class="style2"> &nbsp;</p> <p class="style2"> <asp:Button align="center" ID="Button1" runat="server" Text="Home" PostBackUrl="~/Default.aspx" style="text-align: center" Height="28px" Width="72px"/> </p> </form> <p class="style2"> &nbsp;</p> <p class="style2"> &nbsp;</p> </body> </html> 107