Professional Documents
Culture Documents
BSc Computing
BSc Computing
FoodStop
ABSTRACT
Internet culture has spread across the world from last few decades. At present almost everyone uses internet for doing their professional or personal task. In present era everyone wants their task to be completed as quickly as possible. Moreover, Today almost everything is available to the users on the internet. Online Food Ordering Website is also one of them and it has widely gain popularity among European Countries and United States.
Ordering food over phone is time consuming as customer will have to give all the information like address, post code, phone number and also have to take information of the available items and their price from the bearer. This is a long process and on the other hand the person who is taking the call has to cross check whether all the ordered items taken down are correct or not, so that wrong order is not send to the customer. Still if the person over the phone by mistake has taken wrong order then the customer will end-up having the wrong items.
The main aim of the project is to build online food ordering website i.e. ECommerce website which will not only give the customer option of selecting takeaway and menu items. But they will also be able to compare prices among different takeaways, as menus of the selected takeaway will be available online. The customer will be able to search for takeaway on basis of area code or can see the list of all the takeaways available. The customer will have the option of paying online using Credit/Debit card or pay cash when they receive their order.
Page 3
FoodStop
ACKNOWLEDGEMENTS
I have enjoyed a lot while working on this project. This project has been a learning experience for me. This project has helped me in realizing my capabilities and work more and more to increase them. I have also come to know about my limitations and will try to overcome them in projects that I will work on in future.
I express my thanks to project guide Mr.McElhone Charlie from bottom of my heart for constantly supporting and guiding me throughout the project.
I convey my thanks to Teesside University and faculty members for all the help and support provided by them. I am thank full to all my family members for constantly supporting and motivating me to work more and more on this project.
I would have not been able to develop such a web application without the support that, I have received from all the people that are surrounded by me.
Page 4
FoodStop
Contents 1. Introduction .................................................................................................... 8 2. Aims And Objectives...................................................................................... 9 3. Methodology ................................................................................................ 11 3.1. Different Methodologies......................................................................... 11 3.2. Prototyping Model ................................................................................. 12 3.2.1. Planning .......................................................................................... 13 3.2.2. Analysis ........................................................................................... 13 3.2.3. Design ............................................................................................. 13 3.2.4. Implementation................................................................................ 13 3.2.5. Prototype ......................................................................................... 14 4. Research ..................................................................................................... 15 4.1. General Overview .................................................................................. 15 4.2. Web Programming Technologies .......................................................... 16 4.2.1. ASP.NET ......................................................................................... 16 4.2.2. PHP................................................................................................. 17 4.2.3. JavaScript ....................................................................................... 18 4.2.4. Cascading Style Sheet (CSS) ......................................................... 18 5. Tools and Process Selection ....................................................................... 19 6. Planning....................................................................................................... 20 6.1. Schedule of Milestone Activities ............................................................ 20 6.2. Gantt Chart ............................................................................................ 20 6.3. Quality Plan ........................................................................................... 20 6.3.1. Quality Goals................................................................................... 20 6.3.2. Reviews .......................................................................................... 21 6.3.3. Testing ............................................................................................ 21 6.3.4. Back up ........................................................................................... 21 7. Analysis ....................................................................................................... 22 7.1. Needs Analysis / Requirement of the system ........................................ 22 7.2. Solution ................................................................................................. 22 7.3. Data Gathering ...................................................................................... 22 7.4. Statement of Purpose ............................................................................ 23 7.5. Audience ............................................................................................... 23 7.6. Analysis Report ..................................................................................... 24 8. Design ......................................................................................................... 25 8.1. System .................................................................................................. 25 8.1.1. Visual Style ..................................................................................... 25 8.1.2. On Paper Designing ........................................................................ 26 8.1.3. Customer Page Designing .............................................................. 27 8.1.4. Administrator Page Designing ......................................................... 27 8.1.5. List of Events................................................................................... 28 8.1.6. Story Board ..................................................................................... 35 8.2. Database ............................................................................................... 48 8.2.1. Database Design............................................................................. 48
Page 5
FoodStop
8.2.2. Determining Data to be stored ........................................................ 49 8.2.3. Conceptual Design .......................................................................... 50 8.2.3.1. Entity Type ................................................................................ 50 8.2.3.2. Attributes of Entity ..................................................................... 52 8.2.3.3. Data Dictionary ......................................................................... 53 8.2.3.4. UML Diagram ............................................................................ 61 8.2.4. Logical Design................................................................................. 62 8.2.5. Physical Design ............................................................................... 65 8.3. Case study diagram .............................................................................. 66 8.3.1. Flowchart......................................................................................... 66 8.3.2. Context Diagram ............................................................................. 67 9. Implementation ............................................................................................ 68 9.1. Implementation of the Environment ....................................................... 68 9.2. Implementation of the Application ......................................................... 69 9.3. Use of the Tools / Controls .................................................................... 70 9.4. Implementation of the Database............................................................ 70 9.5. Implementation of the Coding................................................................ 70 9.6. Implement Access for different Types of User ....................................... 72 9.7. Integration of Menu Bar ......................................................................... 72 9.8. Implementation of Asp.Net E-mail functionality ..................................... 72 9.9. Integration of PayPal Feature ................................................................ 73 9.10. Integration of Facebook Page ............................................................. 74 10. Testing ....................................................................................................... 75 10.1. V-Testing Method ................................................................................ 75 10.2. Verification And Validation ................................................................... 76 10.3. Levels of Testing / Testing Process ..................................................... 76 10.3.1. Unit Testing ................................................................................... 77 10.3.2. Integration Testing ........................................................................ 79 10.3.3. System Testing ............................................................................. 80 10.3.4. Acceptance Testing ....................................................................... 80 10.4. Test Case ............................................................................................ 80 11. Evaluation .................................................................................................. 81 11.1 Evaluating Project ................................................................................ 81 11.2. Evaluating Personal Development ...................................................... 82 12. Future Recommendations ......................................................................... 83 References ...................................................................................................... 85 Bibliography ..................................................................................................... 92 Appendix.......................................................................................................... 98 APPENDIX A - Project Specification ............................................................ 98 APPENDIX B - Waterfall / Prototyping Methodology .................................. 100 APPENDIX C - .NET Framework ............................................................... 102 APPENDIX D - Tools and Process Selection ............................................. 104 APPENDIX E - Schedule ............................................................................ 107 APPENDIX F - Gantt chart ......................................................................... 109
Page 6
FoodStop
APPENDIX G - On Paper Designs ............................................................. 111 APPENDIX H - Customer Page Designs .................................................... 118 APPENDIX I - Administrator Page Designs ................................................ 125 APPENDIX J - Physical Designs ................................................................ 129 APPENDIX K - Tools / Controls.................................................................. 131 APPENDIX L - Coding ................................................................................ 133 APPENDIX M - Test Cases ........................................................................ 148 APPENDIX N - Errors/Solution ................................................................... 151
Page 7
FoodStop
1. Introduction
Online food ordering websites comprises of attractive menus and allows the customers to place an order from the local takeaway and restaurant's. Some of these websites allow the customers to register with them. This helps in decreasing the time of ordering food as customers will have to just login and order food while rest of the details will be already there in the database of website after their first registration. The process of ordering food through such website is very easy as the customers will have to just select the available items from the takeaways or restaurants selected by them. Customer can pay for the food using any of the available payment option i.e. Credit Card or Cash. Some percentage of the ordered items is paid to the online food ordering Website Company by the takeaway or the restaurant from where the food is ordered.
Many
websites
like
www.just-eat.co.uk
www.meal2go.com
and
www.hungryhouse.co.uk are famous in UK, while just-eat is famous throughout Europe. This websites have the similar process of ordering food and this websites are increasing competition among them which in return results in benefiting customer by giving attractive prizes and discounts.
With all these information in mind and knowing the importance of online food ordering websites in the present world. The current project aims to develop a dynamic and attractive website with some more features which will not only attract the customers but will also make the process of ordering food more and more easy. This website will be referred as FoodStop throughout the report. Principally, Customers have to just enter their area code which will give the list of takeaways available in their area and then select the item they want. Then Customer will have to just place an order from selected takeaway and make a payment for it using credit/debit card via PayPal or Cash on delivery.
Page 8
FoodStop
Aims of the product:Develop two sides i.e. Customer Side and Administrator Side
Customer Side:
Allow customers to search takeaway by area code. Display List of Takeaways to the customers directly without any search. Allow customers to select the takeaway of their choice. Allow customers to place an order with FoodStop, if they are registered with FoodStop.
Allow customers the option of password recovery if they have forgotten. Send customer the invoice of the food ordered via E-mail. Allow customers to make payment via PayPal or Cash. Allow customers to give Feedback.
Administrator Side:
Allow admin to add new takeaway. Allow admin to update details of the existing takeaways. Allow admin to delete the existing takeaway. Allow admin to create menu of the takeaway when new takeaway is added.
Allow admin to make changes to the menu of the existing takeaway. Allow admin to generate news. Send all the existing customers who are subscribed to receive an e-mail when new takeaway is added.
Allow admin to add new admin. Allow admin to delete existing admin. Allow admin to change e-mail id, password and admin name of admin itself.
Page 9
FoodStop
Increase the knowledge of programming. Developing the skills of modelling data. Integrating PayPal payment system. Understand and Write a conclusive report on project regarding the development process of the project.
Page 10
FoodStop
3. Methodology
Methodology is a set of procedures and techniques used to collect, store, analyze and present information. Moreover, In order to achieve goal, objectives and create an application with minimum fall risk the best suited methodology for the development of website is used. Methodology is needed because development of website can be difficult and complex at time. In such situations methodology can be used as a framework to guide developer in developing the product more systematic and efficiently.
A deep study on all this methodologies was done and then two models i.e. Waterfall Model and Prototyping Model were sorted out. Further Waterfall and Prototyping Model were compared to select any one from them. Please refer Appendix B it gives more information regarding Waterfall and Prototyping Methodology.
Page 11
FoodStop
Page 12
FoodStop
All the individual phase of the prototyping model are explained in brief below:-
3.2.1. Planning
Project planning is important phase of developing the system. In this phase, a schedule and time frame in which the project and its different phase have to be covered was decided. It's easy to develop the system on time, if a good plan is made and followed till end of the project.
3.2.2. Analysis
In this phase, requirements of the system where collected. Takeaways were visited and information about entire process was collected. Information regarding how takeaways proceed with the order when they receive it and how they are connected with the Online Food Order Website was collected. After this rough ideas about what set of functionalities end-user may be expecting from the system was known. These entire sets of requirements were collected and then were analyzed to find out whether they are feasible or not.
3.2.3. Design
Once all the information and requirement about the system was gathered and analyzed then it was necessary to identify in detail how the system will be constructed in order to execute necessary task [3]. A set of one or more design were created on the basis of the requirement .i.e. Designing interface of website and Database was done. These designs were shown to the project guide and after approval implementation phase was started.
3.2.4. Implementation
Implementation phase comprises of coding and testing phases. These phases are explained below:1. Coding In design phase, front-end of the website i.e. interface (How it will look) was developed .But in order to execute any task coding / programming is necessary. In other words, requirements and systems specification from design phase are translated into machine readable computer code [3].
Page 13
FoodStop
2. Testing After coding phase, the prototype of website was totally developed and then testing was performed to ensure that it was working correctly and efficiently. Testing was generally focused on two core areas: 1. Internal correctness 2. External effectiveness Internal efficiency testing was done to make sure that the computer code was efficient, well documented and of standard level. External effectiveness testing was done to find out that whether the software is functioning according to actual system design or not and to see that all the functions and sub-functions are working properly.
3.2.5. Prototype
In this phase, the prototype was shown to the project leader and feedbacks were taken. According to the feedback received, requirements of the system and changes that were needed in the system were done. Further the process of analysis, design and implementation were repeated again and again till the final system was not developed.
Page 14
FoodStop
4. Research
4.1. General Overview
We were required to develop a product as part of main project. The idea that came in my mind was of developing Online Food Order Website and same was put forward to my project leader Mr.McElhone Charlie. He was happy with my idea and a green signal was given for developing it and proceed forward with my work.
Online Food Ordering Website are widely used in Europe and America while they are not accepted in many Asian countries. The main reason that was found behind this was the misconception in the mind of people regarding their card details will not remain safe and can be misused. Moreover, it was found that in some websites though the customer may be searching for any takeaways or restaurants in their own area they dont get the correct result. On the top of it while visiting some of the takeaways, It was found that though takeaway remains open till late night for delivery .Customers are not able to place an order from the existing and popular websites because these websites have something lacking in their system related to time as a result takeaways lose their customers.
Further the research was done to find out the best possible software and language to develop the website. Different websites uses different languages for example, www.just-eat.co.uk uses Asp.net while www.meal2go.com uses PHP. More research was done to find out the best suitable language and database to store data. There are different options available for storing database like Microsoft Access, Microsoft SQL Server, MySQL and Oracle etc. The deep research on Software, language used for coding and Database is shown in coming topics.
Page 15
FoodStop
Process of ASP.NET file When a request from ASP.NET file is send from browser, the request is send to the ASP.NET engine on the server. The file send by the browser is read line after line by browser, and scripts are executed. Finally in response browser receives a plain HTML.
The Microsoft .NET Framework The .Net Framework from Microsoft Windows operating system is a software framework which includes large library and supports several programming languages along with language interoperability i.e. one language can read the code written in other language [4].
The .NET Framework consists of 3 main parts: (Section taken from http://www.w3schools.com/aspnet/aspnet_intro.asp [5]) Programming languages:
ASP .NET (Active Server Pages) Windows Forms (Windows desktop solutions) Compact Framework (PDA / Mobile solutions)
Page 16
FoodStop
Development environments:
Features The principal features of the .NET Framework are:1. Interoperability. 2. Common Language runtime Engine. 3. Language Independence. 4. Basic Class Library. 5. Simplified Deployment. 6. Security. 7. Portability.
All the above features are explained in APPENDIX C. Please refer it to know more about .NET Framework.
4.2.2. PHP
PHP is also server-side scripting language similar to ASP.NET where PHP stands for Hypertext Pre-processor. Databases like Oracle, MySQL, Informix, Solid, Sybase, PostgreSQL, ODBC, Generic etc. Moreover PHP is open source software and can be downloaded for free. All PHP files have .php, .php3 or .phtml extension. Process of PHP file PHP file can also contain html tags, scripts and text similar to the asp.net file. Browser receives the php files in plain html format.
Features PHP is platform independent i.e. it can run on (UNIX, Windows, Linux etc). PHP is server (Apache, IIS, etc) compatible. It runs efficiently on the server side.
Page 17
FoodStop
4.2.3. JavaScript
JavaScript is the popular scripting language on the web, and works in all major browsers, such as Internet Explorer, Firefox, Chrome, Opera and Safari" [8].
Though having limited sets of base objects, methods and data types it is capable of developing client and server side application. It is used for making web pages more interactive. It also has strength of being small overhead. It is used in billions of web pages to validate forms, for communicating with the server, for adding functionalities and much more. As JavaScript is an interpreted language it can be executed without any preliminary compilation.
Page 18
FoodStop
For more information regarding the reason of selecting this tools / process and requirements of the system for using this software. Please see Appendix D.
Page 19
FoodStop
6. Planning
The first phase of the Prototype Model is to plan the project. The Planning phase of the project starts from here:-
Grammatical and spelling mistakes will be removed. 3 click rules will be followed in order to make all the pages easily accessible.
Every image and input fields will have ToolTip which will be visible when end-user moves cursor over it.
Page 20
FoodStop
Website will be viewable in Mozilla Firefox, Internet Explorer and Google Chrome.
Breadcrumbs will be kept, so that end-user can go back to any page from where he/she has came or can go to Home page.
There will be no broken links. It being an online food ordering website will be made more attractive to attract the customers.
Password of Customers and Administrator will be encrypted. Query String data that is viewable in header along with URL will also be encrypted.
6.3.2. Reviews
Documentation produced and Tasks done will be reviewed weekly against the Gantt chart to identify that task is completed on time.
6.3.3. Testing
Testing of the application completed will be done at regular intervals to avoid any major errors / problems at the end. Preventive measures will be taken as soon as any error or problem will be found.
6.3.4. Back up
The product and report created will be taken to a portable media device at regular interval to avoid any circumstances of losing the data and to ensure that backtracking is possible.
Page 21
FoodStop
7. Analysis
Analysis is the second phase of the prototype methodology. In this phase following activities were taken place and they are as below:-
Customer wants to order food from the takeaway. Customer wants the food to be delivered at home. Customer wants to pay the bill online by Credit/Debit card or by cash on delivery.
7.2. Solution
A web based application i.e. website will be able to solve the following problems.
Customer will be able to search for the takeaway on the basis of the area code.
Customer can compare the price of different items among different takeaways.
Customer can see the list of takeaways available. Customer can order food online from the selected takeaway and can also do the payment online using their credit / debit card.
Current Process: At present if any Customer wants to order food online then the customer can order the food from www.just-eat.co.uk . Just-eat is working as a
Page 22
FoodStop
source of medium between takeaways and restaurants currently this website is working in around about 8 countries. This website holding company have tie-ups with the takeaways and restaurants and provide them with a device. They charge the takeaways and restaurants approx 10% on every order that is made using their website. In similar way all other online food order websites works.
Moreover, In order to gets more information regarding the working of websites the below given four websites were visited and are also the competitors of the FoodStop:1. www.meal2go.com 2. www.hungryhouse.co.uk 3. www.eatitnow.co.uk 4. www.just-eat.co.uk
7.5. Audience
FoodStop being an Online Food Ordering Website, the target audience of the website are General Public / Citizens.
Moreover, newly added takeaways who want to attract more customers and provide them online food facility also come under the category of Audiences.
Page 23
FoodStop
There will be Administrator side, Admin will have the rights to add / update / delete takeaway and their menu items.
Admin will be able to publish news. Admin will be able to change password, E-mail ID and Admin Name. Admin will be able to delete the existing administrators and create new admin account also.
There will be Customer side, Customers can see the list of takeaways directly or search for the takeaway on the basis of the area code.
Customers will be able to select the takeaway and their required items from the menu of the takeaway selected, and then they can place the order.
Customers can pay for the bill either by card via PayPal or cash on delivery.
Page 24
FoodStop
8. Design
Designing is the third phase and it comes after analysis phase. In this phase, activities like designing interface of the website, designing of database takes place. Different task and activities that were performed in this phase are as below:
8.1. System
8.1.1. Visual Style
Look and Feel Look and Feel of the website will be clean and simple. Attractive images, logo will be used as FoodStop is an Online Food Ordering Website. Dark and Heavy colours will be avoided as they give the application a dull look. Moreover light colours which give a good and fine look also liked by both genders will be used.
The main content area of the website will be in white colour and the other parts will be in sky blue colour. This combination of colour was used because they invoke the feeling of calmness in the user.
Background: The background will be white as it is not required to draw attention there.
Fonts: To increase the readability of the text bold fonts will be used wherever required.
Images used in the website will be of small size in order to decrease the downloading time.
Animation will not be used throughout the website as they unnecessary distract the eyes from the main content.
Page 25
FoodStop
The design of the Home page as created on paper is shown below. Please see Appendix G for more designs that were created in this phase. It is not necessary that the design and the look decided here will remain the same when actual website is developed. They might change according to the requirement. Home Page
Page 26
FoodStop
In this phase, basic look of the website was decided and the idea of how many pages will be required for the entire website was also cleared from analysis phase and the current activity. It was cleared that there will be two sides in this website:1. Customer Side. 2. Administrator Side.
Customer Side pages will basically deal with the process of searching takeaway, selecting takeaway ordering food from them, and registering customer.
Administrator Side pages will basically deal with the process of adding / updating / deleting takeaway and their menu items, making changes to the administrator account.
The designs of the customer side pages and description of them is given in the appendix. Please see Appendix H for the Customer Page designs and their description.
The designs of the administrator side pages and description of them is given in the appendix. Please see Appendix I for the Customer Page designs and their description.
Page 27
FoodStop
User
Login Requirement
Rights 1) Add/Update/Delete Takeaway. 2) Add/Update/Delete menu Items of Takeaway. 3) Create new Administrator. 4) Change Password, E-mail ID and Admin Name of its own. 5) Delete existing Administrator. 6) Admin can recover the password of Customer and Admin itself.
Customer
Login required, if want to 1) Can Browse the site. place an order. 2) Place an order. 3) Registration and Login necessary for placing the order. 4) Customer can recover password, if forgot.
Page 28
FoodStop
Task Go Login to
ok
then
redirect
to
Administrator Home Page else keep on same page and give error.
Go to add takeaway If all the information's are page and enter all the filled then transfer
details of the takeaway administrator to add menu then press Add button to page. add takeaway. 3 Administrator add menu items 1) Create menu items Every item added to the by filling all the fields. menu will be visible in a GridView below.
2) Click on delete link Corresponding menu item visible for every menu will be Deleted. item in the grid view.
3)
Click
on
button to add all the existing customers who are menu items visible in subscribed to receive news the GridView to the regarding information on
takeaway.
new takeaway.
Page 29
FoodStop
id
of
all
the
existing takeaways will be visible in the dropdown list. Select the takeaway id of the takeaway that you want to update. details of Update the the takeaway
visible in details view and grid view after that. 5 Administrator Go to Add New Menu Select the takeaway name from the dropdown list and enter the respective items that you want to add and click on Add button. 6 Administrator change Takeaway Logo Go to Update Takeaway Select the name of existing Logo Page. takeaway dropdown available list and in then
browse for the logo that you want update. Click on the Update Logo to Update that selected Logo. 7 Administrator Go to delete takeaway List of all the takeaways will be available in the
takeaway. 8 Administrator add new admin Go to update New administrator will be account created and will be given a
administrator
page and select Create message. new option admin from account the
Page 30
FoodStop
visible then Click on create new admin acc button. 9 Administrator change Go to update New password will be set account and a message will of be
administrator
password of its page and select change confirmation own. password option from displayed. the dropdown list and enter the and existing new
password
password and click on Change button. 10 Administrator Go to the Update E-mail ID will be changed account and new E-mail Id will be Password
page and select change set. Email-ID option from the dropdown list, enter new e-mail ID and click on Change button. E-mail ID
11
Administrator
Go
to
the
page and select change Admin Page option from the dropdown list, enter new admin name and click on Change
AdminName button.
Page 31
FoodStop
12
admin account and the list of selected will be deleted. existing admin will be available and click on delete link.
13
Go to the add news The news generated will be page and type the news visible that you want in the GridView
button. 14 Administrator deletes news Go to the add news The news selected will be page and list of news deleted from the database. will be visible in
GridView, select delete button. 15 Administrator edit news Go to the add news The news selected will be page and list of news able to edit and then click will be visible select in on update button it will be edit updated.
Go to the LoginAdmin Admin will be redirected to page or Forgot and click on Forgot Details page and or Select type of user from the dropdown list and enter email id. The details will be sent to the e-mail account.
Username
Password button
17
Enter search
area field
code on
Page 32
FoodStop
their area
on search button.
those takeaways
will be
listed on that search by area code page. 18 Customer wants Click on list sub of All the takeaways available menu will be displayed.
Customer wants Click on the view menu The page of the selected to order food link available with every takeaway the takeaway menu listed their menu. will open with
Click on add symbol The menu item selected will available with be listed under your order on takeaway page with total of all the items. Click on minus button The menu item selected will
of every item.
deletes any item symbol available on the be deleted from the order from selected item the left hand side of the list. every item selected
under your order. 22 Customer want Click on the symbol of Customer will be transferred to proceeds arrow with red colour to the order page and all the items selected with total amount will be visible their also. 23 Customer Login 1) If registered then 1) All the information of the
Enter all the fields under customer will be displayed login and click on login on the same page.
Page 33
FoodStop
button.
Customer
will
be
Member?? Click here registration page and then after registration customer will be transferred back to the order page. 24 Customer edits when all the personal Customer can click on edit the personal information is displayed button and then edit the after Login. personal displayed. 25 Customer recovers Password On Order page click on Account details of the information
information
Forgot User name or customer will be sent to the and Password button, a field Email-ID will appear then user will have to enter the e-mail id and click on click here button.
other details.
26
the
mode from
of drop
food payment
down list:- if want to pay by card 1)Click on PayPal image 1) button if want to pay cash then Card: Customer will
receive an invoice to their mail account and will be transferred BangaruBabu's account can pay where for to the PayPal customer food via
credit/debit card.
Page 34
FoodStop
:Customer
will
receive an invoice but will have to pay when delivery boy comes to deliver the food
27
on
Give sub
Feedback
customer will be able to send there the will feedback be an else error
message. 28 Customer wants Click on the Facebook Customer will be able to see to see the button on the right- hand the page of FoodStop and will be able to like, comment and share it.
website
Administrator Login
Page 35
FoodStop
Page 36
FoodStop
Page 37
FoodStop
Page 38
FoodStop
Page 39
FoodStop
Page 40
FoodStop
Page 41
FoodStop
Page 42
FoodStop
Page 43
FoodStop
Page 44
FoodStop
Customer Login
Page 45
FoodStop
Page 46
FoodStop
Page 47
FoodStop
8.2. Database
Database is the one of the most important part of web application in order to develop a good and success full web application. A good and well designed Database is necessary. "It is basically a system intended to organize, store, and retrieve large amount of data easily [14].
A well structured Database consists of necessary Entities, Attributes and DataTypes of those Entities. A relationship diagram used to represent the relation between those entities.
The process of designing a database consists of some specific steps which are required to be carried out by the database designer in order to develop a good database. The steps that need to be followed are given below:-
1) Determine what data needs to be stored in the Database. In this step of the database design, the database designer needs to find out which data is required to be stored in the Database which data is important and useful. This process is basically a part of requirement analysis. In this step, all required information that is needed in the database is stored.
2) Conceptual Design of Database. Once it is determined that what data is needed to store in the Database. In this step, the dependencies between various data is determined because sometimes we need to change one data on the basis of another.
3) Logical Design of Database. Once dependencies between various information and Data is determined. It's time to arrange this data into a logical design/structure in this step. As a result of
Page 48
FoodStop
this step data is stored in storage objects i.e. Data is stored in table which comprises of rows and columns.
Each table may represent or store information regarding a particular object. There may be many tables which stores different information regarding same objects. As a result, relationship between different tables and its object is determined which helps in preventing the redundant data to be stored in the database.
In this step, physical database is produced by the database designer in the storage media like access, SQL, Oracle etc. All the detailed information like constraint, data type, data elements are specified. Detailed design of the system is developed at this point of time.
Page 49
FoodStop
Entity is basically, a set of information regarding a particular object. 8.2.3.1. Entity Type In this step, Entity needed for the FoodStop is decided and description of those entities is explained in short.
Description
Occurrence
Takeaway1
Item
Storing the menu items When admin adds new for every takeaway. takeaway and then
creates menu item for that takeaway. News For storing news, this When admin generates news is displayed on the any news. home page of the
FoodStop.
Page 50
FoodStop
TempSum
For
storing
data of order placed and items from the menu of for calculating total the takeaway
amount
Customer
registers
Storing information of the When order is placed by OrderDetails order placed by the the customer.
Page 51
FoodStop
8.2.3.2. Attributes of Entity In this step, attributes are find out for all the entities from last step .The table shows the list of all the entities along with their attributes.
Attributes (AdminName, Password , ConfirmPassword, EmailID) (TakeawayID, TakeawayLogo, Name, Address, Area code , City, OpeningTime, ClosingTime, DeliveryCharge)
Item
News TempSum
Customer
(EmailID, Password, ConfirmPassword, Phoneno, Name , Address, Area code , City, Subscription)
OrderDetails
Page 52
FoodStop
8.2.3.3. Data Dictionary "A data dictionary is an integral part of a database, which holds information about the database and the data that it stores, i.e., the meta-data" [16].
Data dictionary is one of the most important component of well documented database. It allows database users, administrators and other who interface the system an easy access to the type of data that they should except to see in every table, row and column of the database without actually accessing the database [17].
A database may be built by and used by multiple users, to make sure that everyone is aware of the type of data that can be stored and its data type .It also makes it easy for all the users to understand the database without accessing it.
Components of data dictionary are as given below:1. Table Name 2. Field Name 3. Data Type (e.g. int, varchar, datetime) 4. Size 5. Is Null 6. Primary / Foreign Key (Constraints) 7. Description
Page 53
FoodStop
Data Type
Size Is Null
Description
AdminName
Varchar
25
No
PK
Name
of
the
Administrator 2 Password Varchar 25 No Password Set by the administrator 3 ConfirmPassword Varchar 25 No Confirm Password Set by the
Page 54
FoodStop
Table 7:-Customer Description:-Storing Information of the customer after registration. Sr.No Field Name Data Type Size Is Primary Description
EmailID
Varchar 30
No
PK
Email-ID customer
of
the
Password
Varchar 25
No
Password
set
by
the customer 3 ConfirmPassword Varchar 25 No Confirm Password set by the customer 4 Phoneno Varchar 15 No Phoneno customer 5 Name Varchar 20 No Name Customer 6 Address Varchar 30 No Address customer 7 Area code Varchar 8 No Area code customer 8 City Varchar 15 No City where the of the of the of the of the
takeaway or not.
Page 55
FoodStop
Table 8: - Item Description: - Storing the menu items for every takeaway.
Data Type
Size Is Null
/ Description
ItemID
Int
No
PK
TakeawayID varchar
25
No
ItemType
varchar
20
No
drinks, chicken etc. 4 5 ItemName Description varchar varchar 20 80 No No Name of the item Description menu item. 6 Amount Float 8 No Price of the item. of the
Page 56
FoodStop
Table 9:-OrderDetails Description:-Storing information of the order placed by the customer and details of the customer.
Data Type
Size
Is
Primary
Description
OrderID
Int
No
PK
Automatically generated Id of
every order placed by customer. 2 EmailID varchar 30 No FK Email-Id customer 3 CustomerDetails Nvarchar MAX No Details customer of the of the
needed
for sending order to their home 4 OrderDetails Nvarchar MAX No Details of the order placed 5 Date varchar 10 No Date when order was placed 6 Time varchar 5 No Time when order was placed 7 TotalAmount varchar 8 No Total amount of the order placed by the customer.
Page 57
FoodStop
Table 10:-Takeaway1 Description:-Storing information of the takeaway Sr.No Field Name Data Type Size Is Null Primary / Foreign Key 1 TakeawayID Varchar 25 No PK Id assigned to the takeaway 2 TakeawayLogo Varchar 250 No Path of the image where it is saved. 3 Name Varchar 15 No Name takeaway. 4 Address Varchar 30 No Address takeaway. 5 Area code Varchar 8 No area code takeaway 6 City Varchar 15 No City where area code is located 7 OpeningTime varchar 8 No Opening time of the takeaway. 8 ClosingTime Varchar 8 No Closing time of the takeaway. 9 DeliveryCharge Varchar 2 No Delivery charge taken by the takeaway if order is below certain level. of the of the of the Description
Page 58
FoodStop
Table 11: - TempSum Description: - For storing temporary data of order placed and for calculating total amount (information displayed under your order section on Takeaway Page).
Data Type
Size Is Null
SessionID
Varchar
50
No
TempID
Varchar
20
No
PK
Temporary assigned to
Id the
order placed. 3 ItemName Varchar 20 No Name of the item placed. 4 ItemDescription Varchar 30 No Description of the item. 5 ItemPrice Float 8 No Price of the item.
Page 59
FoodStop
Table 12: - News Description: - For storing news, this news is displayed on the home page of the FoodStop.
Data Type
Size
Is Null
Description
NewsID
Int
No
PK
ID
assigned
to
the
Page 60
FoodStop
Relationship between Customer and Order table: - A customer can place one or many order while one order belongs to one and only one customer. Relationship between Order and Item table: - A single order consist of one or many items while same item belongs to one and only one order.
Page 61
FoodStop
Relationship between Item and Takeaway table:- On same time order(i.e. items) can be placed from one and only one takeaway while takeaway do have zero or many items. A customer can place one or many order while customer can place order from one particular takeaway at a time. Customer can place order from another takeaway also later on. Moreover, Customer will be having list of items to select from.
Takeaway1
Primary Key
Page 62
FoodStop
City OpeningTime ClosingTime DeliveryCharge Item ItemID TakeawayID ItemType ItemName Description Amount OrderDetails OrderID EmailID Customer Details Order Details Date Time TotalAmount Customer EmailID Password ConfirmPassword Phoneno Primary Key Primary Key Foreign Key Primary Key Foreign Key
Page 63
FoodStop
Name Address Area code City TempSum SessionID TempID ItemName ItemDescription ItemPrice News NewsID News Primary Key Primary Key
* The Logical design of the Database should be made as shown in the above table .This makes the database fall in 3rd Normalized state. But the Database was kept in its 1st Normalized State; the reason behind this was to keep the Details of the order placed from any takeaway preserved even if any takeaway is deleted later on. This Order details can be used in many types of survey and in giving the regular customer discounts. Moreover, data redundancy is avoided and no data is repeated.
Page 64
FoodStop
Page 65
FoodStop
Page 66
FoodStop
Page 67
FoodStop
9. Implementation
The implementation was divided into 9 different parts:1. Implementation of the Environment. 2. Implementation of Application. 3. Use of the Tools / Controls. 4. Implementation of Database. 5. Implementation of Coding. 6. Integration of Menu Bar. 7. Implementation of Asp.Net E-mail functionality. 8. Integration of PayPal Feature. 9. Integration of Facebook Page.
The system that was needed to develop being Web based, Asp.NET was selected for front end as it easier to use and provides a good environment with lots of features that can be used and also supports multiple languages. In the back end, SQL Server 2008 was used the inbuilt database that comes with Visual Studio and also best suited for the project requirement.
Page 68
FoodStop
Web Form i.e. web pages were designed using ASP (Active Server Pages) and C# language was used for executing/Coding purpose. C# is general-purpose, simple, and modern and object oriented programming language
Moreover, Asp.Net has many in-built libraries with-in it which makes it easy in developing and building any type of complex applications.
JavaScript JavaScript is a lightweight, object-oriented language mostly known as scripting language" [19].
In FoodStop, JavaScript is used in creation of the menu bar and in giving the phone number validation on Customer Registration Page.
CSS
CSS stands for cascading style sheet and is basically used for controlling the style and layout of the multiple web pages all at once [20].
In FoodStop, CSS is used only for styling the menu bar i.e. for setting different style properties of the menu bar.
Page 69
FoodStop
All the important coding of website with explanation of every important step can be seen in Appendix L. Some of the important and key processes implemented are explained below. Moreover, please refer Appendix L for coding.
Decreasing size of Image stored:- When image of the Takeaway Logos is uploaded they are resized to the size of 100 * 100 pixels before uploading them in the folder, so that they dont consume more space on server and also helps in decreasing the downloading time of website. Moreover, Images are not stored in the database instead of it path of those image is stored in database [21].
Generating News: - Admin can edit, update and delete the news. This news are stored in the database and later displayed on the main page of FoodStop i.e. Search Page.
Searching Takeaway by Area code: - Customers can search for the takeaway in their area using 3-4 digits Area code. If any takeaway will be available in that area then it will be displayed.
Page 70
FoodStop
List of Takeaways: - Listing all the takeaways in two vertical rows was a difficult task to do but later on they were arranged in two repeaters using two different queries. If result of (TakeawayID % 2)! =0 then takeaway were displayed in one repeater else in another.
Session Management: - One of the most important part of any Ecommerce website is managing the sessions state. This task was done by the use of SessionID the inbuilt functionality of ASP.NET [22].
Data Security: - Data passed in the query string and password of the customer and administrator is encrypted while storing and decrypted when that data needs to be used [23].
Account Details Recovery:- If Customer or Admin forgets user id or password details , they can click on Forgot Username or Password button available on the Login page and then they will have to just enter the e-mail id to receive their account details to respective e-mail account.
Subscription: - Customers are asked whether they want to subscribe for receiving e-mails when new takeaway is added. All the existing customers who subscribe for it will receive e-mail when new takeaway is added to FoodStop.
Phone number validation: - Customers can only enter 11 digits in the Phone number field. JavaScript code was used to give this validation [24].
Steps taken while coding:1. Naming conventions were used throughout the project for representing
every control. For e.g. Name label was represented as lblName, TextBox for Name was represented as txtName. This made the task of coding more easy.
2. Commenting was done throughout the project note only in the coding
Page 71
FoodStop
Customer and Admin both have rights to recover their account details.
the existing customers who have placed an order from FoodStop before and if they are subscribed for receiving e-mail. Informing them that a new takeaway has tied up with FoodStop with so and so name and for more information they can visit FoodStop.
Page 72
FoodStop
2. When customer registers for the first time. 3. Whenever customer places an order from FoodStop, Invoice is sent to the
customer i.e. mail is sent .This mail has all the details of the order placed by the customer.
4. Whenever customer gives feedback, Mail will be received in the FoodStop
mail account.
5. Admin and Customer can recover their account details and they will
Lots of searching was done to find out, how this Payment functionality can be implemented in FoodStop. After lots of searching it was found that PayPal provides the merchant account which can be created by using valid email-id and respective credit card details which belongs to the account holder [26].
To no more about Types of PayPal account and the process of implementing it one can visit www.paypal.com. Moreover, PayPal is an e-commerce business and it allows payments and money transfers via Internet [26].
One can easily integrate this PayPal feature within their website. I was not willing to give my credit card details. So I have not included my PayPal account .Then I found the article on website regarding PayPal integration and I have followed that procedure and was able to integrate it with FoodStop [26]. After integrating this feature, if customer opts for paying by card then customer is transferred to the PayPal Account of Mr.Bhangaru Babu. Please refer Appendix L for the code the Code that was used for this feature.
Page 73
FoodStop
Page 74
FoodStop
10. Testing
Testing is done basically to find out the errors that lie within the system. This process of testing enhances the integrity of the system by detecting deviation in design and errors in the system. Testing also helps in the prevention of errors in the system [27].
It is good for a system and advisable also to conduct proper tests and follow proper testing methodologies before the errors become the defects of the website.
Business/Development Process. Business/Development Process is verified and validated by Quality/testing Process. In this method, checking of the system is done slowly from start to end. As a result, risk is eliminated slowly along with the development process [28]
Page 75
FoodStop
Verification Verification is the process of determining whether or not the output of current phase of
Validation Validation is the process of determining whether or not the system is developed according to the requirement specification.
development conforms to that of the previous one. In this process the question is: Are we building the product right? It involves checking that the system specification. conforms its
product? It ensures that the system meets the expectations of the client.
Page 76
FoodStop
Sr.No Test Performed 1 Check to see whether all labels , text boxes and command buttons are aligned or not 2 Check the tab index property of the input fields. 3 Check to see whether runtime errors exists or not. 4 Check all the Debugging messages and remove. 5 Check the compatibility of the browsers
Result Yes
Yes
Yes
6 7
Check the validation controls Check the generated messages for all errors
Yes Yes
8 9
Check working of all the links Check whether the output matches the expected output.
Yes Yes
Page 77
FoodStop
10 11
Check the mandatory fields. Check whether all the length validations are working or not.
Yes Yes
12
Check the values in database whether they are stored correctly or not
Yes
13
Check that the input values from web form goes in the correct field specified in the database.
Yes
14
Check whether the select , edit, update and delete query working in every dynamic form
Yes
15
Check whether correct confirmation message is displayed or not on every action performed.
Yes
16 17
Check e-mail, mandatory, numeric field. Check calendar used for date in order page working or not.
Yes Yes
18
Yes
19
Yes
20
Yes
21 22
Check the working of menu bar. Check whether the button performs the specified tasks
Yes Yes
Page 78
FoodStop
23 24
Check the SiteMapPath Check whether comments are given properly or not throughout the project.
Yes Yes
25
The main purpose of integration testing was to verify functional, reliability requirements and performance placed on major design items [32].
Result
Check
whether
authorization
authentication is maintained or not 3 Check to see whether unit level All Functionalities were Preserved.
Page 79
FoodStop
Page 80
FoodStop
11. Evaluation
11.1 Evaluating Project
The main aim of the project was to develop Online Food Ordering website which has capabilities of Adding new Takeaways, Make changes to the details of the Takeaway, Develop a menu according to the requirement of the takeaway, Customer should be able to search takeaway in their area, Customer should be able to select the menu items and then should be able to order food and make payment for it. Almost all the requirements are met but before making it a commercial product there are some changes that needs to be done those changes can be seen in Future Recommendation section.
During development of FoodStop many problems were faced but these problems were overcome by validating and analyzing the system for errors and threats constantly .The main problems that were arising in the system was because of Database and there were some errors regarding the calculation of the total items. This problem was solved later on. Many problems have been faced in fetching the different takeaway details from the database and arranging them vertically on a single page i.e. List of Takeaway Page. Further this problem was solved by using two repeater controls with two different queries. Moreover, fetching the different menu items of the same takeaway from a single table and arranging them on page was also a difficult task to do but was made possible using different repeaters for it. The use of the Prototyping Methodology has been
useful in meeting the requirement and objectives of the project. Other methodology may have been not so much successful compared to Prototyping Methodology.
Further researching about Online Food Ordering Website and implementing the changes as recommended in Future recommendation section will surely make this project ready for meeting the requirements of the target audience and expectations of them from this system. With little changes in the designing of the interface and implementation of the database, the website will be able to serve all the purposes. The use of Asp.Net as a language has met the requirement of the
Page 81
FoodStop
system so no need of changing the language was found, But the look of the Website still lacks the attraction that it should have which can be changed by using CSS. If time permits, implementing all this functionalities will be a prime goal.
Page 82
FoodStop
Page 83
FoodStop
8. Improve Security: - At present the login details are encrypted but details like time of logging and logged out and what task were performed by administrator can be stored to track the record. 9. Adding Delivery Charge: - At Present, the fixed delivery charge of the takeaway is added but delivery charge on basis of distance is not possible. This needs to be improved as it is one of the important parts of this system. 10. Chatting option: - Live chatting option can be implemented, so that customers problem can be solved on the spot. 11. Quantity of ordered items: - At present all the items are listed one by one though same item may be repeating again and again, Quantity of same item can be implemented. 12. Database: - Database should be improved from 1st Normalization to 3rd Normalization if any solution of keeping the Order Details safe while deleting any Takeaway is possible.
Page 84
FoodStop
References
[1] Rogers B. "Prototyping. http://web.sxu.edu/rogers/sys/prototype.html [Accessed 25 November 2010].
[2]
[3]
eyesee (2009) Identify and discuss at least 3 systems development models..discuss each phases... (at least 3000 words). Assignment 4 in SAD 1 [Online].http://usep-ic.forumsmotions.com/t163-assignment-4-duedecember-31-2009-before-0100pm [Accessed 30 November 2010].
[4]
Wikipedia. ".NET Framework".2011. http://en.wikipedia.org/wiki/Microsoft_.Net [Accessed 5 December 2010]. W3Schools. ASP.NET Introduction. http://www.w3schools.com/aspnet/aspnet_intro.asp [Accessed 1 December 2010]. Masur, A. (2005) CodeGuru Individual FAQs. .NET Framework IL: What is Language Interoperability? [Online]. http://www.codeguru.com/forum/showthread.php?t=369066 [Accessed 15 December 2010].
[5]
[6]
[7]
Page 85
FoodStop
W3Schools. JavaScript Introduction". http://www.w3schools.com/js/js_intro.asp [Accessed 25 December 2010].
[8]
[9]
[10]
Wikipedia (2011) "Microsoft Visual Studio". http://en.wikipedia.org/wiki/Visual_studio [Accessed 20 December 2010]. Microsoft (2010)VISUAL STUDIO 2010 ULTIMATE. http://www.microsoft.com/visualstudio/en-us/products/2010editions/ultimate [Accessed 20 December 2010]. Long, M. (2011) Microsoft Visual Studio 2010 Tutorials. http://www.vtc.com/products/MicrosoftVisualStudio2010/GettingStartedwith VisualStudio2010/99008[Accessed 20 December 2010]. ACTANO. (2011) ACTANO GLOSSARY. https://www.actano.com/actano/f/glossary/g/ [Accessed 28 December 2010].
[11]
[12]
[13]
[14]
[15]
Wikipedia (2011) "Database design". http://en.wikipedia.org/wiki/Database_design#ER_Diagram_.28Entityrelationship_model.29 [Accessed 19 January 2011]. TopBits. Data Dictionary. http://www.tech-faq.com/data-dictionary.html [Accessed 19 January 2011].
[16]
Page 86
FoodStop
Toombs, E. (2010) What is a Data Dictionary?. http://www.suite101.com/content/what-is-a-data-dictionarya228108[Accessed 19 January 2011].
[17]
[18]
Wikipedia (2011) "ASP.NET". http://en.wikipedia.org/wiki/ASP.NET [Accessed 20 October 2010]. fryn. (2011) JavaScript. https://developer.mozilla.org/en/javascript [Accessed 11 December 2010].
[19]
[20]
W3Schools (2011)CSS Tutorial,http://www.w3schools.com/css/default.asp[Accessed 15 December 2010]. Omu (2010) ASP.NET Image uploading with Resizing [Script]. http://stackoverflow.com/questions/254419/asp-net-image-uploading-withresizing [Accessed 12 January 2011]. Microsoft Support (2006) How and why session IDs are reused in ASP.NET.http://support.microsoft.com/kb/899918 [Accessed 10 March 2011]. Kajol (2009) Encryption and Decryption With Querystring using ASP.NET [Script].http://www.dotnetspark.com/kb/512-encryption-and-decryptionwith-querystring.aspx [Accessed 10 March 2011]. dhtmlgoodies (2006) Tab menu [Script]. http://www.dhtmlgoodies.com/scripts/dhtmlgoodies-tabmenu/dhtmlgoodiestabmenu-images.html [Accessed 15 January 2011]. WEB DESIGN LIBRARY (2005) Restricting a Field to Numbers Only [Script].http://www.webdesign.org/html-and-css/tutorials/all-aboutforms.6138.html [Accessed 21 February 2011].
[21]
[22]
[23]
[24]
[25]
Page 87
FoodStop
Pureti, B. (2010) Online Payments Using PayPal Integration with ASP.NET [Script]. http://www.dotnetfunda.com/articles/article928-onlinepayments-using-paypal-integration-with-aspnet-.aspx [Accessed 21 February 2011].
[26]
[27]
Microsoft (2010)Testing Process. http://msdn.microsoft.com/enus/library/ms978235.aspx [Accessed 23 February 2011]. Software Quality Source. V Concept of Testing.http://softwarequalitysource.com/VConceptTesting.html[Accessed 23 February 2011]. Software Quality Source. V Concept of Testing [Online Image]. http://softwarequalitysource.com/images/image_sqs/VConceptofTesting_Bl ockDiagram.jpg[Accessed 23 February 2011].
[28]
[29]
[30]
[31]
Wikipedia (2011)"Integration testing". http://en.wikipedia.org/wiki/Integration_testing [Accessed 25 February 2011]. Can-Technologies Inc. Test & Simulation. http://www.cantechnologies.com/services_test_simulation.aspx [Accessed 25 February 2010]. vinz. (2008) ERROR: Both DataSource and DataSourceID are defined on ..., [Online].http://forums.asp.net/t/1239083.aspx [Accessed 26 February 2011].
[32]
[33]
Page 88
FoodStop
leojose. (2007)."Must declare the scalar variable @FirstName , [Online]. http://www.velocityreviews.com/forums/t101386-must-declare-the-scalarvariable-firstname.html [Accessed 11 February 2011]. BYTES (2005)Incorrect syntax near the Keyword user . http://bytes.com/topic/net/answers/779254-incorrect-syntax-near-keyworduser [Accessed 11 February 2011].
[34]
[35]
[36]
Microsoft (2010)FileNotFoundException Class. http://msdn.microsoft.com/enus/library/system.io.filenotfoundexception.aspx [Accessed 23 February 2011]. BYTES (2005)SQL version 8.0 Invalid Column Name. http://bytes.com/topic/sql-server/answers/78661-sql-version-8-0-invalidcolumn-name [Accessed 19 February 2011]. Microsoft. (2010)? the file.mdf is on network path that is not supported for database file, [Online]. http://social.msdn.microsoft.com/Forums/en/Vsexpressvcs/thread/97479a6 d-9630-4510-9994-a6cd96c5840d[Accessed 15 February 2011].
[37]
[38]
[39]
[40]
ComTech. "Technical Support Info" [Online Image]. http://www.comtech-networking.com/ [Accessed 20 February 2011].
Page 89
FoodStop
[41]
[42]
HYPNOSIS 101. "Arrow 2 right" [Online Image]. http://www.hypnosis101.com/images/arrow_2_right.gif [Accessed 12 December 2010].
[43]
[44]
Kumar, A. (2009) "Tandoori Chicken" [Online Image]. http://arunkumar.coreibms.com/wp/wp-content/uploads/2009/11/tandoorichicken.jpg [Accessed 13 December 2010].
[45]
Gourmet India. "Rajasthani thali" [Online Image]. http://www.gourmetindia.com/img/Rajasthani%20thali.jpg [Accessed 15 December 2010].
[46]
The IPKat. (2006) "Pepsico" [Online Image]. http://ipkitten.blogspot.com/2006/04/latest-etmr-copyright-world.html [Accessed 15 December 2010].
[47]
Deleket. (2008) "Button Add Icon" [Online Image]. http://www.iconarchive.com/icons/deleket/button/24/Button-Addicon.png[Accessed 12 December 2010].
[48]
Page 90
FoodStop
[49]
[50]
[51]
Eat in or out. "khans village tandoori" [Online Image]. http://devbeta.eatinorout.co.uk/supplier-imagefolder/khans_village_tandoori/large/logo.jpg [Accessed 25 December 2010]. Anonymous. "PAPA JOHNS" [Online Image]. http://www.franchisebusiness.co.uk/perfect-pizza/logo.gif [Accessed 25 December 2010].
[52]
[53]
[54]
Twardowski, O. "minus button" [Online Image]. http://findicons.com/files/icons/2192/flavour_extended/48/button_minus_re d.png [Accessed 17 December 2010].
[55]
Ghanem A. (2008) Changing the session ID programmatically.weblogs.asp.net, 16 Dec.http://weblogs.asp.net/anasghanem/archive/2008/12/16/programmatic ally-changing-the-session-id.aspx [Accessed 21 February 2011].
[56]
Page 91
FoodStop
Bibliography
Agarwal, S. (2008) Create a Table Dynamically in ASP.NET 2.0 and ASP.NET 3.5 [Script]. http://www.dotnetcurry.com/ShowArticle.aspx?ID=135&AspxAutoDetectCookieSu pport=1 [Accessed 25 January 2011]. Agarwal, S. (2008) Creating CollapsiblePanelExtender Functionality using ASP.NET and jQuery [Script]. http://www.dotnetcurry.com/ShowArticle.aspx?ID=240 [Accessed 31 January 2011].
ASPNET101 (2007)Sending Bulk E-mails in ASP.NET.http://www.aspnet101.com/2007/05/sending-multiple-emails-at-once/ [Accessed 22 February 2011]. ASP.NET TUTORIALS. Create data table in ASP.NET 2.0(C#).http://www.aspnettutorials.com/tutorials/controls/data-tablecsharp.aspx[Accessed 13 February 2011]. azamsharp (2009) Send string with QueryString in Repeater Control in ASP.net [Script]. http://stackoverflow.com/questions/1489517/send-string-with-querystring-inrepeater-control-in-asp-net [Accessed 18 February 2011].
Canavar. (2009) Write html code inside asp.net (C#) (.cs) page [Script]. http://stackoverflow.com/questions/1078933/write-html-code-inside-asp-net-c-cspage [Accessed 20 February 2011].
Page 92
FoodStop
Center for Technology in Government." The Waterfall Model ". http://www.ctg.albany.edu/publications/reports/survey_of_sysdev?chapter=5 [Accessed 25 November 2010]. Chesterhomer, D. Getting Value From Database Table And Fired It Into Textbox [Script]. http://www.dreamincode.net/forums/topic/126897-getting-value-from-databasetable-and-fired-it-into-textbox/ [Accessed 12 February 2011]. COMPUTER TIPS.Analysis Phase of System Development Life Cycle.http://www.computerfreetips.com/main_page/System_Analysis.html [Accessed 25 November 2010].
Dennis, Alan, et.al, (2010), System Analysis and Design with UML, An ObjectOriented Approach; 3rd ed., John Wiley, pp. 3-30, (Extract from Chapter 1) [Accessed 25 November 2010]. Dexterz. (2005) ASP.NET Display Random records from the database, [Online]. http://www.daniweb.com/web-development/aspnet/threads/27001[Accessed 17 February 2011]. Guest Contributor (2004)Sending Using the ASP.NET Calendar control ASP.NET. http://www.techrepublic.com/article/using-the-aspnet-calendarcontrol/5319954 [Accessed 15 February 2011]. Hamilton, M. (2009) Insert all values of a table into another table in SQL [Script]. http://stackoverflow.com/questions/576441/insert-all-values-of-a-table-intoanother-table-in-sql [Accessed 7 February 2011].
Page 93
FoodStop
Iqbal, Y. (2010) Dynamically adding columns to a table in the database, [Online]. http://forums.asp.net/p/1573806/3952211.aspx [Accessed 21 January 2011]. Jain, A. (2007) Using Data Relation with Data Table....The CODE PROJECT, 6 Apr. http://www.codeproject.com/KB/database/DataRelationExample.aspx [Accessed 29 January 2011].
jQuery.Dialog.http://jqueryui.com/demos/dialog/[Accessed 28 January 2011]. Kozyk, S.What is ASP.NET? Top 12 Advantages of ASP.NET.http://ezinearticles.com/?What-is-ASP.NET?--Top-12-Advantages-ofASP.NET&id=1358877[Accessed 26 November 2011].
Makhaai, R. (2010) Image Handling In ASP.NET....The CODE PROJECT, 11 Nov. http://www.codeproject.com/Articles/126421/Image-Handling-In-ASPNET.aspx?msg=3695505#_top [Accessed 27 January 2011].
Marshall A (2009) Project Methodology Notes. http://outranet.scm.tees.ac.uk/users/u0000636/ppr06/assets/PPRNotes09.pdf [Accessed 31 November 2010]. Microsoft.MailMessage Members. http://msdn.microsoft.com/enus/library/ss6zhx82(vs.71).aspx [Accessed 9 February 2011]. Microsoft.DetailsView.ModeChanging Event. http://msdn.microsoft.com/enus/library/system.web.ui.webcontrols.detailsview.modechanging.aspx [Accessed 10 February 2011]. Microsoft .ASP.NET Web Project Paths. http://msdn.microsoft.com/enus/library/ms178116.aspx [Accessed 17 February 2011].
Page 94
FoodStop
Microsoft.Repeater Web Server Control Overview. http://msdn.microsoft.com/en-us/library/x8f2zez5.aspx [Accessed 25 February 2011] Microsoft Support (2007) ASP.NET data binding overview. http://support.microsoft.com/kb/307860 [Accessed 21 February 2011].
Mitchell, S.Inserting, Updating, and Deleting Data with the SqlDataSource.http://www.asp.net/data-access/tutorials/inserting-updating-anddeleting-data-with-the-sqldatasource-cs[Accessed 24 January 2011].
Moderator1 (2007)Inserting Images into Database and Display it in GridView through Handler.ashx.http://www.aspdotnetcodes.com/Insert_Images_Database.aspx[Ac cessed 20 January 2011].
Ozgur, A. (2004) Passing variables between pages using QueryString....The CODE PROJECT, 18 Jan. http://www.codeproject.com/KB/aspnet/QueryString.aspx [Accessed 5 February 2011].
Page 95
FoodStop
Satteesh Babu. (2009)Introduction to ASP.Net Dynamic Data Websites.http://www.codedigest.com/Articles/ASPNET/292_Introduction_to_AS PNet_Dynamic_Data_Website.aspx[Accessed 16 January 2011].
Sharper Tutorials. Validating Input using ASP.Net. http://sharpertutorials.com/validating-input-using-aspnet/ [Accessed 14 January 2011]. SheoNarayan (2008) Getting selected record key value from ASP.NET Data Controls [Script]. http://www.dotnetfunda.com/articles/article153.aspx [Accessed 10 January 2011].
Timah, W. (2011) "Prototyping Model". http://csebrules.blogspot.com/2011/01/assignment-2-task-2-prototypingmodel.html [Accessed 20 November 2010]. uCertify (2005)System Development Life Cycle (SDLC). http://www.ucertify.com/article/system-development-life-cycle-sdlc.html[Accessed 22 November 2010]. Veesam, S. (2008) Saving and Retreiving Images from Sql Server 2005, [Online]. http://forums.asp.net/p/1295549/2583489.aspx [Accessed 24 December 2010]. Vimal, M. (2010)ASP.Net Development 7 Advantages of ASP.Net Development.http://www.articlesbase.com/software-articles/aspnetdevelopment-7-advantages-of-aspnet-development-3157235.html[Accessed 20 December 2010].
Page 96
FoodStop
Webdeveloper (2007) Dynamic creation of table in ASP.NET.http://www.webdeveloper.com/forum/showthread.php?t=156750[Acce ssed 10 January 2011].
Wikipedia (2011) "Software prototyping". http://en.wikipedia.org/wiki/Software_prototyping#Outline_of_the_prototyping_pro cess [Accessed 21 November 2010]. W3Schools. PHP Introduction. http://www.w3schools.com/php/php_intro.asp [Accessed 19 December 2010].
Page 97
FoodStop
Appendix
APPENDIX A - Project Specification
Project Title: FoodStop
Problem: - Customer wants the quality food and at cheap rate and wants the food to be delivered at home.
Solution: - A web based application i.e. website will be able to solve the following problems. 1) Customer will be able to search the takeaways and restaurants in their area. 2) They will be able to compare the price of the food available at different takeaways. 3) They can order food online and also pay for it using their credit/debit card. Objectives:- Our website will be having the records of all the takeaways and restaurants affiliated with us and also we will put up a Google map so that if customer opts for the collection order it will provide help to the customer in searching out nearby takeaways and restaurants and will be able to reach their easily. Customer will be able to get quality and cheap food as customer will be able to see and compare the menus of different takeaways and restaurants. Steps to follow to order food from website: - The user will first have to search the location of takeaway or restaurant from the search tab. The user will be able to see all the takeaways and restaurants in the searched location. The user will then have to select the takeaway or restaurant after that the user will have to register with website using his/her e-mail id. If user has already been to the website before then user can Login with existing e-mail id. E-mail ID is taken from the users because they will be given some offers from the takeaways or
Page 98
FoodStop
restaurants. The user can pay the bill using the credit/debit card or by cash when they receive their food at home. Security of the credit/ debit card details will be taken care of.
Development Stage System Analysis System Designing Coding Testing Report Writing Project Submission
Front-end:Microsoft Asp.net
Back-end:C#
Page 99
FoodStop
Waterfall method follows the linear / sequential framework for system development. In this method, every new process or task is started after the previous one is completed. This model gives more emphasis on time schedules, budgets, planning, target dates and implementation of entire system at one time.
Advantages:
It is very easy to understand the long process of the system development as all the phases in waterfall model are arranged very clearly.
New developers can also understand and follow it very easily. More emphasis on documentation, leads to the completion of
documentation along with the phase that developers are working on. As a result even if any team member or entire team changes then also the new one will be able to continue by reading the documentation.
Disadvantages:1. Inflexible - Once if any phase is completed, backward step cant be taken. As
a result, suppose if developer has done with the design phase and after some time if the requirement of the client changes then it is not possible for him to do that.
2. Due to requirements inconsistencies from the client, problem may arise and
Page 100
FoodStop
2. Prototyping Model In Prototyping model a prototype is developed and then shown to the client. This prototype is build, tested and reworked and shown to the client again and again till the final prototype is not developed and accepted by the client. In this model, analysis, design and implementation process are repeated again and again in a cycle till the final product/system is not developed.
Advantages:
This model can be used when the requirements of the system is not specified.
System functionalities can be improved and changes in the systems can be done according to the requirement of the client.
"Involvement end-users [1]. System is developed faster. System developed using this model closely meets the requirements of the client.
Money saver.
Disadvantages:
Strong management is required according to the nature of this model. As it requires back to back meetings with the client and also the change in the requirements have to be met.
Many changes in the design can lead to the damage of the structure. This model is not suitable in building large projects.
Page 101
FoodStop
Common Language Runtime Engine is a runtime environment provided by .Net Framework which makes the development process easier [7].
Language Independence The .NET Framework makes the visual studio independent of the languages that can be used like C# code, VB.NET code, J# code. CTS (Common Type System) was bring into operation for the first time by .Net Framework that makes it possible by supporting the exchange of types and objects instances among applications and libraries.
Base Class Library A standard library is made available to all the languages that are using .NET Framework. Common functions like writing and reading file , rendering graphics , interacting with database and manipulation of XML document are some of the function that are included in the Base Case Library (BCL) in order to make the job of programming easier.
Simplified Deployment Deployment of the software is simplified in .NET Framework by including tools and design features that helps in managing the installation of software's.
Security A common security model is provided for all the application by .NET Framework to avoid exploitation of the designs such as buffer overflows by malicious software's.
Page 102
FoodStop
Portability Design developed using .NET Framework are cross- platform compatible and thus program written to use framework should run without change in any type of system for which the framework was implemented.
Page 103
FoodStop
Visual studio 2010 Ultimate comes with a series of tools to help teams ensure quality results, from design to deployment. Some of these tools are below:-
Integrated Development Environment (IDE) is a software application that comes with both design and debugging environment .Moreover, it also have the source code editor where the developer can write the code and a compiler/ interpreter. Multi-monitor support for organizing and managing the work however you want is also now possible with Visual studio 2010 Ultimate [11].
Development Platform Support, you can create new application or enhance the existing one and with Visual Studio you can work on wide range of platforms like office, Web, Windows, Windows Server, SharePoint, Cloud and more all in a single IDE [11].
Database Development, provides the developer with change management tools and provides robust deployment to ensure that the database application are always synchronized [11].
Page 104
FoodStop
2. Reason of Selecting Tools and Process Prototype methodology was selected for developing this product as requirement specification was not cleared and the technology or language in which the product can be developed to its best was also not known. In prototyping, one can develop a prototype and work on it again and again till the requirements of the system are not met.
Further ASP.NET technology was selected for developing this system, as I have worked on this platform before also. Moreover, it was necessary to develop project within the Time frame of 20 weeks which was not enough to develop a fully functional product in an unknown language.
Visual studio 2010 Ultimate is latest IDE from Microsoft which is used for developing such .NET applications. It was used along with Microsoft SQL Server 2008 the inbuilt database which is considered to be one of the secured databases.
Software and the Hardware Requirements for working on Visual Studio 2010 Ultimate are as given below:-
3. System Requirements
Software Requirement
Windows XP (x86) SP3 All editions expect starter edition Windows Vista (32 & 64 bit) SP2 All editions expect starter edition Windows 7 (32 & 64 bit) SP3 Windows Server 2003 R2 (32 & 64 bit) Windows Server 2008 (32 & 64 bit)SP2 Windows Server 2008 R2 (64 bit)
Page 105
FoodStop
Hardware Requirements
1.6 GHz or faster 1 GB RAM (32 Bit) or 2 GB RAM (64 Bit) Add 512 if in Virtual Environment 3 GB of available hard Disk Space DirectX 9 capable video card running at 1024 * 768 or higher resolution.
(The above section of Software and hardware requirements is taken from
http://www.vtc.com/products/MicrosoftVisualStudio2010/GettingStartedwithVisualStudio2 010/99008 ) [12].
Page 106
FoodStop
APPENDIX E - Schedule
Table 1:- Schedule of Milestone Activities
Month/Week November
Week4 Complete the project analysis and discuss it with the supervisor.
Supervisor and with the if agreed start understanding project requirement. supervisor and start project analysis. Take reviews
December
design work on on the design paper and work done from the supervisor and start developing it using asp.net.
January
Do the changes in the designs if needed and star creating database on paper.
Page 107
FoodStop
February
Continue with
Complete the
Show the entire project to the supervisor and take reviews and do changes if needed.
the coding work coding work and show it to supervisor. and show it to supervisor.
March
Complete the report and check both product and report for errors.
April
Page 108
FoodStop
Page 109
FoodStop
Page 110
FoodStop
Page 111
FoodStop
Page 112
FoodStop
Page 113
FoodStop
Takeaway Page
Page 114
FoodStop
Page 115
FoodStop
1) Search Page:-The first page will be the search page; the user can search for any takeaway on basis of the area code. The user can also log in if the customer is already have account , if the user is new he/she can also register directly from here. The user can search, sign up, sign in and can also give feedback. Moreover, if the user is logged in some of the link button will change sign in will change to sign out and sign up will change to my details.
2) List of takeaway page: - When customer will search on the basis of area code, customer will get list of takeaways with some information about them and the user can go for the best takeaway that they like.
3) Takeaway page: - When customer select any takeaway from the list of takeaway in the last step, customer will now get the detailed information about the takeaway like menu, price of all the items and even the customer can select the desired food they want to take and customer can also see the amount they have to pay for the order. After selecting the items they have to proceed further.
4) Order Food Page: - Here customer will be able to see the items along with the price that they have to pay. The customer is required to register if the customer is not having account with FoodStop. If customer is having account he/she must be logged in and then only they can proceed towards the payment page.
5) Payment Page: - The user can now make a payment in favour of the shop name and the amount can be paid by credit / debit card.
6) Validate Payment: - This mode of transaction is only possible if the website holder is having the permission from the banks, to proceed with such kind of transaction. Then order details are sent to the takeaway shop.
7) Takeaway reply page: - If the takeaway accepts the order request then the amount will be deducted from their account and they will receive the confirmation
Page 116
FoodStop
message else if order is not accepted then the transaction will be cancelled and the message will be send according to it.
8) My Details: - All the information regarding the customer will be available here and customer can also edit, update or delete the same.
9) Feedback: - The customer can give feedback regarding the takeaway and this feedback will then be given to the takeaways, so that if there is anything lacking in the service it can be improved for the next time.
10) Help: - This page will help out the customers with the problems that are frequently faced in placing online order and how to overcome from it. Customer will also be given guidance regarding how to select the best takeaway according to their requirement.
11) About us: - All the information regarding the website holder will be available here.
12) Admin: - This page can be accessed by only administrator and administrator can edit or delete new takeaways in the website.
Page 117
FoodStop
Description: - The look of header was made attractive as it is required to attract the customers for Food. As name of website is FoodStop many food items were kept in header to resemble the name.
Description: - This is the main Search Page of FoodStop; Customer can search takeaways available in their area by entering area code in the search tab seen above. The process of the FoodStop can be seen by the image available at the left bottom corner of the page. Easy to navigate and accessible menu bar was used. Moreover breadcrumbs were used in order to let customer know their
Page 118
FoodStop
location on website. Customer can see the Facebook page of FoodStop by clicking on the Facebook button.
Description: - Takeaways that are added with FoodStop will be visible on this page in two vertical rows as seen in above image.
4) Takeaway Page
Page 119
FoodStop
Description: - When user selects any Takeaway from the list of Takeaways available on the List of Takeaway Page, Customer is redirected to the page of that Takeaway. Customer can see the details of the takeaway along with items available in the menu .The user can select the items by clicking on add symbol button and the selected order will be displayed under Your Order. Moreover any order that customer don't want to take can be deleted from the list. Delivery charge taken by the takeaway can also be seen. If customer wants to proceed with the order then arrow symbol button requires to be clicked.
5) Order Page
Description: - Customer will be redirected to this page from the Takeaway Page when he/she wants to proceed with the order. List of all the items selected, Total Amount of Food Ordered along with delivery charge can be seen here. Here if customer is already registered then can proceed with the order directly else needs to be registered. If in case any customer has forgotten their account details then they can retrieve it by clicking on the "Forgot Username or Password" button and then by entering their email-id.
Page 120
FoodStop
Description: - Customer is required to fill all the above details in order to register with FoodStop and needs to select Yes or No from the dropdown list in order to subscribe for the News.
Page 121
FoodStop
7) Order Page
Description: - If customer is registered once then can login after login, all the account details will be visible. If customer wants to edit the account details then can change here and proceed further with the order. Customer is required to select the Mode of Payment from the dropdown list available just below the Personal details of the customer. Customer will be sent an invoice to the e-mail account when order is placed.
Page 122
FoodStop
Description: - Customer will be transferred to this page if mode of payment selected is card.
Page 123
FoodStop
9) Facebook Page
Description: - When customer clicks on the Facebook button then will be redirected to the page of FoodStop on Facebook. Customer can like, comment all the activities of Facebook.
Page 124
FoodStop
Description: - Admin can login from here and in case if admin has forgot the account details then can click on "Forgot Username or Password" button.
Description: - Admin can add new takeaway by filling all the above details and then will be transferred to Add Menu page where items related to that takeaway can be added and deleted.
Page 125
FoodStop
Description: - If new items needs to be added to the existing Takeaway, then customer can select the existing Takeaway from the dropdown list.
Description: - Admin can retrieve the account details of himself and Customer the account details will be sent to the respective email-id.
Page 126
FoodStop
Description: - All the operations related to the admin account can be done from here. Operations like Changing Password, creating new admin account, changing email-id and changing the admin name can be done here.
Description: - Admin can delete the existing admin accounts on this page.
Page 127
FoodStop
7) News Page
Description: - Admin can generate news and edit, delete the existing one.
Description: - Logo of the Takeaway can be update from this page, Admin will have to just select the existing takeaway and browse for the logo which you want to replace with.
Page 128
FoodStop
2) Customer Table
Page 129
FoodStop
3) Item Table
4) News Table
5) OrderDetails Table
6) TempSum Table
Page 130
FoodStop
Textbox control: - When any input is needed from the users this field is used.
Hyperlink control: - Hyperlink is used whenever any direct link to any document or web page needs to be given i.e. it is used to direct the users to that particular web page.
Button control: - Whenever any code/process needs to be executed this control is used
Image control: - Image control was used for displaying images e.g. Logo of FoodStop.
Image Button control: - Image button is nothing but a simple button with image on it. E.g. UK map on the search page.
Link Button control: - Link button looks like hyperlink but it also have the functionalities of actual button.
Calendar control: - Calendar control was used so that user can select the date manually and selected date will be displayed in the textbox.
Dropdown List control: - This control is used whenever we want to select from list of options. It was used for selecting items in admin side and for selecting time on customer side.
File Upload Control: - This control is used for uploading image of the takeaway.
Page 131
FoodStop
Hidden Field control: - This control is used when we want to keep the information in page without displaying it to the users.
Literal: - This control is used for displaying text on web page that user cannot change. It is used for displaying news.
GridView control: - This control is used for performing operations on the data that is stored in the database. It displays the data in horizontal manner in the form of tables. In FoodStop, this control is used only in the administrator side pages.
Details View control: - This control works as GridView but can display only one row at a time.
Repeater control: - This control is also used to display data from database. But we can modify the way of displaying data according to our wish. The list of takeaways that are displayed in the ListTakeaway.aspx page was made possible by using this control only.
SqlDataSource control: - This control is used for binding database with other controls and for performing query's and other operations related to database.
RequiredFieldValidator control: - This control is binded with the other input controls like textbox, so that user cannot keep that field empty.
RegularExpressionValidator control: - When we want any input that should follow certain expression this control is used e.g. Customers E-mail ID.
SiteMapPath control: - This control displays a navigation path and makes the users know the current location of the page. It also gives the users the way back to the home page e.g. it is used just below the menu bar.
Div control: - This control is used for making sections in the HTML document.
Page 132
FoodStop
APPENDIX L - Coding
Resize image before uploading in folder
protected void btnAdd_Click (object sender, EventArgs e) { // session variable initialized here
String imgfilepath = Server.MapPath("~/Images/" + FileUpload1.FileName); // setting the file path of takeaway logo uploaded.
// checking whether file is hasfile or not if (FileUpload1.HasFile) { //FileUpload1.SaveAs(imgfilepath); using(System.Drawing.ImageImg=System.Drawing.Image.FromFile(System.IO.P ath.GetFullPath(FileUpload1.PostedFile.FileName))) { Size ThumbNailSize = NewImageSize(100, 100, 800); using (System.Drawing.Image ImgThnail = new Bitmap(Img,
ThumbNailSize.Width, ThumbNailSize.Height)) { ImgThnail.Save(imgfilepath, Img.RawFormat); ImgThnail.Dispose(); } Img.Dispose(); } imgtakeaway.ImageUrl = ("~/Images/" + FileUpload1.FileName); // assigning the uploaded image url to the image
Page 133
FoodStop
string
cs
// query for inserting the values in the Takeaway1 string insertquery = "insert into Takeaway1 values('" + txtTkID.Text + "','~/Images/" + FileUpload1.FileName + "','" + txtTkName.Text + "','" + txtAddress.Text + "','" + txtArea code .Text.ToUpper() + "','" + txtCity.Text + "','" + DDLOpenTime.SelectedValue + "','" + DDLClosingTime.SelectedValue + "','" + txtDvcharge.Text + "')"; SqlCommand cmd = new SqlCommand(insertquery, con);
try { con.Open(); cmd.ExecuteNonQuery(); } catch (Exception ex) { Response.Write("error" + ex.Message); } finally { con.Close(); }
Page 134
FoodStop
Response.Redirect("AddMenu.aspx"); // when takeaway details are added admin is transferred to the add menu page }
public
Size
NewImageSize(int
OriginalHeight,
int
OriginalWidth,
double
FormatSize) { Size NewSize; double tempval; if (OriginalHeight > FormatSize && OriginalWidth > FormatSize) { if (OriginalHeight > OriginalWidth) tempval = FormatSize / Convert.ToDouble(OriginalHeight); else tempval = FormatSize / Convert.ToDouble(OriginalWidth);
NewSize
new
Size(Convert.ToInt32(tempval
OriginalWidth),
Page 135
FoodStop
Generating News News are first added in the Database and then fetched on the search page in Literal control
protected void Page_Load(object sender, EventArgs e) { // code for fetching the news from database string ConnectionString =
System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionStrin g"].ConnectionString; using (SqlConnection conn = new SqlConnection(ConnectionString)) { using (SqlCommand cmd = conn.CreateCommand()) { cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = "select News FROM News "; conn.Open(); using (SqlDataReader dr = cmd.ExecuteReader()) { int i; string str = " "; for (i = 0; dr.Read(); i++) { str = str + dr.GetString(0)+ " , "+"\n"; } string text = "<MARQUEE><b>" + str + "</b></MARQUEE>";// adding all the news fetched from the news table to the text string variable Literal1.Text = text; // assigning the value of the text variable to the literal control } } } }
Page 136
FoodStop
Searching Takeaway by Area code Response.Redirect("SearchByArea code .aspx?Area code ="+ Encryption.Encrypt(txtsearch.Text.ToUpper())); // redirecting the customer to the SearchByArea code page
When customer is transferred to the SearchByArea code page the Takeaway whose Area code matches are displayed in the repeater control.
List of Takeaways <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [Takeaway1] where
(TakeawayID%2)!=0"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [Takeaway1] where
TakeawayID%2=0"></asp:SqlDataSource>
Session Management
txtSessionID.Text = Session.SessionID.ToString(); // code for changing the session ID values when candidate is finished with the process of ordering and destroying the session values SessionIDManager Manager = new SessionIDManager(); string NewID = Manager.CreateSessionID(Context); string OldID = Context.Session.SessionID; bool redirected = false; bool IsAdded = false; Manager.SaveSessionID(Context, NewID, out redirected, out IsAdded); Session.Remove(Session.SessionID); Session.Clear();
Page 137
FoodStop
Data Security
string insertquery = "insert into Administrator values ('" + txtAdminName.Text.ToString() + "','" +Encryption.Encrypt(txtPassword.Text.ToString()) + "','" +Encryption.Encrypt(txtConfirmPassword.Text.ToString()) + "','"+txtEmailID.Text.ToString()+"')";
txtPassword.Text == Encryption.Decrypt(rdr["Password"].ToString())
//code for placing the order if (e.CommandName.Equals("PlaceOrder")) { HiddenField hidtotal = (HiddenField)e.Item.FindControl("HidTotal"); if (hidtotal.Value == "") { lblmsg.Visible = true; } else { float OrderTotal = float.Parse(hidtotal.Value) + float.Parse(txtDeliveryCharge.Text); Response.Redirect("OrderPage.aspx?Total=" + Encryption.Encrypt(OrderTotal.ToString())); } } // code ends here
Page 138
FoodStop
The above code for encrypting the data was taken and referred from http://www.dotnetspark.com/kb/512-encryption-and-decryption-withquerystring.aspx [23].
protected void btnRecieveDetails_Click(object sender, EventArgs e) { // code for sending the account details on the basis of type of user selected
if (DDLUser.SelectedValue == "Admin") {
// if the type of user selected is admin then following code will be executed
using (SqlCommand cmd = conn.CreateCommand()) { cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = "select AdminName,ConfirmPassword,EmailID FROM Administrator where EmailID='"+txtEmail.Text.ToString()+"'"; conn.Open(); using (SqlDataReader dr = cmd.ExecuteReader()) {
dr.Read(); if (dr.HasRows) {
Page 139
FoodStop
string name = dr.GetString(0); string password = Encryption.Decrypt(dr.GetString(1)); // code for sending account details to the admin via e-mail
try { System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(); message.From = new MailAddress("sharma.rajnikantfoodstop@gmail.com"); message.To.Add(new MailAddress(txtEmail.Text.ToString())); message.Subject = "The Details of your Account"; message.Body = "<h3><u>FoodStop</u></h3>" + "<br>" + "<br>" + "<u>THE DETAILS OF YOUR ACCOUNT ARE HERE:-</u>" + "<br>" + "<br>" + "AdministratorName : " + name + "<br>" + "Password : " + password + "<br>" + "EmailID : " + txtEmail.Text.ToString() + "<br>"; message.IsBodyHtml = true; SmtpClient client = new SmtpClient(); client.EnableSsl = true; client.Send(message); } catch { Response.Write("sending failed...there might b a connection problem in your internet....plz try in few minutes!!!"); } //code for e-mail ends here Response.Redirect("LoginAdmin.aspx"); } else {
Page 140
FoodStop
Response.Write("Admin with this EmailID Don't Exists"); } } } } } if (DDLUser.SelectedValue == "Customer") { // if the type of user selected is cutomer then this code will be executed string ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionStrin g"].ConnectionString; using (SqlConnection conn = new SqlConnection(ConnectionString)) { using (SqlCommand cmd = conn.CreateCommand()) { cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = "select EmailID, ConfirmPassword , Name FROM Customer where EmailID='" + txtEmail.Text.ToString() + "'"; conn.Open(); using (SqlDataReader dr = cmd.ExecuteReader()) { dr.Read(); if(dr.HasRows) { string name = dr.GetString(2); string password =Encryption.Decrypt( dr.GetString(1)); // code for sending account details to the customer via e-mail try { System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(); message.From = new MailAddress("sharma.rajnikantfoodstop@gmail.com");
Page 141
FoodStop
message.To.Add(new MailAddress(txtEmail.Text.ToString())); message.Subject = "The Details of your Account"; message.Body = "<h3><u>FoodStop</u></h3>" + "<br>" + "<br>" + "<u>THE DETAILS OF YOUR ACCOUNT ARE HERE:-</u>" + "<br>" + "<br>" + "Customer Name : " + name + "<br>" + "Password : " + password + "<br>" + "EmailID : " + txtEmail.Text.ToString() + "<br>"; message.IsBodyHtml = true; SmtpClient client = new SmtpClient(); client.EnableSsl = true; client.Send(message); } catch { Response.Write("sending failed...there might b a connection problem in your internet....plz try in few minutes!!!"); } //code for e-mail ends here
Response.Redirect("LoginAdmin.aspx"); } else { // if customer with the entered e-mail Id don't exists display this message
Page 142
FoodStop
Subscription // below one is the code for selecting the emailID of all the customers from customer table who are subscribe for receiving e-mail
<script language="javascript" type="text/javascript"> function numbersonly(myfield, e, dec) { var key; var keychar; if (myfield == "") { Error = " Please enter your phone number."; } if (window.event) key = window.event.keyCode; else if (e) key = e.which; else return true; keychar = String.fromCharCode(key); // control keys if ((key == null) || (key == 0) || (key == 8) || (key == 9) || (key == 13) || (key == 27)) return true; // numbers else if ((("0123456789").indexOf(keychar) > -1)) return true; // decimal point jump else if (dec && (keychar == ".")) { myfield.form.elements[dec].focus(); return false;
Page 143
FoodStop
} else return false; } function noSpace(e) { if (e.keyCode == 32) return false; //return true; } </script> The above code for phone number validation was taken and referred from
http://www.webdesign.org/html-and-css/tutorials/all-about-forms.6138.html [25].
PayPal Feature
//code for transferring to the paypal account starts here string iName = "Food Ordered"; string responseURL = RedirectToPaypal.getItemNameAndCost(iName, txtTotalAmt.Text); Response.Redirect(responseURL); //paypal code ends here
Code of RedirectingtoPayPal.aspx.cs
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts;
Page 144
FoodStop
/// <summary> /// Summary description for RedirectToPaypal /// </summary> public class RedirectToPaypal { public RedirectToPaypal() { // // TODO: Add constructor logic here // }
/// <summary> /// This Method returns /// </summary> /// <param name="itemName"></param> /// <param name="itemCost"></param> /// <returns></returns> public static string getItemNameAndCost(string itemName, string itemCost) {
//Converting String Money Value Into Decimal decimal price = Convert.ToDecimal(itemCost); //declaring empty String string returnURL = ""; returnURL += "https://www.paypal.com/xclick/business=bangarubabu.p@gmail.com"; //Passing Item Name as dynamic returnURL += "&item_name=" + itemName; //Assigning Name as Statically to Parameter string fname = "Raghunadh Babu"; returnURL += "&first_name" + fname;
Page 145
FoodStop
//Assigning City as Statically to Parameter string myCity = "Hyderabad"; returnURL += "&city" + myCity; //Assigning State as Statically to Parameter string myState = "Andra Pradesh"; returnURL += "&state" + myState; //Passing Amount as Dynamic returnURL += "&amount=" + price; //Passing Currency as your returnURL += "¤cy=USD"; //retturn Url if Customer wants To return to Previous Page returnURL += "&return=http://bangarubabupureti.spaces.live.com"; //retturn Url if Customer Wants To Cancel the Transaction returnURL += "&cancel_return=http://bangarubabupureti.spaces.live.com"; return returnURL;
Response.Redirect("http://www.facebook.com/pages/FoodStop/14330516573170 9");
Page 146
FoodStop
fetching the news from the database and displaying on Search page protected void Page_Load(object sender, EventArgs e) { // code for fetching the news from database string ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionStrin g"].ConnectionString; using (SqlConnection conn = new SqlConnection(ConnectionString)) { using (SqlCommand cmd = conn.CreateCommand()) { cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = "select News FROM News "; conn.Open(); using (SqlDataReader dr = cmd.ExecuteReader()) { int i; string str = " "; for (i = 0; dr.Read(); i++) { str = str + dr.GetString(0)+ " , "+"\n"; } string text = "<MARQUEE><b>" + str + "</b></MARQUEE>";// adding all the news fetched from the news table to the text string variable Literal1.Text = text; // assigning the value of the text variable to the literal control } }
} } The code for displaying the news in marquee was referred from http://forums.asp.net/p/1255316/2331625.aspx [56]
Page 147
FoodStop
Steps to be executed For Blank Login 1) Keep both the Username and Password field empty 2) Click on Login Button. Expected Result Validation Messages: Please enter Admin Name , Please enter Password Successful Remarks Yes The test was successful and admin cant login with the empty field. Table No: - 18 Test Case ID Purpose Test for the features FS002 Adding Takeaway Takeaway1 and Items table in Database
Steps to be executed 1) Enter all the fields in Add Takeaway Page. 1) Enter Menu Items. 2) Check Takeaway Page of the New Takeaway added. Expected Result Takeaway will be added with all the menu items listed properly. Successful Remarks Yes The test was successful and dont require any change.
* The above test case proves that Database and Page are well connected and there is no need to change it.
Page 148
FoodStop
Table No: - 19 Test Case ID Purpose Test for the features FS003 Checking News Headline on Search Page. Literal Control used for displaying News.
Steps to be executed 1) Generate any News on Admin Side. 2) Logout from Admin Side. 2) Checkout Search Page. Expected Result Successful Remarks News will be added and displayed as it is. Yes News is added but there is extra , symbol at end of news.
Table No: - 20 Test Case ID Purpose Test for the features FS004 Checking the total amount of selected/deleted items. Values below Your Order on Takeaway Page.
Steps to be executed 1) Go to the Takeaway Page. 2) Select items and Delete some of the added items. 3) Checkout the total that comes manually. Expected Result Successful Remarks Total will be accurate. Yes No change required
Page 149
FoodStop
Table No: - 21 Test Case ID Purpose Test for the features FS005 Check Invoice Sending Script via Email sharmarajnikantfoodstop@gmail.com
Steps to be executed 1) Select order 2) Select Mode of Payment. 3) Place the Order. 4) Check the E-mail Account which was entered while registering as a customer. Expected Result E-mail should be sent and customer should be transferred to Search Page if Mode of Payment selected is cash else redirect him to PayPal Account. Successful Remarks Yes The test was successful but the Format of Ordered Items when it is passed to e-mail script needs to be changed.
Page 150
FoodStop
APPENDIX N - Errors/Solution
Table No: - 22 Error No Error EN001 Both DataSource and DataSourceID are defined on 'Repeater1'. Occurrence When you try to fill GridView or DetailsView both by code in (.cs file) and in Design (.aspx file) this error occurs Solution If you want to do the same thing then DataSourceID should be defined only once either in .cs or in .aspx i.e. Remove one definition. Website Referred [33]
Table No: - 23 Error No Error Occurrence EN002 Must declare the scalar variable '@TakeawayID' When you are using query with data controls if after where @ with Condition and DatakeyName is not specified Solution Specify the DatakeyName value and where condition with @ as Prefix Website Referred [34]
Table No: - 24 Error No Error Occurrence Solution Website Referred EN003 Incorrect syntax near the keyword order The above error occurs when query is not well formed Query was formed again and the problem was solved [35]
Page 151
FoodStop
Page 152
FoodStop
Table No: - 25 Error No Error EN004 System.IO.FileNotFoundException:C:\ProgramFiles\Common Files\Microsoft Shared\DevServer\10.0\1.PNG Occurrence The above error occurs when file uploading is used in any other browser. Solution Website Referred Unsolved [36]
Table No: - 26 Error No Error Occurrence Solution Website Referred EN005 Invalid column name When column with the column name specified dont match Column name was changed [37]
Table No: - 27 Error No Error EN006 The file "U:\FoodStop\App_Data\FoodStopDatabase.mdf" is on a network path that is not supported for database files. An attempt to attach an auto-named database for file U:\FoodStop\App_Data\FoodStopDatabase.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. Occurrence When accessing the source from U drive because .mdf files cannot be accessed by visual studio over a network Solution Website Referred Running the project directly from USB Stick [38]
Page 153