Computing and Informatics Department
AY ______ / _______ Semester 1, 2 (Fall, Spring)
CAPSTONE PROPOSAL SUBMISSION FORM
Project type :
Individual
Group
Student Name(s):
(for group assign leader)
Student ID(s):
Proposed Title:
1. Problem Statement :
2. Aim & Objectives:
3. Methodology
4. Outline of the Analysis/Chapters (Case Study/ Software / Hardware )
(describe in short include Hardware/software requirements)
Student
Name(s)
Signature
&
(All participants must sign)
Supervisor
Name
&
Signature:
Date:
This form should be submitted to Supervisor.
FOOD CORNER
A PROJECT REPORT
Submitted by
Alaa Mohammed Alyafei
Under the guidance of
Dr. M.S.Saleem Basha
In partial fulfillment for the award of the degree of
BACHELOR
In
IST
MAZOON UNIVERSITY COLLEGE
(Affiliated with the Missouri University of Science & Technology, USA)
Sultanate of Oman
www.muc.edu.om
December 2018
1
BONAFIDE CERTIFICATE
Certified that this report Food Corner is the bonafide work of Alaa
Mohammed Alyafei (ID: 1625515) who carried out the seminar under my
supervision. Certified further, that to the best of my knowledge the work reported herein does not form part of any other report or dissertation on the basis of
which a degree or award was conferred on an earlier occasion on this or any other candidate.
SIGNATURE
Dr. Mohammed Dayan
Supervisor
Assistant Professor
Department of CS & IT
Mazoon University College
Muscat
2
SIGNATURE
DR. A. Mohammed Abbas
HEAD OF THE DEPARTMENT
Assistant Professor
Department of CS & IT
Mazoon University College
Muscat
CERTIFICATE OF APPROVAL
The entitled Food Corner submitted by Alaa Mohammed Al Yafei (ID:
1625515) is hereby approved as credible study of topic and has been presented in satisfactory manner to warrant its acceptance as prerequisite to the degree for which it has been submitted. It is understood that by this approval,
the undersigned do not necessarily endorse any conclusion drawn or option
expressed therein but approve the thesis for the purpose for which it is submitted.
EXAMINER
3
Signature
:
Name
:
Date
:
TABLE OF CONTENTS
TITLE
Chapter 1: Introduction
1.1 Food Corner
1.2 Motivation
1.3 Problem Statement
1.4. Objectives:
1.5 Scope
Chapter 2: Fundamental Concept and Literature Review
2.1 Fundamental Concept and architecture
2.2 Term Definition
2.2.1 ASP.NET
2.2.2 Visual Studio
2.2.3 SQL Server Data Tools
2.2.4 Display List:
2.3 Purpose
2.4 Software Requirements
2.4.1 Software Requirements
2.4.2 Functional Requirements
2.4.3 Non-Functional Requirements
2.4.3.1 Security
2.4.3.2 Usability
2.4.3.3 Performance
2.4 Previous studies
2.4.1 We For Serve
2.5.2 Riyadh Book Fair
2.5.3 Frankfurt Book Fair
Chapter 3: System Design
3.1 System Design
3.2 Use case Diagram
3.3 Database table Design:
Chapter 4: Implementation
4.1 system Implementation
Chapter 5: Conclusion
5.1 Conclusion and future Enhancements
REFERENCES
APENDICES- System code
4
PAGE NO.
7
8
10
10
11
12
13
13
14
14
14
15
15
15
16
20
20
20
20
20
20
22
24
26
27
29
31
42
42
43
44 - 49
LIST OF FIGURES
FIGURE NAME
5
PAGE NO.
Figure 1.1: Number of Muscat International book fair visitor in according years
8
Figure 1.2: Number of Muscat International book fair publisher in according
years
Figure 2.1 Simple ASP.NET
9
13
Figure 3.1: system diagram
26
Figure 3.2 :Use Case Diagram (Admin)
27
Figure 3.3 :Use Case Diagram (User)
28
Figure 4.1: Home Page
31
Figure 4.2: Contact page
32
Figure 4.3: Search page
33
Figure 4.4: Search Book page
33
Figure 4.5: Search Publisher page
34
Figure 4.6: Request page
34
Figure 4.7: All Book page
35
Figure 4.8: All Publisher page
35
Figure 4.9: Admin (Login ) page
36
Figure 4.10: Admin page
37
Figure 4.11: Adding Book page
38
Figure 4.12: Adding publisher
39
Figure 4.13: View Request Book page
39
Figure 4.14: Delete Book page
40
Figure 4.15: Delete Publisher page
40
Figure 4.16: Activities page
40
LIST OF TABLES
TABLE NAME
6
PAGE NO.
Table 1.1: Number of Muscat international book fair visitor and publishers
in according years
Table 3.1 Admin login table
29
Table 3.2 Book Entry table
29
Table 3.3 Contact table
29
Table 3.4 Publisher table
30
Table 3.5 Request book table
30
9
LIST OF ABBREVIATIONS
7
URL
Uniform Resource Locator
ASP.NET
Active Server Pages
IDE
integrated development environment
SSDT
SQL Server Data Tools
GUI
Graphical user interface
LBF
London book fair
IDE
Integrated development environment
RSS
Really Simple Syndication
Chapter 1: Introduction
1.1 Food Corner
Food Corner is list out the Restaurants in Oman including contact details and direct link
to their own website. It is as a group of online pages which are linked to each other and sorted on
the same server. The user can visit the website across the internet by online serves and through a
web browser. It can be developed in futures to display by the mobile phone via WAP technology.
There is in the online system website page displays the content of that page. Also contains
hyperlinks to pages or to pages of the website in the online system. Each web page in it resources is known (URL), which is an abbreviation for "Uniform Resource Locator".
The major aim of the online system is to show list of Restaurants inside Oman in its website. The user can enter the website system by a certain measured resources researcher replication resources (URL) and it is written in the address bar in the web browser. In this website there are a list of all Restaurants and Contact details, gallery, direct website link URL,
download Menu and it shows details about all of them. The website serves for all the foodies those who want to search as per their choice. And it produces a search functionality, they
study activities of rivals and providing updated details and contacts. In Oman there have
people from different nationalities. But many of them don’t have idea about the type of restaurant and location as per their choice. Food Corner can list out many nos of entries which
can choose from it. Many of them are using websites to advertise their plans and the importance of such events, Special Foods and Gallery. The Food Corner offers group of services that serve many side:
❖ Any User can see all Restaurants and its details.
❖ Any User Can Download Menu of the selected Restaurant.
❖ Any User can view selected Restaurant Gallery.
❖ Any User can navigate to selected Restaurant website from direct link
❖ Any User can fill their comments and support request if need.
❖ Administration: the manager of the system can:
❖ Can Enter details of the Restaurants from a Admin Screen
8
1.2 Motivation
The
Internet
and
the
Web
as
an
extraordinary
technology
unleashing
the
human creativity, innovation, expression. On a large scale the Internet allows
hundreds of millions of People to interaction with websites, e-mail, Facebook,
Twitter, and Google (All verbs that are new to our age, the Internet Age).
We note that the number of visitors to international book fairs annually is increasing significantly, for that reason the visitors needs more services especially
an application or system to help them in searching about a books or publishers in
the book fair place and this will save the time taken in searching, the effort instead of previous traditional system (manual system).
For Example the Muscat International Book Fair is among the best 10 book fairs
at the Arab level and one of the top three fairs at the Gulf level in terms of the
number of visitors and publishers, The latest statistical data shows increasing
in number of visitors and publishers houses annually (2015-02017) as shown
in figure 1.1 And figure 1.2., Table 1.1: [1]
Figure 1.1: Number of Muscat International book fair visitor in according years
9
Figure 1.2: Number of Muscat International book fair visitor in according years
Description
Visitors
Restaurants
2015
2016
2017
772655
635242
704912
476
492
498
Table 1.1: Number of Muscat international book fair visitor and publishers in according years
1.3 Problem Statement
Despite such valuable kind of success in the days of technological improvement
and daily progress, the presence of many factors of failure has given the way
for users and owners to speak about things that they fail to attend using such a
way. In addition, it also needs many manual things such as: 1- Total reliance on traditional means of communication. Such as (website –
phone) all correspondence between the users and Owners.
2- To make more of efforts in the process of calculating the financial uses of
participants and that is not easily managed.
10
3- Exchange a lot of money while doing operations manually, such as (advertisements –
registration from, lists of restaurants from the website.)
4- Distribution of the map of exhibition manually for visitors to know sectors
which makes it difficult to find easily in a short time (brochures).
5- Non- availability of types of events and dates set up in the exhibition, also to
lack some books lists of prices for visitors and publishers.
There are many challenges of this project, but it is very important way to develop to digital changes instead of traditional ways to get easily service that provided by book fair.
1.4. Objectives:
The Food Corner becomes very necessary for the people those who are very new In
Oman and its modern reflecting the importance of the project.
❖ It can give all details that the Restaurants all over Oman and all users can
Leave their comments about the website.
❖ This website saves the time and effort.
❖ Able to download the menu, Navigating to individual website as per the selection
❖ The possibility of starting work in the control of websites to find out appropriate
place as per our own choice after the introduction and adoption by the Food Corner directly in one place, which saves a lot of time?
❖ This website views complete details directly online.
❖ To give people to find and buy direct they might want.
❖ To active the electronic search engine about Restaurants so the users enable find location.
❖ To design a system able to respond for Users.
❖ To provide a lot of time and satisfaction to the users.
11
❖ Increase Marketing via website.
1.5. Scope
Food Corner is list out the Restaurants in Oman including contact details and direct link
to their own website. In this website there are a list of all Restaurants and Contact details, gallery, direct website link URL, download Menu and it shows details about all
of them. The website serves for all the foodies those who want to search as per their
choice. And it produces a search functionality, they study activities of rivals and
providing updated details and contacts. I n Oman there have people from different nationalities. But many of them don’t have idea about the type of restaurant and location
as per their choice. Food Corner can list out many no’s of entries which can choose
from it. Many of them are using websites to advertise their plans and the importance
of such events, Special Foods and Gallery. The Food Corner offers group of services
that serve many side: By implementing Search Engine Optimization(SEO), Food Corner will be the first searched item to find out Restaurants in Oman.
12
Chapter 2: Fundamental Concept and Literature Review
2.1 Fundamental Concept and architecture
My system is a website. In this system there are a list of all restaurants all over
Oman and it shows details about all of them. The system serves both visitors and restaurants and it produce a search functionality, it also offers online ordering via connecting
to their individual websites. The system also helps to study activities of rivals and examine
recent market trends and opportunities. There are many nos of restaurants shows around the
Oman and many of them are using websites to advertise their plans and the importance of such
events.
The Food Corner fair system offers group of comprehensive services that serve the following
sides at one time which are:
❖ Normal visitor or user:
Who visit the website without login this visitor can: See all restaurants and their details, see all restaurants and their details, address and download the menu, search about any restaurants they want,
book fair's visitors and users can order online by connecting direct website from Food Corner link
❖ Administration:
The manager of the system and he/she can:
See all restaurants details, delete restaurants, enter restaurants, Make reports about the system.
2.2 Term Definition
2.2.1 ASP.NET:
ASP.NET a platform for developing Web-based applications. It lets you
create sophisticated Web applications that can interact with users. For example, ASP.NET
applications can use data-entry controls (such as text boxes and buttons) to accept input
data from a user; process, retrieve, or update Database data; and send the results of these
operations back to the user. ASP.NET isn’t the only platform available for creating
13
Web applications. Popular alternatives to ASP.NET include PHP, ColdFusion, and several Java-based tools such as Java Server Pages and Java Servlets. ASP.NET Differs from
these alternatives in several significant ways. One of the best features of ASP.NET is
Visual Studio, the integrated development environment that combines a Web-page editor, a code editor, a debugger, and several other development tools into one easy-touse program. The more you work with Visual Studio, the more you come to appreciate
the many ways it simplifies the job of creating ASP.NET Web applications. [2]
Figure 2.1 Simple ASP.NET
2.2.2 Visual Studio:
Microsoft Visual Studio is an integrated development environment (IDE)
from Microsoft. It is used to develop computer programs, as well as web sites, web
apps, web services and mobile apps. Visual Studio includes a code editor supporting IntelliSense (the code completion component) as well as code refactoring. The integrated debugger works both as a source-level debugger and a machine-level debugger. Other
built-in tools include a code profiler, forms designer for building GUI applications,
14
web designer, class designer, and database schema designer. It accepts plug-ins that
enhance the functionality at almost every level—including adding support for source
control systems (like Subversion) and adding new toolsets like editors and visual designers for domain-specific languages or toolsets for other aspects of the software
development lifecycle. Visual Studio uses Microsoft software development platforms such as Windows API, Windows Forms, Windows Presentation Foundation,
Windows Store and Microsoft Silverlight. It can produce both native code and managed code. [3]
2.2.3 SQL Server Data Tools (SSDT):
SQL Server Data Tools (SSDT) provides project templates and design surfaces for building SQL Server content types — relational databases, Analysis Services
models, Reporting Services reports, and Integration Services packages. It's based on a
Visual Studio shell and co-released with SQL Server. New versions of SSDT integrate
the latest features of SQL Server. Older versions include the templates and design environment that were current for that release. SSDT is backwards compatible, so you can
always use the newest SSDT to design and deploy databases, models, reports, and packages that run on older versions of SQL Server [3]
2.2.4 Display List:
A display or exhibit of restaurants typically by a group restaurant owner for
promoting sales and stimulating interest. The main aim of Food Corner is to save time and
effort to have satisfied food as per their own choice. To find all the details from under a single environment is not a small thing.
2.3 Purpose
The Food Corner website purpose is to give easy way that help people to see
the list of restaurants that all over Oman ,the restaurants that entered in the website ,
the location of the restaurant , contact details so this will save the time instead
of long searching for restaurants
15
as per our choice and wasting time, It also
helps visitors to the exhibition to see the menu of restaurants and to download
menu reduce t i m e and exaggeration in prices,. Also help the restaurant t o promote their firm and they increase sales and excellent marketing for too, so I design and perform this website for development purposes of restaurants in Oman for
the next years that we can use it from any place.
2.4 Software Requirements
2.4 .1 Software Requirements:
• Operating System windows 8 or any latest version of Windows.
• Visual Studio 2017
• ASP.NET – 2017
• SQL Server Database 2014
Also, you should be running one of the following browsers:
• Internet Explorer
• Firefox
• Chrome
In this section, I will clarify the requirements of the new system. Will be clarification on two
sides and that are: the functional requirements (system tasks - input and output) and
non-functional requirements (software).
2.4.1 Functional Requirements:
Admin Login Form:
❖ Input
o
Username
o
Password
❖ Output
If the username defined as an Admin, the web page will redirect to administration page.
16
The Admin must log out to allow him to login again with another username
❖ Description
o
The login form will compare the username and password with the
database that are already stored
o
If the compression was matched than the Admin will be able to go to next page to admin
istration page (management).
o
If the compression was not matched than the error massage will appears
Admin Logout page:
❖ Input
o
User login.
❖ Output
o
Remove all user information and cookies.
❖ Description
o
When the user finishes his session he/she can exit from the system.
Add Restaurants:
❖ Input
o Restaurant Name
o Description
o Lunch (Weekdays)
o Lunch (Weekends)
o Dinner
o Contact No
o Restaurant Address
o Address 2
o Address 3
o Land Mark
o Email
17
o Manager Name
o Manager Contact
o Manager Email
o Website URL
o
Type of Restaurant
o
Menu
o
Gallery Items
❖ Output
o
Store the Restaurant information in the database
❖ Description
o
The Admin add the Restaurant information.
o
That information will store in the database
Search page:
❖ Input:
o
Search by book Restaurant name
❖ Output
o
Results table from the database
❖ Description
o
Any User of the website can search about books by writing Restaurant name
Show all Restaurant
❖ Input:
o
Restaurant in the database
❖ Output
o
All Restaurant
❖ Description
o
Contact Page
❖ Input:
18
Any User of the website can see about Restaurant by writing Restaurant name
o First Name.
o Last Name.
o E-mail.
o Message.
❖ Output
o
E-mail the message to the Admin.
❖ Description
o
Any User of the website can send a message to contact the website
Administration
2.4.3 Non-Functional Requirements:
2.4.3.1 Security:
This system should be on the high level of security to provide protection for
sensitive information (such as account numbers and passwords). It should be provided a secure
Admin login system. The admin must have a secured username and password to be able to manage the system. All password must be encrypted
2.4.3.2 Usability:
This system should be designed simply so that users can feel the new online system very
easy to use and not complicated. All designs should be according to guidelines known each
text box, text, and buttons should be visible to users
2.4.3.3 Performance:
Food Corner Website should be fast, and the users should not feel that it is very slow in any
time
2.5 Previous studies:
I have searched on similar projects as it is the way to find out some more ideas
19
about other people experiences in that field. Moreover, the researcher gathers important
points, good ideas which can be used in the project.
Website is the title of the institution across the world. It is the crossing on
activity of the organization and responsible for the formation of a mental image of the
courses of action. It provides a lot of effort and money the media continue to allow accurate and fast, which is the future of media and business process. Hence came the idea
of creating websites for book fairs organized by the states, and we'll show you the pros
and cons and the programming language for the electronic three sites are as follows:
1
We for Serve.
2
Trivago.
3
Open Table.
2.5.1 We For Serve
The We for Serve is a service website to give all the data about one place. It is not only for
Restaurants, also for all the Enquiry. It is a new kind of industry using technology available
throughout the world.
Advantages the London book fair
There are Many Advantages for We for Serve as follows: 1. Collaborating Many Firm with We for serve. Gym, Restaurant, Beauty Parlor. etc.
2. They Give All the Information to the users.
The We4Serve is shows dates the Map, contact Details and all other contact information through their website. The advantages of We4Serve It is also proved the useful links
for visitors to use the useful links. There is register form In the We4Serve the visitors can
used, the registrar form be for they are going to visit the We4Serve which, they can fill the
register form by the useful information.
Also, the advantage of the We4Serve There are a number of useful links on the
site that will help the viewer in order to be successful, including instructions and useful tips, care and Gateway exhibitors. - Help displays the frequently asked questions
20
about the show dates and place of residence and visa requirements. - There are tips useful tips for Marketing about what he can do while in the exhibition gallery in order to be
successful. - Acre site offers a number of exhibitors from care packages and also the opportunities that will maximize the joint brand of your year-round. - Gateway exhibitors
that will displays details Profile bidder and update the company on the Internet and possible add content and documents, as well as upload photos, videos. In addition, there
are in the exhibition search engine that it.
The contractor Reg is considered as advantage for visitors and exhibitors in
We4Serve. Which, it makes the contact between them easier and to register as stand
build contractor at LBF. This information has been registered that, they will give access
to stand build regulations and other information. S o , exhibitors will also contact with
the contractor Reg directly to discuss stand plans and other important matters and
this information will be passed to We4Serve official contractors.
Also, the login in the London book fair is important by creating an account on
We4Serve and adding its features. In addition, the user will have directory to get prepared
for the event We4Serve and this is a very quick and simple process for user.
However, The We4Serve provides the customer serves helping for visitors and
exhibitors, and it is very important for them, if they have any question regarding their
participation at We4Serve by e-mail, phone number, We4Serve sales Team, We4Serve
operations Tear and other information about exhibitors.
The London book Fair is considered website passed because it provides information about the Venue &Travel of London for example address of We4Serve place,
hotel booking desk, travel information, weather, tourist information guides and provide
the information that they need to know about acumination for entering the UK and visa
requirements.
The London book Fair it displayed most of social media such as: face book, Twitter, linked in, YouTube, and flicker. They are very important because they introduce the
latest innovation and technologies around the site, In addition to that it displays advertisements and events held in the exhibition, making it easier to communicate with the visitor
exhibitors and users
21
Disadvantage the London book fair
There are four disadvantages of We4Serve which they can evict in the coming years.
First, Robots text 3file: There is no robots text file in this website the one which can
control visitors search. This website because it is really helpful to create one in order to improve their website guide at process. Third one, RSS feeds. RSS stands for "Really Simple Syndication". By this technology the website updates/posts reach automatically to anyone who is following the website posts via an RSS reader program, mobile
app or website. And the programmers can get the website feeds easily to build their
systems. Fourth, in the London book fair used the English language Document and it is
consider as disadvantage of Londonbookfair.co.uk because there are 25,000of visitors
from 110 different countries and some of them face problems to understand and search of
what they want.
The programming language used on this site (We4Serve) is a language (ASP) because it is easier and faster to use, and a few problems, also it is the most secure option for
organizations and companies.
2.5.2 Trivago
2.5.3 Advantages of Trivago.
1. Of the positives of the show is different travel Diary meet in one place and user can find
what he wants from several Travel Diary websites.
2. Website design where there is on transaction or exit links direct from page to another
page where it is necessary to return to the home page to enter another address or other link.
3. Images and Details offered by the Team is limited to hotels represent certain directions
without the rest of the hotels to be correct and this offers a comprehensive.
4. The public can visit the exhibition through their mobility electronically without the need
to go to the show and cut long distances and use the time to search and wander in the dry
parts of the exhibition and other activities to identify in it and in record time
5. The audience can visit the exhibition via the website in any day to day time they
want without allocating specific days and times, whether for men or women.
22
6. The public can follow, Restaurants, various activities held in the celebration time with-
out the need to attend at the same time.
7. Was replete with rare and new publications and found a broad response of visitors
from home and abroad and found extensive media coverage.
Disadvantage Trivago
1. There is no page Active to receive feedback and suggestions of visitors and publishers
or facilitate direct communication with them
2. Map showrooms complex and difficult for the public to get to the desired location
or publishing house required.
3. Active slow speed work where required from the reader or visitors to do too many steps
to get to the site or the book you want and headlines Active forest by many need a long
time.
4. But from the negatives here that the r-reader cannot express his opinion and offer
his proposals directly.
5. Over the discipline and compliance with laws and regulations in this show, so
it was a criticism severe, and the charges are distributed here and there, especially with the release of statement from some officials about the presence of some of
the bugs in the organization.
6. And It is not only concentrating on one place. It is for all over.so the coverage of Restau-
rants might be less
2.5.4 Open Table
This is where you'll find such a kind of training and networking. I t is the website that
helps visitors easily search and register for get info while travelling. This is a place that will give
you a lot of things to see and read. The OpenTable is the home to a wide variety of interesting
places that we can have Food. This OpenTable website is where you can find the collective
stand, the marketplace for Stationery & Gifts, and other exhibitors in the gifts and stationery section
23
OpenTable acquired Foods potting in 2013, not only for its amazing content, but also for its incredibly loyal and engaged community. Since then, you’ve been instrumental in how friends and
experts alike discover the best dishes across the world
Advantages of the OpenTable:
But as the saying goes, all good things must come to an end. After much deliberation, we have chosen to discontinue the Food spotting app and website in early May. If
you’d like to keep all the photos you’ve captured over the years, we encourage everyone to
take this opportunity to download your content
There are plenty of good reasons that helps visitors and dealers to use the site. This
is where you'll have a lot to see and to experience that many good reasons for you to
travel to Frankfurt through a simple contact with fair site. IT brings you face to face
with the ideas, topics and trends that are moving the industry. From new titles to new
technology and data to deals, the Frankfurt Book Fair opens up a world of opportunities
for all those interested in shaping the future of the media industries. You can find
the answer to everything "The Answer to Everything, in the hall for education, STM,
Academic Publishing and Specialist Information. How will it transfer knowledge digitally
in the future? Which business models will play a role? What will the classroom of the future look like activities in Frankfurt focus on the rights trade? It shows you how you can
make the most optimistic way for your own business
Disadvantages of Frankfurt book Fair:
Website Design is not attractive. By Look it will not capture our eye. The information transition becomes an evolutionary in the sense of leaps and bounds as humans so
there is no longer painting on cave walls. This is linked to the development of the
first documents of the middle Ages in late. Today, technology has provided a lot by the
big jump from black and white to a new and amazing website. So here we can ask a
question which is what is a website exactly mean? 20 Online Book Exhibition System
24
Chapter 3: System Design
3.1: System Design
Figure 3.1: system diagram
25
3.2 Use Case Diagram
26
Figure 3.2 Use Case Diagram (Admin)
Figure 3.3 Use Case Diagram (User)
27
3.3 Database table Design:
Table 3.1 Admin login table
Table 3.2 Restaurant Master
28
Table 3.2 Restaurant Image Detail
4
29
Chapter 4: Implementation
Implementation of the system is the most important stage in any project. The project
should be implemented in order to use it and benefit from it. This section will identify and
explain the functions of the system with the screen shot of each page and a description of each
section. I have user a complete 3 tire architecture in this project. Also, I have used procedures in
SQL.
Home Page:
The below figure shows the home page of the system. It has small description of
the system and its services. Home page also represent the master page ASP.NET
master pages allow you to create a consistent layout for the pages in your application. A single master page defines the look and feel and standard behavior that you
want for all the pages (or a group of pages) in your application) it also contains a
menu that applies to all pages.
Figure4.1: Home Page
30
Restaurant List
This page shows all the list of Restaurants and basic i n f o r m a t i o n from the
database (Restaurant name, Contact No, Location, Type). Also, there have a
link to select and it navigating to its detail page. All user can view the list. There
have 3 links to navigate to this page. One from banner. Then from Home page
contend also from main menu.
Figure4.2: Restaurant List
Restaurant Detail.
It is the detail page for each restaurant. It is individual detail for each restaurant. In this
page will get a small description about the restaurant and working time, contact details. The
main attractive of this page is to possible to download menu. Also, we will have a small
Gallery which will help user to find the seating arrangements and atmosphere of the restaurant .
31
Figure4.3 Restaurant Detail
32
About
This is a page for a brief about Food Corner. In this page included Food Corner Team too. It
shows the interaction with the users
Figure4.4 About
Contact Us
This page for any user visit the website. The user can send an e-mail for website
administration by typing his first name, last name, email and his/her message. And
other contact details which like phone no, address, location and email also included.
33
Figure4.5 Contact Us
Login
This is very important page in the website, for the administration users.
They can add and remove Restaurants. And show a list of Restaurants. This
page contains a login form for Admin. In the login form the user can write his
username and password. The password will have sent encrypted and compared
with database. The user must enter both correct username and password to
enter the system. Then after successful access or login the
34
Figure4.6 Login
Add Restaurant.
This is the admin page to add restaurants.
35
36
Figure4.7 Add Restaurant.
Chapter 5:
Conclusion and Future Enhancements
The main objective of the project was to develop a new web site for list out the restaurants in Oman. This system allows the visitors to show all restaurants details that available in
the website. And the user can find the exact location and the type of restaurant instead going and
searching this can save time and effort. Also, there is an administration to manage the website,
the system also allow administrator to add the restaurants, view the list of restaurants and apply the order, making report. The system also provides a view of activities and event provide by restaurants. It navigates to the individual websites of selected one and it helps to order
online also, I have set goals that I want to achieve and the Expected problems they may face
during implementation. Then I have many of the research in different fields such as: similar
projects, the development of tools. Then I focused on the requirements of the system and I
have identified, and I have created a set of charts to facilitate the work later. Finally, been com37
pleted implementation of the system, and the system has been tested to prove that the new system
works well.
The future enhancements for the system after the project is completed in my
opinion are very important and recommended to development any system or project. The
system is very flexible in terms of expansion, so we must enhance this system to make it
better. There are many plans that make the system much better such as: Develop it to become application and can be easily displayed by the mobile phone via WAP technology
and offering purchase ability for any book with free/cost shipping applied advanced
payment methods such as visa card and other new techniques. Translation into other
languages especially Arabic language, also implementation of SEO (Search Engine Optimization) will help to increase the no of visitors of the website. If the type Restaurants
in Oman it will show first The Food Corner Link. Also, we can add google adds. This
also will help as a income as well as promotion for the restaurants. On-line help also the
development team can make a new function or page to read a draft or description of Restaurants. In this project I have learnt how to follow SDLC life cycles to complete the project. Also, I learnt how to research on different areas, and how to gather the requirements
of the system using different ways like interview, meeting and other ways, also I learned
how can solve a problem using different methods develop my designing skills. I hope
this system help people save time, efforts and money.
References
1. Ministry of Heritage & Culture, Annual Bulletin of Heritage & Culture Statistics, Date
2.
3.
4.
5.
6.
7.
38
(2013-2015), fourth Edition 2016.
Doug Lowe, Jeff Cogswell and Ken Cox,Microsoft, “ASP.NET 2.0 - A L L - I N - O N E
D E S K R E F E R E N C E – FOR Dummies. 2006. Page 9.
https://docs.microsoft.com
IPA, the Future of Book Fairs an IPA Special Report- 27th January 2015
http://www.londonbookfair.co.uk
www.riyadhbookfair.org.sa
https://www.buchmesse.de/en/
SYSTEM CODE
Master Page (Restaurant.master)
p.a {
font-family: "Times New Roman", Times, serif;
}
p.b {
font-family: Edwardian Script, sans-serif;
}
.sweetest_ride {
color: white;
float: none;
font-family: "Raleway', sans-serif";
}
.slider-area {
font-family: 'Raleway', sans-serif;
height: 100%;
width: 100%;
position: relative;
font-weight: 900;
color: #fff;
}
Food Corner a Hotels and Restaurants
addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); }
39
$(document).ready(function () {
$("#owl-demo").owlCarousel({
autoPlay: 3000, //Set AutoPlay to 3 seconds
autoPlay: true,
items: 4,
itemsDesktop: [640, 5],
itemsDesktopSmall: [414, 4]
});
});
40
Food Corner
Home
Resturants
About
Contact
$("span.menu").click(function () {
$(".top-nav ul").slideToggle("slow", function () {
});
});
Welcome To
FOOD CORNER
Show
To FindOut
All kinds of Tastes With In Oman
41
Show
Get Ready
To Enjoy ...
Show
// You can also use "$(window).load(function() {"
$(function () {
// Slideshow 4
$("#slider4").responsiveSlides({
auto: true,
pager: true,
nav: false,
speed: 500,
namespace: "callbacks",
before: function () {
$('.events').append("before event fired.");
},
after: function () {
$('.events').append("after event fired.");
}
});
42
});
About Food Corner
Food Corner provide the best and Updated details to all our food lovers.
Food Corner strives to keep the standard for good. We collaborate with all quality resturants to serve our customers with scrumptious meal.
Popular Resturants
© 2018 Food Corner. All rights reserved
Restaurant.master.cs
using System;
44
using
using
using
using
using
using
using
using
using
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
System.Data.SqlClient;
System.Data;
System.Text;
System.Configuration;
public partial class FoodCorner_Restaurant : System.Web.UI.MasterPage
{
Datalayer objdatalayer = new Datalayer();
Constants objconstants = new Constants();
String conStr = System.Configuration.ConfigurationManager.ConnectionStrings["SiteSqlServer"].ToString();
#region Event Handlers
protected void Page_Load(object sender, EventArgs e)
{
FillPopularRest();
}
#endregion
public void FillPopularRest()
{
try
{
using (SqlConnection sqlcon = new SqlConnection(conStr))
{
string selectNo;
DataSet ds = new DataSet();
selectNo = "SELECT * from Tbl_Rest_Imag where Type='Medium'";
SqlDataAdapter da = new SqlDataAdapter(selectNo, conStr);
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
imgRest1.ImageUrl ="../images/" +
ds.Tables[0].Rows[0]["Rest_Img_Id"].ToString() + ".jpg";
//imgRest1.ImageUrl = "../FoodCorner/images/Rest_1_img2.jpg";
//PPdiv1.Style["background-image"] =
"../FoodCorner/images/Rest_1_img2.jpg";
imgRest2.ImageUrl = "../images/" +
ds.Tables[0].Rows[1]["Rest_Img_Id"].ToString() + ".jpg";
imgRest3.ImageUrl = "../images/" +
ds.Tables[0].Rows[2]["Rest_Img_Id"].ToString() + ".jpg";
imgRest4.ImageUrl = "../images/" +
ds.Tables[0].Rows[3]["Rest_Img_Id"].ToString() + ".jpg";
imgRest5.ImageUrl = "../images/" +
ds.Tables[0].Rows[4]["Rest_Img_Id"].ToString() + ".jpg";
imgRest6.ImageUrl = "../images/" +
ds.Tables[0].Rows[5]["Rest_Img_Id"].ToString() + ".jpg";
}
}
}
catch (Exception err)
{
45
}
}
}
Home Page
Food Corner
The best quality is absolute satisfaction of customers. We provide
the best and Updated details to all our food lovers. Food Corner strives to keep the
standard for good. We collaborate with all quality resturants to serve our customers with
scrumptious meal. Food Corner offers Breif about restuarants, contact details and Directing to their own website. We promise you that we will keep on doing our best with
strength, honesty and pride..
More
RestaurantList.aspx
46
47
RestaurantList.aspx.cs
using
using
using
using
using
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
System.Data.SqlClient;
System.Data;
System.Text;
System.Collections;
System.Configuration;
System.Threading;
System.IO;
System.Globalization;
public partial class Pages_RetuarantList : System.Web.UI.Page
{
Datalayer objdatalayer = new Datalayer();
// Constants objconstants = new Constants();
BusinessLayer objbusinesslayer = new BusinessLayer();
protected void Page_Load(object sender, EventArgs e)
{
// base.OnLoad(e);
if (!Page.IsPostBack)
{
BindItem();
}
}
protected void BindItem()
{
try
{
DataTable dtGetRestList = objbusinesslayer.GetRestList();
gdImage.DataSource = dtGetRestList;
gdImage.DataBind();
}
catch (Exception err)
{
System.IO.File.AppendAllText("CaughtExceptions" +
DateTime.Now.ToString("yyyy-MM-dd") + ".log", DateTime.Now.ToString("HH:mm:ss") + ": " +
err.Message + "\n" + err.ToString() + "\n");
}
}
protected void gdImage_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gdImage.PageIndex = e.NewPageIndex;
BindItem();
}
48
protected void gdImage_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void gdImage_RowDataBound(object sender, GridViewRowEventArgs e)
{
}
protected void lnkSelect_Command(object sender, CommandEventArgs e)
{
string Rest = ((System.Web.UI.WebControls.LinkButton)sender).CommandArgument;
Response.Redirect("../Pages/Rest_single.aspx?Rest=" + Rest);
}
}
Resturant Detail.aspx
Gallery
49
Hours of Working
Address
50
DownLoad Menu
Click
Here
51
Resturant Detail.aspx.cs
using
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
System.Data.SqlClient;
System.Data;
System.Text;
System.Configuration;
public partial class Pages_Rest_single : System.Web.UI.Page
{
Datalayer objdatalayer = new Datalayer();
BusinessLayer objbusinesslayer = new BusinessLayer();
string param1;
protected void Page_Load(object sender, EventArgs e)
{
param1 = Request.QueryString["Rest"];
FillResDetails();
}
public void FillResDetails()
{
try
{
DataTable dtGetRestList = new DataTable();
DataSet Ds = new DataSet();
Ds = objbusinesslayer.GetRestDetail(param1);
if (Ds.Tables[0].Rows.Count > 0)
{
Rest_name.InnerText = Ds.Tables[0].Rows[0]["Rest_Name"].ToString();
lblDesc.Text = Ds.Tables[0].Rows[0]["Res_Desc"].ToString();
imgMain.ImageUrl = "../images/" +
Ds.Tables[1].Rows[0]["Rest_Img_Id"].ToString() + ".jpg";
Worktime1.Text = "Lunch (Weekdays) : " +
Ds.Tables[0].Rows[0]["WorkHrs_wkdy"].ToString();
Workttime2.Text = "Lunch (Weekends) : " +
Ds.Tables[0].Rows[0]["WorkHrs_wkend"].ToString();
Workttime3.Text = "Dinner : " +
Ds.Tables[0].Rows[0]["Dinner"].ToString();
add1.Text = "Address : " + Ds.Tables[0].Rows[0]["address1"].ToString();
add2.Text = "
: " + Ds.Tables[0].Rows[0]["address2"].ToString();
add3.Text = "
: " + Ds.Tables[0].Rows[0]["address3"].ToString();
add4.Text = "Landmark : " + Ds.Tables[0].Rows[0]["landmark"].ToString();
contno.Text = "Contact No : " +
Ds.Tables[0].Rows[0]["Contact_No"].ToString();
Email.Text = " Email : " + Ds.Tables[0].Rows[0]["email"].ToString();
anchorID.HRef = Ds.Tables[0].Rows[0]["Website"].ToString();
managername.Text = " Manager Name : " +
Ds.Tables[0].Rows[0]["ManagerName"].ToString();
managerCont.Text = " Conatact No
: " +
Ds.Tables[0].Rows[0]["ManagerContact"].ToString();
52
ManagerEmail.Text = " Email : " +
Ds.Tables[0].Rows[0]["ManagerEmail"].ToString();
menu1.HRef = "../pdf/" + Ds.Tables[0].Rows[0]["Menu_Id"].ToString() +
".pdf";
Image1.ImageUrl = Ds.Tables[1].Rows[2]["Rest_Img_Id"].ToString() == null
? "" : "../images/" + Ds.Tables[1].Rows[2]["Rest_Img_Id"].ToString() + ".jpg";
Image2.ImageUrl = Ds.Tables[1].Rows[3]["Rest_Img_Id"].ToString() == null
? "" : "../images/" + Ds.Tables[1].Rows[3]["Rest_Img_Id"].ToString() + ".jpg";
Image3.ImageUrl = Ds.Tables[1].Rows[4]["Rest_Img_Id"].ToString() == null
? "" : "../images/" + Ds.Tables[1].Rows[4]["Rest_Img_Id"].ToString() + ".jpg";
Image4.ImageUrl = Ds.Tables[1].Rows[5]["Rest_Img_Id"].ToString() == null
? "" : "../images/" + Ds.Tables[1].Rows[5]["Rest_Img_Id"].ToString() + ".jpg";
Image5.ImageUrl = Ds.Tables[1].Rows[6]["Rest_Img_Id"].ToString() == null
? "" : "../images/" + Ds.Tables[1].Rows[6]["Rest_Img_Id"].ToString() + ".jpg";
Image6.ImageUrl = Ds.Tables[1].Rows[7]["Rest_Img_Id"].ToString() == null
? "" : "../images/" + Ds.Tables[1].Rows[7]["Rest_Img_Id"].ToString() + ".jpg";
Image7.ImageUrl = Ds.Tables[1].Rows[8]["Rest_Img_Id"].ToString() == null
? "" : "../images/" + Ds.Tables[1].Rows[8]["Rest_Img_Id"].ToString() + ".jpg";
Image8.ImageUrl = Ds.Tables[1].Rows[9]["Rest_Img_Id"].ToString() == null
? "" : "../images/" + Ds.Tables[1].Rows[9]["Rest_Img_Id"].ToString() + ".jpg";
}
}
catch (Exception err)
{
System.IO.File.AppendAllText("CaughtExceptions" +
DateTime.Now.ToString("yyyy-MM-dd") + ".log", DateTime.Now.ToString("HH:mm:ss") + ": " +
err.Message + "\n" + err.ToString() + "\n");
}
}
}
Add Item.aspx
Restuarant Details
53
54
Submit
Add Item.aspx.cs
using
using
using
using
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
System.Configuration;
System.Collections;
System.Collections.Specialized;
System.Net.Mail;
System.Net;
System.Web.Services;
System.IO;
public partial class FoodCorner_Pages_AddItem : System.Web.UI.Page
{
Datalayer objdatalayer = new Datalayer();
Constants objconstants = new Constants();
protected void Page_Load(object sender, EventArgs e)
{
//DirectoryInfo info = new DirectoryInfo(MapPath("~") + "/pdf/");
//IEnumerable fileList = info.GetFiles();
//var fileQuery = from file in fileList
//
select new
//
{
//
FileName = file.Name
//
};
55
}
protected void btnSave_Click(object sender, ImageClickEventArgs e)
{
int RetVal = 0;
Hashtable hashparameter = new Hashtable();
hashparameter.Add("@Rest_Name|nvarchar", txtName.Text.Trim().ToString());
hashparameter.Add("@Res_Desc|nvarchar", txtdesc.Text.Trim().ToString());
hashparameter.Add("@WorkHrs_wkdy|nvarchar", txtWrktime.Text.Trim().ToString());
hashparameter.Add("@WorkHrs_wkend|nvarchar", txtWrktime2.Text.Trim().ToString());
hashparameter.Add("@Dinner|nvarchar", txtDinner.Text.Trim().ToString());
hashparameter.Add("@Contact_No|nvarchar", txtContactNo.Text.Trim().ToString());
hashparameter.Add("@address1|nvarchar", txtaddress1.Text.Trim().ToString());
hashparameter.Add("@address2|nvarchar", txtaddress2.Text.Trim().ToString());
hashparameter.Add("@address3|nvarchar", txtaddress3.Text.Trim().ToString());
hashparameter.Add("@landmark|nvarchar", txtlandmark.Text.Trim().ToString());
hashparameter.Add("@email|nvarchar", txtEmail.Text.Trim().ToString());
hashparameter.Add("@ManagerName|nvarchar", txtmanagername.Text.Trim().ToString());
hashparameter.Add("@ManagerContact|nvarchar", txtmngrcontact.Text.Trim().ToString());
hashparameter.Add("@ManagerEmail|nvarchar", txtmangremail.Text.Trim().ToString());
hashparameter.Add("@Website|nvarchar", txtweb.Text.Trim().ToString());
hashparameter.Add("@TypeOfRest|nvarchar", txttype.Text.Trim().ToString());
RetVal = objdatalayer.insertRecord("Save_Rest_Details", hashparameter);
if (RetVal > 0)
{
txtName.Text= string.Empty;
txtdesc.Text= string.Empty;
txtWrktime.Text = string.Empty;
txtWrktime2.Text = string.Empty;
txtDinner.Text = string.Empty;
txtContactNo.Text = string.Empty;
txtaddress1.Text = string.Empty;
txtaddress2.Text = string.Empty;
txtaddress3.Text = string.Empty;
txtlandmark.Text = string.Empty;
txtEmail.Text = string.Empty;
txtmanagername.Text = string.Empty;
txtmngrcontact.Text = string.Empty;
txtmangremail.Text = string.Empty;
txtweb.Text = string.Empty;
txttype.Text = string.Empty;
//txtimgcode.Text = string.Empty;
}
}
protected void UploadButton_Click(object sender, EventArgs e)
{
if (FileUploadControl.HasFile)
56
{
try
{
string filename = System.IO.Path.GetFileName(FileUploadControl.FileName);
FileUploadControl.SaveAs(Server.MapPath("~/pdf/") + filename);
StatusLabel.Text = "Upload status: File uploaded!";
}
catch (Exception ex)
{
StatusLabel.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
}
}
}
}
Contact.aspx
How to find us :
Address :
Food Corner
Sultanate OF Oman,
56777
Phone :
+968 123 456 789
+968 987 654 321
57
Email :
mail@example.com
Contact Form
Submit
About Us.aspx
HonestService
Accurate Data
58
A brief history of about us
As you know, Food Corner acquired Foodspotting in 2013, not only
for its amazing content, but also for its incredibly loyal and engaged community. Since
then, you’ve been instrumental in how friends and experts alike discover the best dishes
across Oman, and for that, we just want to say Thank you.
But as the saying goes, all good things must come
to an end. After much deliberation, we have chosen to discontinue the Foodspotting app
and website in early May.
On behalf of our entire team, thank you again for using our
Website and for all the feedback you’ve provided along the way–we couldn’t have done it
without you. If you have any questions or concerns, let us know and we’ll be sure to follow up directly.
Our Team
Elina
Support
Abraham
Sales
59
Anna
Support
Mathew
Manager
App_Code
BusinessLayer.cs
using
using
using
using
using
using
using
using
using
using
60
System;
System.Collections.Generic;
System.Linq;
System.Text;
System.Data.SqlClient;
System.Collections;
System.Data;
System.Configuration;
System.Threading;
System.Web;
using System.Web.UI.WebControls;
///
/// Summary description for BusinessLayer
///
public class BusinessLayer
{
Datalayer objdatalayer = new Datalayer();
public BusinessLayer()
{
}
public DataTable GetRestList()
{
DataTable GetResultsList = new DataTable();
if (objdatalayer.getDataTable("Sp_RestMastList"))
{
GetResultsList = objdatalayer.datatable;
}
return GetResultsList;
}
public DataSet GetRestDetail(string Rest_Id)
{
Hashtable ht = new Hashtable();
DataTable GetResultsListDetail = new DataTable();
DataSet Ds = new DataSet();
;
ht.Add("@Rest_Id|varchar", Rest_Id);
DataSet dtGetInfo = objdatalayer.getDataset("Sp_RestDetailList", ht);
return dtGetInfo;
}
}
Constants.cs
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Text;
///
/// Summary description for Constants
///
public class Constants
{
public static string strDateTimeFormat = "dd/MM/yyyy";
#region StoredProcedure Names
61
public static string strSave_BlockPage = "Save_BlockPage";
#endregion
public enum applicationStatus
{
Open, Closed
}
public enum YesNo
{
Y, N
}
public enum status
{
Accept, Reject, Pending, Change
}
public enum docType
{
TechnicalDocument, PreviewImage, SupportingDocument
}
public enum supplierFileType
{
OfficialLetter, CommercialCert, BankLetter, ReferenceLetter
}
}
Datalayer.cs
using
using
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Text;
System.Data.SqlClient;
System.Web.UI;
System.Collections;
System.Data;
System.Configuration;
System.Web.UI.WebControls;
System.Threading;
///
/// Summary description for Datalayer
///
public class Datalayer
{
#region Properties
public SqlCommand objCmd;
public SqlDataAdapter objDataAdapter;
private
private
private
private
private
62
SqlConnection _s_con;
DataTable _dt;
DataSet _ds;
string m_err;
ArrayList arraylst;
private object _scalarout;
private object _outvalue;
//Added by Aspire Team
private int _ValueOnInsert;
public int ValueOnInsert
{
get { return _ValueOnInsert; }
set { _ValueOnInsert = value; }
}
//End of Adding
public DataTable datatable
{
get { return _dt; }
set { _dt = value; }
}
public SqlConnection S_Con
{
set { _s_con = value; }
get { return _s_con; }
}
public ArrayList Arraylst
{
set { arraylst = value; }
get { return arraylst; }
}
public object scalarout
{
set { _scalarout = value; }
get { return _scalarout; }
}
public DataSet dataset
{
set { _ds = value; }
get { return _ds; }
}
public object OutValue
{
get
{
return _outvalue;
}
set
{
_outvalue = value;
}
}
#endregion
#region Connection
private void Connect()
{
//string connStr = ConfigurationManager.ConnectionStrings["CONNECTtoMODPORTAL"].ToString();
63
string strConnectionString = ConfigurationManager.ConnectionStrings["SiteSqlServer"].ConnectionString.ToString();
_s_con = new SqlConnection(strConnectionString);
_s_con.Open();
}
private void Disconnect()
{
_s_con.Close();
_s_con.Dispose();
}
#endregion
public int insertRecord(string strStoredProcedureName, Hashtable hashParameters)
{
int RetVal = 0;
Connect();
objCmd = new SqlCommand(strStoredProcedureName, _s_con);
objCmd.CommandType = CommandType.StoredProcedure;
foreach (DictionaryEntry parameterValue in hashParameters)
{
string[] strDatatype = parameterValue.Key.ToString().Split('|');
switch (strDatatype[1].ToString().ToLower())
{
case "nvarchar":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.NVarChar).Value = Convert.ToString(parameterValue.Value);
break;
case "char":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.Char).Value = Convert.ToString(parameterValue.Value);
break;
case "number":
objCmd.Parameters.Add(strDatatype[0].ToString(), SqlDbType.Int).Value
= Convert.ToString(parameterValue.Value);
break;
case "varchar":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.VarChar).Value = Convert.ToString(parameterValue.Value);
break;
case "binary":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.Binary).Value = (byte[])parameterValue.Value;
break;
case "datetime":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.DateTime).Value = Convert.ToDateTime(parameterValue.Value);
break;
case "decimal":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.Decimal).Value = Convert.ToDecimal(parameterValue.Value);
break;
case "dbnull":
64
objCmd.Parameters.AddWithValue(strDatatype[0].ToString(),
DBNull.Value);
break;
default:
break;
}
}
RetVal = objCmd.ExecuteNonQuery();
Disconnect();
return RetVal;
}
public bool checkRecordExist(string strProcedureName, Hashtable hashParameters)
{
bool isExist = false;
Connect();
objCmd = new SqlCommand(strProcedureName, _s_con);
objCmd.CommandType = CommandType.StoredProcedure;
if (hashParameters != null)
{
foreach (DictionaryEntry parameterValue in hashParameters)
{
string[] strDatatype = parameterValue.Key.ToString().Split('|');
switch (strDatatype[1].ToString().ToLower())
{
case "nvarchar":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.NVarChar).Value = Convert.ToString(parameterValue.Value);
break;
case "char":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.Char).Value = Convert.ToString(parameterValue.Value);
break;
case "number":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.Int).Value = Convert.ToString(parameterValue.Value);
break;
case "varchar":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.VarChar).Value = Convert.ToString(parameterValue.Value);
break;
case "binary":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.Binary).Value = (byte[])parameterValue.Value;
break;
case "datetime":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.DateTime).Value = Convert.ToDateTime(parameterValue.Value);
break;
case "decimal":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.Decimal).Value = Convert.ToDecimal(parameterValue.Value);
break;
case "dbnull":
objCmd.Parameters.AddWithValue(strDatatype[0].ToString(),
DBNull.Value);
break;
default:
65
break;
}
}
}
Int32 rowCount = Convert.ToInt16(objCmd.ExecuteScalar());
Disconnect();
if (rowCount > 0)
{
isExist = true;
}
else
{
isExist = false;
}
return isExist;
}
public DataSet getDataset(string strProcedureName, Hashtable hashParameters)
{
Connect();
objCmd = new SqlCommand(strProcedureName, _s_con);
objCmd.CommandType = CommandType.StoredProcedure;
foreach (DictionaryEntry parameterValue in hashParameters)
{
string[] strDatatype = parameterValue.Key.ToString().Split('|');
switch (strDatatype[1].ToString().ToLower())
{
case "nvarchar":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.NVarChar).Value = Convert.ToString(parameterValue.Value);
break;
case "char":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.Char).Value = Convert.ToString(parameterValue.Value);
break;
case "number":
objCmd.Parameters.Add(strDatatype[0].ToString(), SqlDbType.Int).Value
= Convert.ToString(parameterValue.Value);
break;
case "varchar":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.VarChar).Value = Convert.ToString(parameterValue.Value);
break;
case "binary":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.Binary).Value = (byte[])parameterValue.Value;
break;
case "datetime":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.DateTime).Value = Convert.ToDateTime(parameterValue.Value);
break;
case "decimal":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.Decimal).Value = Convert.ToDecimal(parameterValue.Value);
break;
case "bit":
66
objCmd.Parameters.Add(strDatatype[0].ToString(), SqlDbType.Bit).Value
= Convert.ToBoolean(parameterValue.Value);
break;
case "dbnull":
objCmd.Parameters.AddWithValue(strDatatype[0].ToString(),
DBNull.Value);
break;
default:
break;
}
}
objDataAdapter = new SqlDataAdapter(objCmd);
DataSet objDataset = new DataSet();
objDataAdapter.Fill(objDataset);
Disconnect();
return objDataset;
}
public DataSet getDataset(string strProcedureName)
{
Connect();
objCmd = new SqlCommand(strProcedureName, _s_con);
objCmd.CommandType = CommandType.StoredProcedure;
objDataAdapter = new SqlDataAdapter(objCmd);
DataSet objDataset = new DataSet();
objDataAdapter.Fill(objDataset);
Disconnect();
return objDataset;
}
public bool getDataTable(string strProcedureName, Hashtable hashParameters =
null)
{
bool flg = true;
try
{
Connect();
_dt = new DataTable();
objCmd = new SqlCommand(strProcedureName, _s_con);
objCmd.CommandType = CommandType.StoredProcedure;
if (hashParameters != null)
{
foreach (DictionaryEntry parameterValue in hashParameters)
{
string[] strDatatype = parameterValue.Key.ToString().Split('|');
switch (strDatatype[1].ToString().ToLower())
{
//Arjun -- 14 July 2013 - For Handling Null value
case "nvarchar":
67
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.NVarChar).Value = GetConvertedValue(parameterValue.Value,
strDatatype[1].ToString().ToLower());
break;
case "char":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.Char).Value = GetConvertedValue(parameterValue.Value,
strDatatype[1].ToString().ToLower());
break;
case "number":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.Int).Value = GetConvertedValue(parameterValue.Value,
strDatatype[1].ToString().ToLower());
break;
case "varchar":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.VarChar).Value = GetConvertedValue(parameterValue.Value,
strDatatype[1].ToString().ToLower());
break;
//Arjun __ End of Change
case "binary":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.Binary).Value = (byte[])parameterValue.Value;
break;
case "datetime":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.DateTime).Value = Convert.ToDateTime(parameterValue.Value);
break;
case "decimal":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.Decimal).Value = Convert.ToDecimal(parameterValue.Value);
break;
case "bit":
objCmd.Parameters.Add(strDatatype[0].ToString(),
SqlDbType.Bit).Value = Convert.ToBoolean(parameterValue.Value);
break;
case "dbnull":
objCmd.Parameters.AddWithValue(strDatatype[0].ToString(),
DBNull.Value);
break;
default:
break;
}
}
}
objDataAdapter = new SqlDataAdapter(objCmd);
objDataAdapter.Fill(_dt);
}
catch (Exception ex)
{
flg = false;
throw ex;
}
finally
{
Disconnect();
68
}
return flg;
}
public Datalayer()
{
//
// TODO: Add constructor logic here
//
}
# region Get the Null Value Equivalent of the Parameter
///
/// Get the Converted Value from the Parameter Value
///
/// Value from the Parameter
/// DBType
///
private object GetConvertedValue(object value,
string DBType)
{
object ConvertedValue = null;
switch (DBType)
{
case "nvarchar":
case "char":
case "number":
case "varchar":
{
if (value.Equals(DBNull.Value))
{
ConvertedValue = value;
}
else
{
ConvertedValue = Convert.ToString(value);
}
break;
}
default:
break;
}
return ConvertedValue;
}
# endregion Get the Null Value Equivalent of the Parameter
}
69
Stored Procedures used
Add Item
create Proc [dbo].[Save_Rest_Details]
(
@Rest_Name nvarchar(50),
@Res_Desc nvarchar(max),
@WorkHrs_wkdy nvarchar(50),
@WorkHrs_wkend nvarchar(50),
@Dinner nvarchar(50),
--@Menu_Id nvarchar(50)
@Contact_No nvarchar(50),
@address1 nvarchar(50),
@address2 nvarchar(50),
@address3 nvarchar(50),
@landmark nvarchar(50),
@email nvarchar(50),
@ManagerName nvarchar(50),
@ManagerContact nvarchar(50),
@ManagerEmail nvarchar(50),
@Website nvarchar(50),
@TypeOfRest nvarchar(50)
) as
INSERT INTO Tbl_Rest_Mast
(
Rest_Id,
Rest_Name ,
Res_Desc ,
WorkHrs_wkdy ,
WorkHrs_wkend ,
Dinner ,
Menu_Id ,
Contact_No ,
address1 ,
address2 ,
address3 ,
landmark ,
email ,
ManagerName ,
ManagerContact ,
ManagerEmail ,
Website ,
TypeOfRest
)
VALUES
(
(select CONCAT('Rest_', (select count(*)from Tbl_Rest_Mast)+1)),
@Rest_Name ,
@Res_Desc ,
@WorkHrs_wkdy ,
@WorkHrs_wkend ,
@Dinner ,
70
(select CONCAT('Menu_', (select count(*)from Tbl_Rest_Mast)+1)) ,
@Contact_No ,
@address1 ,
@address2 ,
@address3 ,
@landmark ,
@email ,
@ManagerName ,
@ManagerContact ,
@ManagerEmail ,
@Website ,
@TypeOfRest
)
Fetch Details
USE [FoodCornerDb]
GO
/****** Object: StoredProcedure [dbo].[Sp_RestDetailList]
10:33:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Script Date: 24/04/2018
ALTER PROCEDURE [dbo].[Sp_RestDetailList] --'Rest_1'
@Rest_Id
nvarchar(50)
AS
BEGIN
-- Insert statements for procedure here
SELECT * from Tbl_Rest_Mast where Rest_Id=@Rest_Id
select Rest_Img_Id from Tbl_Rest_Imag where Rest_Id=@Rest_Id
order by Rest_Img_Id
asc
END
Fetch Master Details
USE [FoodCornerDb]
GO
/****** Object: StoredProcedure [dbo].[Sp_RestMastList]
10:35:23 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:
-- Create date:
-- Description:
71
Script Date: 24/04/2018
-- =============================================
ALTER PROCEDURE [dbo].[Sp_RestMastList]
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT Rest_Id,Rest_Name,Contact_No,landmark,TypeOfRest from Tbl_Rest_Mast
END
72
Purchase answer to see full
attachment