Disertatie Corbeanu V2 [604132]

Corbeanu Ioan Alexandru

1
UNIVERSITATEA DIN PITEȘTI
FACULTATEA DE ȘTIINȚE,
EDUCAȚIE FIZICĂ ȘI INFORMATICĂ
Programul de studii: Master at

LUCRARE DE DIS ERTA ȚIE

Coordonator științific
Conf. univ. dr. Doru Anastasiu Popescu
Absolvent: [anonimizat]
2017

Corbeanu Ioan Alexandru

2
UNIVERSITATEA DIN PITEȘTI
FACULTATEA DE ȘTIINȚE,
EDUCAȚIE FIZICĂ ȘI INFORMATICĂ
Programul de studii : Master at

E-commerce Online Magazine
Platforms. Specific technical means .

Coordonator științific
Conf. univ. dr. Doru Anastasiu Popesc u
Absolvent: [anonimizat]
2017

Corbeanu Ioan Alexandru

3
Contents
GENERAL INFORMATIONS ………………………….. ………………………….. ………………………….. ………………. 5
CHAPTER 1 – INTRODUCTION ………………………….. ………………………….. ………………………….. ………….. 6
1.1 Project subject ………………………….. ………………………….. ………………………….. ………………………… 6
CHAPTER 2 – ONLINE BUSINESS ………………………….. ………………………….. ………………………….. ……… 8
2.1 Online business types ………………………….. ………………………….. ………………………….. ………………. 8
2.2 Payment methods ………………………….. ………………………….. ………………………….. ………………….. 11
2.3 Online frauds ………………………….. ………………………….. ………………………….. ……………………….. 13
2.4 Advantages of e -commerce ………………………….. ………………………….. ………………………….. …….. 15
2.5 Disadvantages of e -commerce ………………………….. ………………………….. ………………………….. ..17
CHAPTER 3 – USED TECHONOLGIES ………………………….. ………………………….. …………………………. 19
3.1 Web pages and web servers ………………………….. ………………………….. ………………………….. ……20
3.2 Static web pages and dynamic web pages ………………………….. ………………………….. …………… 21
3.3 C# Language ………………………….. ………………………….. ………………………….. ………………………… 23
3.4 Entity Framework ………………………….. ………………………….. ………………………….. ………………… 26
3.5 LINQ ………………………….. ………………………….. ………………………….. ………………………….. ……….. 27
3.6 Databases ………………………….. ………………………….. ………………………….. ………………………….. …28
3.7 SQL ………………………….. ………………………….. ………………………….. ………………………….. …………. 28
CHAPTER 4 – APPLICATION SPECIFICATIONS, USAGE AND IMPLEMENTATION ………… 30
4.1 Presentati on ………………………….. ………………………….. ………………………….. ………………………….. 30
4.2 Home Page ………………………….. ………………………….. ………………………….. ………………………….. ..31
4.3 Data storage ………………………….. ………………………….. ………………………….. ………………………….. 33
4.4 Database creation ………………………….. ………………………….. ………………………….. ………………….. 35
4.5 Logging ………………………….. ………………………….. ………………………….. ………………………….. …….. 36
4.6 Users ………………………….. ………………………….. ………………………….. ………………………….. ………… 37
4.7 Orders ………………………….. ………………………….. ………………………….. ………………………….. ………. 40
4.8 User panel ………………………….. ………………………….. ………………………….. ………………………….. …42
4.9 Admin panel ………………………….. ………………………….. ………………………….. ………………………….. 45
4.10 User reviews ………………………….. ………………………….. ………………………….. ………………………. 49
CHAPTER 5 – CONCLUSIONS ………………………….. ………………………….. ………………………….. ………….. 51
5.1 Developer conclusion ………………………….. ………………………….. ………………………….. ……………… 51
5.2 Update possibility ………………………….. ………………………….. ………………………….. ………………….. 51
BIBLIOGRAPHY ………………………….. ………………………….. ………………………….. ………………………….. ……52

Corbeanu Ioan Alexandru

4
List of tables

Table 3.3.1 – C# Data Types ………………………….. ………………………….. ……………….. 25

List of figures

Figure 3.3.1 – MVC schema ………………………….. ………………………….. ……………….. 24
Figure 4.2.1 – Home Page ………………………….. ………………………….. …………………… 32
Figure 4.2.2 – Home Page newest products ………………………….. ……………………….. 32
Figure 4.3.1 – Database model ………………………….. ………………………….. …………….. 34
Figure 4.3.2 – IIS Configuration ………………………….. ………………………….. ………….. 35
Figure 4.4.1 – Database project scripts ………………………….. ………………………….. …. 36
Figure 4.5.1 – Log sample ………………………….. ………………………….. …………………… 37
Figure 4.6.1 – User Panel ………………………….. ………………………….. ……………………. 38
Figure 4.6.2 – Registration page ………………………….. ………………………….. ………….. 39
Figure 4.7.1 – Product page ………………………….. ………………………….. ………………… 40
Figure 4.7.2 – Shopping cart ………………………….. ………………………….. ……………….. 41
Figure 4.7.3 – Order page ………………………….. ………………………….. ……………………. 42
Figure 4.8.1 – Profile page ………………………….. ………………………….. ………………….. 43
Figure 4.8.2 – Add To Favorites options ………………………….. ………………………….. . 43
Figure 4.8.3 – Favorite list ………………………….. ………………………….. ………………….. 44
Figure 4.8.4 – Purchase history page ………………………….. ………………………….. ……. 44
Figure 4.8.5 – Purchase history detailed page ………………………….. ……………………. 45
Figure 4.9.1 – All orders page ………………………….. ………………………….. ……………… 46
Figure 4.9.2 – Pending orders page ………………………….. ………………………….. ………. 47
Figure 4.9.3 – Product search for edit ………………………….. ………………………….. …… 48
Figure 4.9.4 – Product update page ………………………….. ………………………….. ………. 49
Figure 4.10.1 – User reviews ………………………….. ………………………….. ………………. 50

Corbeanu Ioan Alexandru

5
GENERAL INFORMATIONS

Online shopping is a practice more and more popular in the modern world
because of commodity, variety and less time consuming. A process that some time
ago took over an hour now can take only a few minutes behind a computer that is
connected to the internet.
In this document will be presented all the advantages a nd disadvantages of this
modern shopping way and also the steps to create and use an online shop.
Chapter 1 – Introduction. This chapter will describe in short words what you
are going to find in this document, how it works and what should be done.
Chapte r 2 – Detailed informatios . Here w ill be presented the positive and
negative aspects of online shopping. Also, in this chapter will be presented many
other technical details like payment options, development recommendations,
economy tips a nd tricks, SEO an d many others.
Chapter 3 – Used technologies . The example application uses multiple
different languages and technologies. Here each technology will be described and
explains why it was chosen for this project and how it helped the development.
Chapter 4 – Implementation of the application. Describes how the
technologies were used, all the back logic and implementation tips and tricks.
Chapter 5 – Application specifications and features. In this chapter you will
find explanations about how the application works, how to manipulate the data and
how to use the application at a 100% efficiency.
Chapter 6 – Conclusions. This is my personal opinion about the application
and the possibility to be develop new features.

Corbeanu Ioan Alexandru

6
CHAPTER 1 – INTRODUCTION

Is a known fact that we live in the speed century, accessing information was
never easier and faster and this is essential. Right now, the fastest communication
way is the internet, accessed by computer, phone, tablet and any other device that
have a valid connection. Eve rything is digital now, no matter the domain or the
activity. Almost everyone uses a computer and somehow it depends on it.
If we try to see the evolution of the world from the point when the computer
was created until now, we can observe that the technol ogy is growing exponential
and the end user have more and more access to information. Also the technology
helps them to easy reach objectives that in the past were very hard to be
accomplished.
The paper was changed with digital storage which is much safe r, the
mathematical effort was replaced with great computing skills of a computer which
are much faster than a normal human mind and the time spent by walking to a
physical shop was replaced with a few minutes spent behind a computer and a
minimal effort t o move and click a mouse.

1.1 Project subject

When personal computers appeared on market it costs a fortune and there were
not so many alternatives. Today everybody have at least one computing system and
it may be a computer, a phone, a tablet or other gad get. They come in all sizes and
shapes. We have phones just as powerful as computers and computers that are over
twenty years old and are still doing their job. Every company uses a computing
device for different tasks such as security, customer interactio n, data storage.

Corbeanu Ioan Alexandru

7
In present, any company uses a computer that have installed different software
applications useful for it s business. These software applications helps the
administrators and users to save time, and when time means money, that’s a lot. Als o,
a computer is a modern way to store and s earch for needed data. The data acquired
in many yeas that can use a few tons of notebooks now can be easily stored on a tiny
memory card.
My application was designed to be a simple and fast way to buy products if it
is seen from customer ’s perspective or a simple and fast way to manage and sell
products if it is seen from seller ’s perspective. Why that? Because I am a pretentious
and lazy person who knows the struggle to find certa in products in standard stores.
There are three kind of users with different access pr ivileges. Every user can
change only the data assigned to it, noting more . The administrator is the only person
that can access users data.
Being simple and fast , my application is useful for everybody, customers and
owners. The improvement regarding earnings and customer impressions depends by
the seller, his attitude and the variety of products and offers.

Corbeanu Ioan Alexandru

8
CHAPTER 2 – ONLINE BUSINESS

The internet is a great place to open a company but still many people are afraid
of doing that or simply doe sn’t have the minimum knowledge . Anybody can make
money on internet without even know ing too much programming and without having
a huge amount of funds to start.

2.1 Onli ne business types

Electronic commerce (or e -commerce) is the process of selling, buying or
exchange of products or services through the internet.
The virtual market is the place where sellers and customers meet for selling,
buying or exchanging products, services or information .
Electronic business are divided in multiple categories.

Business to customer
Business to consume type is also known as B2C and is a kind of e -comme rce
where companies sell products or services to regular customers through online shops
(virtual shops). Online shops are based on a website of a company created for
promoting and selling of products or services. An online store contains a
product/service catalog which is managed using a database management system
where all the data are stored. Online shops have features for searching, viewing,
ordering and paying for products. This kind of business had a very slow evolution
because of security.

Corbeanu Ioan Alexandru

9
Business to business (B2B)
Business to business is also known as B2B and it represents a kind of e –
commerce where all participants are companies or organizations. This kind of
business uses a special channel of communication between seller and customer. The
custome r uses the sellers extranet by usernames and passwords.
This kind of business include search of potential providers, product catalogs
and the possibility of ordering products of services.

Consumer to consumer
Consumer to consumer type is also known as C2C. This is type of business
where consumers are acting just like sellers. They are selling products, new or used,
and services to another consumer which can act like a seller too (like ebay , craiglist,
etc.).

Consumer to business
Consumer to business t ype is also known as C2B. It is a category of business
where consumers uses the internet to sell their products or services to the companies.

E-banking
Internet Banking is a needed tool for everyone who owns a bank account and
also an internet connectio n. This is exactly what e -banking is. It connects your bank
account with the internet so you can manage your transactions online. This way you
can transfer money or make payments anytime. Also, the banking consultation is
available anytime, anywhere and it ’s cost free.

E-learning
Today almost every school uses a platform for their students. That platform is
an e-learning business.

Corbeanu Ioan Alexandru

10
E-directories
Those are some websites that acts like databases for online websites. Are also
known as Web Directories and i n the past were used by google to index the websites
in order to increase their PR.
An e -directory store a lot of websites and use search trees in order to find the
needed data. Without an optimal search this process will take too long.

M-commerce
M-commerce is something new. It is a type of commerce based on mobile
phone s. All transactions are made through a phone with internet connection. For this
type of commerce are available multiple ways of payment (directly by phone, paypal,
etc.). Usually, ticke ts selling and informational messages are kind of business that
uses m -commerce too.

E-gambling
Online gambling games are attracting more and more people. This is e –
gabling. It gives to the user the chance to win money and prizes online by betting on
gambling games. Money transfer for this can be done with digital payments or using
virtual coins.

E-Procurement
This is a bidding type business for supplying. Usually is used by public
authorities. The authority posts an offer with some fixed specific ations and other
companies who sell the product or services are placing bids. The difference is that
the price of bid will decrease, this way the requester is getting a better price.

Corbeanu Ioan Alexandru

11
Government to business
This kind of business is related to government al institutions and their
transactions with companies.

Government to consumer
If the Government to business type is about companies and governmental
institutions, this is about governmental institutions and citizens. Most cases when a
citizen pays their duty it is considered a government to consumer business.

E-trading/e -brokering
What is internet without virtual product or services? Well, this kind of business
is based on transacting virtual things.

2.2 Payment methods

An e -commerce business ne eds to be able to process online payments. At the
beginning a lot of issues and security problems were found regarding digital
payments. A lot of hackers used their skills to get money from people by cracking
the payment tools and changing the destination accounts or stealing passwords.
About the security problems we will discuss bellow.
Since there was a lot of phishing and stealing acts in the past, the customers
are reticent when they need to make an online transaction. Today the security policies
are v ery rough and only really talented people are able to bypass them in order to
steal data or money. And even if this is happening, the money can be blocked and
sent back to the owner.
In time appeared a lot of new payment processors. This processor are in fact
services that secure transactions between the client and the seller. For example,

Corbeanu Ioan Alexandru

12
PayPal is a very used payment processor because it uses many levels of security and
applies cheap charges for that.
The three most used payment methods are:

Payments us ing c redit cards
The first digital method was using a simple piece of plastic, a credit card.
Because of low security policies, this way of payment was very dangerous.
Scammers made a lot of money by phishing. Right now, this is still the most used
method for online payments. Because the online shop is unable to read the data from
your card chip, you need to manually fill a form using the data written on the credit
card.
In time the security of this kind of transactions was better and better, now using
more layers of verification (like 3D Secure). This way, the payments using credit
cards are safer that few years ago.

PayPal
PayPal is a software solution for digital payments (payment processor) . Both,
seller and customer, needs to have a paypal account. The re are multiple types of
paypal accounts. It acts like a gateway between customer’s card or bank account and
sellers account. For example, the customer can link its credit card or bank account
with his paypal account. When he will make a transaction with h is paypal account,
the paypal service will make a transaction between the card /bank and its service and
then will transfer the funds from customers account to sellers account.
Also, if needed, PayPal makes conversions of currency on his side using an
universal conversion all over the word. If the conversion was made on the bank side,
the currency price may be different from country to country.
This practice is very useful because paypal is a secure layer for your
transactions.

Corbeanu Ioan Alexandru

13
Gift cards
A gift card is a digital picture, plastic card or simple cartboard card with a
fixed value and a unique code. Those cards can be purchased from different stores
for the exact price written on them. Their value is equal with the value written on
them also. This card purpos e is to be sent as a gift to someone and it can be used to
buy products or services from the same shop it was purchased. Basically, instead of
offering money as a gift, you buy a card with the same value and send it as a gift to
someone. The difference is that the money can be used in any shop, the gift can be
used only in certain shop.

2.3 Online frauds

Because a lot of money is made online it’s no wonder that people think how
to fool someone or to hack accounts. Some methods are very old but still wor king
and some are new and very tricky .
About ten years ago the online security was weak and the users uninformed so
it was easy for a smart person to fool somebody or to steal passwords.
Phishing is a method used to steal the data from different person s. Long time
ago it was a simple process but now the internet is much safer and it’s hard but not
impossible to use this method. As a fact, I tried a phishing attack at the age of 15 and
it was a success (for me, not for security).
What I’ve done back the n was to create a scam page which was looking exactly
as a social network homepage. This was an easy process based on HTML and CSS.
Then, using PHP, I changed the credentials textboxes and submit button so every
time the user tries to log in, an email cont aining the user and the password was sent
to my email address. Next step was to install this scam page on a domain name which
was looking almost like the original one. All my friends were amazed when I told
them their passwords.

Corbeanu Ioan Alexandru

14
Now imagine that this can be done on another websites which works with
money, such as PayPal. Dangerous, right?
Well, the users should be aware that this kind of thinks still can happen and to
be careful where they are tr ying to login. Right now the internet is much safer and
this kind of scams are very rare.

Also, there are another ways to fool users too. Some of them doesn’t even need
programming skills. A few of them are:

1) Pyramidal schemes – Is a very old practice, much older than the internet.
You can earn a lot of money by r ecruiting new members. Basically, each
new member should pay a fee to the recruiter and he should recruit other
members. For example: a person is recruited by another person and the fee
in 5$. His earnings are now -5$. He recruits then 5 friends, each of t hem
should pay 5$ in order join the “business”. Now his earnings are 20$. But
that the simplest example. There are schemes where earnings are based on
5 or more levels of recruited people.
2) Fake job offer s – Everyone wants to be rich without working. That’s what
the scammers thought and wanted. The difference if that they earn some
money doing almost nothing since the victims only pays the money and
dreams to be rich without working. The scampers lie the victims about
some easy jobs that can be done fast or you can ask someone else to do it
(like pyramidal schemes). It seems simple but you need training for that, at
least that’s what scammers think. So, in order to start, they convince you
to buy their books, courses or any training materials in order to help you.
Trust me, they’re useless and very expensive. You will get the materials,
maybe the “job” too but you will find out that the job is not producing
money at all.

Corbeanu Ioan Alexandru

15
3) Content stealing – That’s how some of the fake contests really work. A
website will preten d that is the organizer of a contest (for example a
photography contest). There will be showed some generous prizes in order
to attract the victims. Using that kind of prizes, the website will become
viral and a lot of victims will enter the contest. At th e end, the winners will
be some imaginary contestants and all the content of the contestants will
be stolen by the scammers and used under own copyright. Also, another
method of contest frauds is to use a registration fee and no real winner or
prizes.

2.4 Advantages

The internet is a big advantage in people’s life. Since the online environment
can be an advantage, online business have also advantages for a human, whatever he
Is a customer, a seller, a company or any kind of user. An online shop have
advantages for both sides: seller and customer.

Here are some advantages
 On internet you can buy almost anything. Anything legal, of course,
can be found on internet stores in different parts of the world. For
example if you want to grow a banana tree ind oor but you live in
Iceland, where do you find banana seeds? You won’t find them in
Iceland for sure but you can use an online shop from Thailand to
order them.
 It’s fast and cheap way to promote your products. All websites rent
spaces for banners for che ap prices. You can promote your products

Corbeanu Ioan Alexandru

16
or services placing a banner on multiple websites or you can use
dedicated services that do it for you.
 The starting costs for an online store are much lower than a physical
one. That’s because a server and an e -commerce platform costs
much less than a physical place. A rent for a place may cost
thousands of dollars a month since an online shop cost less than 50
dollars a month.
 Online it’s easier to communicate. Communication between sellers
and customers, sellers a nd suppliers, customers and customers is
easier on internet.
 Reduced times. Timing is important. When reviewing stocks, or
when the clients search something, time is essential. Consulting a
database is easier than manually checking all the products. Also,
the user can do that anytime, not using a fixed schedule.
 Better studies about the market, customer needs, wanted products
or price range.
 Much more feedbacks from anybody for everything
 Cheap redesigning. Redesigning a physical store is a pain. This
mean s to close the store for a few days, to invest much money, to
lose money for being closed, etc. Online shops are cheap to
redesign and doesn’t need to be closed more than few minutes.
 Opened all the time. Online shops are opened 24/24 and can be
accessed b y anyone t hat have an internet connection, from any
part of the world.

Corbeanu Ioan Alexandru

17
2.5 Disadvantages

As expected, e -commerce can have disadvantages too. It’s true, comparing
with the advantages there’s not so much disadvantages but they exists.
 Customers are re ticent
This problem is caused by security issues explained above. The users are
now skeptical when buying from internet. Most cases are because of
security issues but also there are another causes like unclear product
description, impossibility to test or shipping fear (products can broke when
shipping).

 People’s i gnorance
This problem is most related to older people. They refuse to accept the
technical progress and avoid online stores and transactions. They doesn’t
feel safe and instead of studying the t opic they prefer to avoid it.

 Customers mentality
Customers wants to be treated well. If a seller doesn’t treat a customer the
way he wants, the customer can chose to buy from another place. This
attitude of seller can affect his earnings. A customer bad review can affect
another possible customers mentality and they will avoid that store.

 Other disadvantages
o Users can’t test or touch the products. But right now almost every
store use a “30 days money back” policy. This allows the user to

Corbeanu Ioan Alexandru

18
test the produc t for maximum 30 days and if is not pleased he can
send the product back to the seller.
o There is no seller that can recommend products. Also, sometimes
there’s no one that can reply to user’s questions.
o Products can be damaged during shipment. This is a kn own
problem and it’s related to the shipping companies. Most of the
shops allow the user to switch the product with a new one or to be
refund if the product is broken because of shipping. Also, some
shipping services allow the user to open the package and check its
content before paying.

Corbeanu Ioan Alexandru

19
CHAPTER 3 – USED TECHONOLGIES

The computer is a flexible invention perfectioned in time that can adapt to
almost any kind of work. It can be used for work purposes but also for multimedia
and entertaining. It’s just lik e a perfect job: you can do you work and also you can
have fun in the same time.
The internet extends the computer capacity and gives the possibility to access
new information but also new kind of interaction. The communication never was
easier and that f ast. If some time the phone limited the users to 2 persons, now the
internet is able to create video chats between people, not limiting at 2. This is useful
because working teams can be more powerful and more informed. For example a
team can be formed by f our people that lives on four different continent. Their
communication is simple because of internet.
The internet is actually a network spread all over the world. Each machine
contains information and share it with the others. But because the internet is a large
network, doesn’t mean that there is only one network. In the internet are a lot of other
small networks which contains other smaller networks. This spider web can be
considered a network of networks and is known as World Wide Web (or WWW).
The e volution was monstrous. From a few computers that formed the internet
at the beginning, now it is formed by millions and this happened in less than 50 years.
Romania, which now is in the top countries for internet speed, has adopted the
internet pretty la te. In the beginning it was very expensive and only the richest people
afforded a computer and an internet connection. If a computer was considered a lux,
an internet connection was just a dream.
In time, the internet is becoming faster, safer and more in tuitive for common
people. For that, new technologies are developed in order to help developers create
pages faster and easier.

Corbeanu Ioan Alexandru

20
3.1 Web: Protocols, Pages, Servers, Hosts

The internet is working on a sum of protocols, ports, software application and
physical computers known as hosts. To be able to surf on internet (to navigate from
one page to another) the user needs to use a protocol. The base protocol is HTTP
(Hyper Text Transfer Protocol). Also, most of today websites use a secured protocol
named HTT PS (Hyper Text Transfer Protocol Secured).
Most users think that a server is a physical computer connected to internet.
This is false. The server is a software service installed on the computer and used for
sharing content on the internet. The computer wh ich is confused with the server is
actually a host. And that’s logical, because a computer can host multiple server -type
applications.
A sever application’s job is to manage requests and respond to them. Doesn’t
matter what kind of server is, all have the same job: create a connection and
receive/send data through it.
A connection is based on IPs. The IP is an unique address associated with one
computer in the internet. If two computers will be configured with the same IP
address, one of them will be excl uded.
When a request is sent to a server, there will be crated an IP connection
between the server and the client. Through that connection the request will be sent
by the client to the server, the server will process it and will respond using the same
connection. After the transfer is done, the connection is closed.
A port is a numerical endpoint, unique for the host, that allows or denies
incoming or outgoing connections. Any server -type software should use a different
port so the request and responses d o not mix.
A host can run multiple server applications, same type or different type, if all
of them are using different ports.

Corbeanu Ioan Alexandru

21
Web pages are simple files in host’s local memory, written in a language which
the browsers can interpret and display. Dependin g by code and languages, the pages
can be simple or complex (with animations, dynamic content change or other
multimedia content). They are requested by the clients through a server software.
The base language for web files is HTML but it can be mixed wit h several
other languages in order to create more complex pages. Those documents are
rendered to the client by the browsers, which are software tools that helps to load and
display web documents.

3.2 Web pages

Uniform Resource Locator
The internet i n very huge. There are a lot of resources, a lot of web pages, a
lot of addresses. Every host is identified by an IP address. Every website is identified
by a domain name. A resource saved in a host is identified by a path. That path is a
concatenation of more elements: protocol, host name, local path to file (mapped by
server), resource name. This combination of elements is representing a unique path,
also known as URL.
Also, an URL shouldn’t contain any blank spaces. If the path to the file will
contain such spaces, all of them will be replaced with other identifiers. Same problem
for some other special characters.

HTML
HTML is an universal markup language for web pages. HTML pages uses the
extension .htm or .html but also the code can be inserted in ot her king of pages (such
as PHP).

Corbeanu Ioan Alexandru

22
HTML became a standard long time ago and is still being used and improved
to be faster, cleaner and more powerful.
If HTML is mixed with a scripting language (such as Javascript or PHP) the
result can be awesome: pages w ith great animations, many features and a lot of
available functions.
Because it is based on a set of tags and rules, it is easy to learn and to be used.

Cascading Style Sheets
Cascading Style Sheets (or simply CSS) is a styling method for HTML DOM
(Document Object Model). It is based HTML element or trees of HTML elements
and can do almost anything in matter of styling. The CSS can be inserted between
style tags inside HTML files or can be written in differed files and referenced by the
web pages.

AJAX
Ajax is a javascript method that sends a request to a specified file on the server.
An ajax request can have arguments or not. Ajax calls have multiple purposes: can
access web services with SOAP or JSON data but the biggest usage is to update only
a part of the page using a request to the server.

Javascript and jQuery
Javascript is a scripting language used on web pages to add new features. It is
able to make calculus, manipulate the DOM and to send request to the server through
AJAX.
JQuery is nothing else but a stylized javascript, a library of javascript codes
organized to be more friendly with the developer. It can do everything that javascript
is able to do but with much less code. Some usual functionalities was programmed

Corbeanu Ioan Alexandru

23
in jquery library to be done using just one line of code, instead of hundred or thousand
like regular javascript.

3.3 C# (or C Sharp)

C# is a popular programming language created by Microsoft. It was designed
as a response to Ja va created by Sun Microsystems.
C# is one of the main programming languages included in Microsoft’s .NET
Framework , next to C++, Visual Basic and C .
For helping developers to create applications, Microsoft comes in with his own
libraries and software environment nam ed .Net Framework.

C# on the web
First time when C# was used on the web it was mixed with html and delivered
as ASP application . An ASP page has two different layers: display layer which
represents the part which will be shown to the user, and the business layer which will
handle the back logic of the application. Th ose two layers communicate one with
each o ther.
Later, the C# was used with the MVC pattern. This is a design method that
separates the business (model) from the d isplay layer (view) and the communication
is made using a new concept, the controller.

Corbeanu Ioan Alexandru

24

Figure 3.3.1 – MVC schema

Right now, MVC is the most used design pattern around the world. Using this
pattern, the code will be easier to understand and more clean. Also, the pages can be
composed by multiple files, n amed partial views .

Since C# is derived from C++, the syntax is not that different. Same with the
data types.

Corbeanu Ioan Alexandru

25
Data types
Table 3.3.1 – C# Data Type s

Corbeanu Ioan Alexandru

26
Comments
Commenting the code is a very importa nt procedure for any organized
programmer. A code well commented is easier to read in order to make changer for
an updated function ability. For doing this, C# uses the same syntax as c++:

1) One line comment – before the comment will be inserted double slash
(//)
Example: //simple comment

2) Multiple line comment – comment will start with /* and will finish with
*/
Example: /* comment on
multiple lines */

3.4 Entity Framework (EF)

EF is a tool that helps developers to interact in an easy way with the database.
It maps the database to the application (creates the model based on database –
database first application) or create the database ta bles based on models already
created into the soluti on (code first application).
In both ways, the interaction with the database is simp lified, the developer is
able to use linq commands to interact with the d atabase ’s data.
Entity Framework is not limited to only one kind of database, it can manage
multiple types, such as SQL, MySQL, Oracle, etc.

Corbeanu Ioan Alexandru

27
3.5 LINQ

As I said above, LINQ is a universal language that helps the user to interact
with the database data. It is universal be cause it is n ot related to any kind of database,
it can be used on multiple types.
It is integrated in .Net Framework and its synta x is not very different than
SQL ’s syntax . Also, it can be used to extract data from lists, XML documents or
arrays.
Let’s check the differences between LINQ and SQL queries. For example, a
query that extract the first element of a table or all of t hem, ordered by a column, or
calcu lating a max or min in a table.
For returning a result both languages uses the same identifier: SELECT. To
add a verification clause, both of them use the WHER E identifier. Until now , the
difference is that the SQL have the reverse o rder of LINQ. The target is declared a
little bit different. In SQL is used WHERE, in SQL is declared a variable of type
table.
– SQL: SELECT * FROM <table > WHERE <something>
– LINQ: a in <table >.* WHERE <something> SELECT a

In SQL, there are three kind of JOIN types: Le ft Join, Right Join and Inner
join. LINQ simplifies that with only one Join. It is used ex actly like in SQL.
Also for calculation of a table: Sum, Min, Max and Average, all of them have
the same syntax and functionability as SQL.
For ordering the only difference is a space. SQL uses Order By, LINQ uses
OrderBy . Default is ascending for both cases.
Despite SQL, LINQ doesn ’t have the possibility to use a limit of results. But
there ’s a way to display only the first or the last element of the result list: First or
FirstOrDefault and Last or LastOrDefault .

Corbeanu Ioan Alexandru

28
Another common identifier in SQL and LINQ is count which in both cases
will return the number of elements resulted.

3.6 Databases

A database is a n indispensable tool in our life. It is basically used for data
storage but also it can do so many other tasks. Long time ago, an y people with a pen
and a piec e of paper was able to create his own database. Tha t’s right, the database
isn’t just digital. If in real life the database can take any shape, digital databases are
represented by a collection of tables.
In present, digital databases are used in more and more places. They are much
faster, much easier administrate and can save a lot of time due to custom operations
that can be made in a short time (e.g. searching a product ’s price).
Maybe a digital database in an offline environment is a great idea but in an
online environment everything changes.
Databases are the most important data centers in all the internet. Why?
Because in data bases are stored passwords. Anyway, the p asswords are encrypted
before being written to the database but a good hacker can find the key to decrypt
them. So it ’s better to not be able to cr ack the database.
Because data is very important and not everybody should have access to it, in
online the database must be secured as much as pos sible. I think this is the most
important aspect of a database: security.

3.7 SQL

SQL is a language specific for databases which is being used for interacting
and alteration of the data. Right n ow this is the most popular language, especially for
applications developed in .NET Framework that nee ds a database integration.

Corbeanu Ioan Alexandru

29
SQL language uses queries, which actually are command formed by
concatenating specific identifiers with clauses and different names. Each clause have
a specific syntax and the iden tifiers should use a speci fic order.
All SQL data types have a corresp ondent in every programming language so
the integration it ’s easy (as I said above when discussed about Entity Framework ).
SQL is able to store data, read data, change data but that ’s not all. It can also
make complex searches and calculations, can create reports, views any many other
things.
For a fast search, it uses indexes a nd keys. The keys (primary key and foreign
key) are also used to link the tables. For exampl e if a table contains a list of products,
and another table contains a list of orders, using a key will be able to link the user
with his command.

Corbeanu Ioan Alexandru

30
CHAPTER 4 – APPLICATION SPECIFICATIONS,
USAGE AND IMPLEMENTATION

4.1 Present ation

Which is the biggest problem of a human? The time! Nobody has enough time.
Day by day we struggle to free some time in order to use for our personal activities.
Some use it for cycling, some use it for singing and some for sle eping but overall we
don’t have enough time to do what we want.
A paradox is that humans spent a lot of time to improve technology in order
to free some time. Weird, no? Twenty years ago, the internet connection was slow
so if you wanted to see a video or an image, you should spend few minutes or hours
waiting for down loading the resource. Now, after twenty years we can watch live
movies and load images almost instantly. It took twenty years to reduce something
by several minutes.
But this time optimization isn’t related only to internet. Some other activities
have moved to inter net in order to save time, for example, shops.
You ca n visit all shops in a mall in less than 15 minute s? I don ’t think so . But
you can visit the same number of online shops in l ess than 15 minute.
But that ’s not all . Online shopping is more than that. Despite a traditional shop
here a customer can find much more products with a great range of sizes and colors ,
can socialize with other customers who bought th e same products, can check the
reviews. Also for sellers, the internet is a gr eat place to save time and money. Did
you ever tried to make money while you sleep? Well, an onl ine seller can do that
because his store is opened all the time. More tha n that, he also save time when

Corbeanu Ioan Alexandru

31
check ing stocks, placing orders to su ppliers or change products details (because
using a digital database you can also do bulk changes).
Well, all my life I wanted to have more free time so I created an online store
so I can produce money while I sleep or I do other activities. I did it also because it
is cheaper than a regular store and is more convenient to work from home.

4.2 Home Page

The home page is the most important page of any website. That’s because if
the custom er doesn ’t like it he can avoid the store. If the page looks good and inspire
professionalism , the customer will trust the website and will be tempted to buy
products. The best pract ice is to make this page available from any page of the
website. In my case, a click on the logo (situated on the upper left corner) will redirect
the user to the home page.
As you can see in the image below, the first page is a simple page that lists the
newly added products and the latest offers , only four of each category . In the left side
(sidebar) there is a dynamic list of main pr oduct categories and subcategories ,
populated using AJAX calls.
Also, there is a carousel that promote certain products or services available on
the website .

Corbeanu Ioan Alexandru

32

Figure 4.2.1 – Home Page

The header contains useful menus in the upper right corner (for Login,
Shopping C art or user account when someone is logged in) .

Figure 4.2.2 – Home Page newest products

Corbeanu Ioan Alexandru

33
4.3 Data storage

As expected, the application needs to save and reuse data, so I used a digital
database. There are many kind of data used: static (fixed data, which is not changed
at all ), dynamic (that can be changed if needed) , temporary (which is created when
needed and deleted at the end).
For the storage of data I used SQL Server, a server software designated for
databases. It allows me to check the raw data from tables and also to manipula te it.
Below you can see the application ’s database schema. Th is schema contains
all used tables and r elations hips between them.

Corbeanu Ioan Alexandru

34

Figure 4.3.1 – Database model

The web server used is the one integrated in Microsoft Windows, IIS (Internet
Information Services). In IIS settings in specified a directory that should be
discoverable in internet. This directory c ontain s the appl ication. By doing this, my
website can be access ible from internet. Without II S, my applicat ion will remain a
simple local website. You can check bellow the IIS settings.

Corbeanu Ioan Alexandru

35

Figure 4.3.2 – IIS Configuration

4.4 Database creation

As a security policy , no user have direct access to database , not even the
administrator. Every custom change should be done manually by writing a quer y in
a database management software . In order to crea te, backup, alter or delete it you
need to have access to a management software installed on server. I used SQL Server
as database server software and for database management.
The connection to the database is made automatically by Entity Framework.
It is using a connection string declared in Web.config file. The c onnection string
looks like this:
<connectionStrings >
<add name ="DB_entities "
connectionString ="metadata=res://*/DB_diagram.csdl|res://*/DB_diagram.ssdl|res://*/DB_diagra
m.msl;provider=System.Data.SqlClient;provider connection string= &quot; data
source= LAPTOP -PC;initial catalog=disertatie;persist security info=True;user

Corbeanu Ioan Alexandru

36
id=crb;password=password;MultipleActiveResultSets=True;App=EntityFramework &quot; "
providerName ="System.Data.EntityClient " />
</connectionStrings >

The base tables were created manually using SQL Server. Inside solution
there’s a database project where all mappings and entities are stored. Also, there is a
folder that contains all operations needs to be ran on database in order to be up to
date.

Figure 4.4.1 – Database project scripts

4.5 Logging

The application have one feature implemented to use developers and
maintenance team. One of its projects is responsible of logging different error
messages to a specific file.
This feature is very useful in order to check where an erro r occurred and why.
A logged message contains the time, the error message, a stack trace, the file where
the error was thrown and the index of code line.

Corbeanu Ioan Alexandru

37

Figure 4.5.1 – Log sample

All the logs will be stored in c: \storeLogs \logs.txt. As a future chang e, the logs
file and directory will be set dynamically using a key defined in Web.config file.

4.6 User s

On first launch of the website, the customer will see the home page presented
above.
The application divides the visitors in three different typ es:
1) Admin users – users that have full access
2) Anonymous users – users that have limited access. They can only see the
products and place orders.
3) Registered users – users that have a registered account on the website. They
aren’t having so many rights as an admin but still they have more rights
than an anonymous user. Despite an anonymous user, the registered user
can save his contact details, can check past orders and can save products in
a favorite product list.

A registered user is able to use the User P anel. This panel gives him a plus of
features. If an unregistered user which is trying to access a page that require

Corbeanu Ioan Alexandru

38
registered rights or admin rights will be redirected to homepage. Same story with a
registered user that is trying to access an admin page.
This is how an admin panel looks like. A page for registered users will look
just like it but with less menus.

Figure 4.6.1 – User Panel

On registration, any user will have basic permissions. In order to transform it
from registered user to admin, an admin should change his role directly into the
database.
In order to be a member, the visitor should search for the Register button
placed on the upper right corner of the website. For registration, minimal information
is required for user account. The r egistration form looks like this.

Corbeanu Ioan Alexandru

39

Figure 4.6.2 – Registration page

Corbeanu Ioan Alexandru

40
4.7 Orders

Any user can place orders. Registered or anonymous, all users are able to
purchase products from the website, 24/24. The difference is that the registered users
can trac k their older orders.
For placing an order, the users need to add their products to the cart list. In the
product page they should select the quantity and then click on the Add To Cart
button.

Figure 4.7.1 – Product page

For the products out of stock, the button will be disabled.
After adding the products to the cart, nex t step is to check the cart. This can
be done by clicking on the Shopping Cart menu on the upper right corner.

Corbeanu Ioan Alexandru

41

Figure 4.7.2 – Shopping cart

On the shopping cart page the user is able to remove the products from his cart
or to change the quantity of a product. Also, a total is calculated for his product list.
If everything is right, press the Next Step button in order to move forward.
This is the last step of an order. Here the u ser should provide all mandatory
shipping and billing info. Also he can check the shipping method. By clicking on
Place Order he will confirm that the information provided is correct and the order
will be sent to the site admins. Also, this page will be fi lled automatically with the
data stored in database for registered users.

Corbeanu Ioan Alexandru

42

Figure 4.7.3 – Order page

4.8 User panel

Registered users have access to an area dedicated only for registered users.
This area is based on a few pages with data important fo r user.

Profile page
The profile page is the place where users can store their shipping and billing
details. This details will be automatically filled on order page when the user is logged
in and will place an order.

Corbeanu Ioan Alexandru

43

Figure 4.8.1 – Profile page

Favorites
A registered user can create a list of favorite products by clicking the Add to
favorite option in the product page. The option is placed just under the Add to cart
button.

Figure 4.8.2 – Add To Favorites options

Corbeanu Ioan Alexandru

44
In the favorites menu from us er panel, the user will see a list of all products
added to favorite. This is a quick access to products wanted by the user. He can
always add or remove products from this list.

Figure 4.8.3 – Favorite list

Purchase history
This page is used to check the past orders of the client. Each order in this list
will contain its unique number, the date when it was placed, the total cost and the
status. Also, there’s a button that will show the order details.

Figure 4.8.4 – Purchase history page

When clic king the View button, the page will switch to detailed mode and
more information about the order will be shown. On the top the user will see the
address used, phone number, status, shipping method, total, etc. Under that he will
also see the list of produc ts and the quantity of each one.

Corbeanu Ioan Alexandru

45

Figure 4.8.5 – Purchase history detailed page

4.9 Admin panel

An admin will have more options on his panel despite a simple registered user.
All the menus for a registered users are available for the admin too. Here ’s what’s
more:

All orders
This is a page where the admin can see all the orders, placed by all users,
registered or not. The logic is just as for the Purchase history page and the admin
will see the same details.

Corbeanu Ioan Alexandru

46

Figure 4.9.1 – All orders page

Pending orders
All orders are organized in three statuses: Received, Confirmed and Sent.
A Received order is an order that has been saved in the system but was not
checked and confirmed by an admin.
A Confirmed order is an order that has been checked and con firmed by the
admin but it is not sent to the customer yet.
A Sent order is an order that was already shipped.
Using this menu the admin can check all the orders that were not shipped yet
and change the status. An order which have the Received status can’t be directly
marked as Sent. The status change should be done one at a time. For changing the
status, the admin should click the green button associated with the order.

Corbeanu Ioan Alexandru

47

Figure 4.9.2 – Pending orders page

Insert and Edit / Delete
Those are a set of p ages used to manage the content of the website. This way
the admin can add a category, can remove a category, can add or change a product,
a type or search criterias for a product. In the example below you can see how a
product can be updated.
In order to update a product, first we should search it.

Corbeanu Ioan Alexandru

48

Figure 4.9.3 – Product search for edit

As you can see, each product have an edit button. When pressed, a page just
like the adding page of a product will be opened. Here the admin can change any
aspect of a product.

Corbeanu Ioan Alexandru

49

Figure 4.9.4 – Product update page

4.10 User reviews

Users are able to leave reviews for purchased products. A review is based on
a description, a mark (1 to 5 stars) and a name of the reviewer. To leave or read a
review just scroll to the bottom page of a product and switch the tab from description
to reviews. There a list of reviews will be shown and a button will allow the user to
add a new review. On click, an empty form will pop out and the user needs to fill all
fields in order to be validated.

Corbeanu Ioan Alexandru

50

Figure 4.10.1 – User reviews

Corbeanu Ioan Alexandru

51
CHAPTER 5 – CONCLUSIONS

5.1 Developer conclusion

The importance of internet in human’s life is already known. Its advantages
should be used by any company that wants to evolve. The absence o f a company in
online and the presence of the concurrence can explain a big difference in
transactions.
A website is developed just one time and will last a lifetime. Also, a website
can be accessed anytime on any hour from anybody. All the administrator s should
do is to update the content.

5.2 Update possibility

This version of the application is not a final version, it’s actually the first. The
shop can be upgraded with new features. Here are a few new features that can be
added:
– Dynamic install of the database on first run
– Blacklist – a list to filter problematic users based on email and phone
number
– Dynamic display template changes – a way to change the style of the
website without knowing any programming languages.
– Email notifications sent to cus tomers – email alerts for stock availability,
order status or newsletters.

Those are just a few development ideas for a future version of the shop.
According to technologies improvement, some new feature ideas can be added.

Corbeanu Ioan Alexandru

52
BIBLIOGRAPHY

1. Andrew Troelsen, Philip Japikse, C# 6.0 and the .NET 4.6 Framework 7th
Edition, Apress
2. Anthony T. Holdener III, Ajax: The Definitive Guide: Interactive Applications
for the Web 1st Edition, O'Reilly
3. Dr. Charles R Severance, Introduction to Networking: How the Internet Works
4. Ian Griffiths, Programming C# 5.0: Building Windows 8, Web, and Desktop
Applications for the .NET 4.5 Framework, O’Reilly
5. Julia Lerman, Rowan Miller, Programming Entity Framework: DbContext:
Querying, Changing, and Validating Your Data with Entity Framework,
O'Reilly
6. Julie C. Meloni, HTML, CSS and JavaScript All in One, Sams Teach
Yourself: Covering HTML5, CSS3, and jQuery (2nd Edition), Sams
7. Juval Lowy, Michael Montgomery, Programm ing WCF Services: Design and
Build Maintainable Service -Oriented Systems 4th Edition, O'Reilly

Similar Posts