Eng-old.najah.edu



An-Najah National University

Department of Computer Eng.

Graduation Project 1

[pic]

Project Name:

E-Commerce Website

http:\\

Students:

Mohammad Abu Al Wafa

&

Malek Zagal

Supervisor:

Dr .Luai M. Malhis

INTRODUCTION:

Ecommerce is defined as the process of selling and buying goods and services via the internet. When selling your goods and services online, it is important to display your products and services in a simple and logical way so that they are easy to find. It must be very simple and intuitive to navigate the website and use the buying functions. Placement of the products, sales copy, product photography, general page design and so on will all make significant differences as to whether your products sell well or poorly.

Security is a vital factor when collecting sensitive information over the internet. Customers want to know that all key information is safe from theft when they shop online.

After an online payment is received, an order confirmation needs to be sent immediately to the customer letting them know that their payment was received and their shipment will be sent out as soon as possible. Many customers will be a little nervous when they purchase off you for the first time. It is important that you reassure them as soon as possible.

The final part of the process the business will be alerted that an order has been placed and needs to be shipped as soon as possible.

Description :

Our Project consist of two three the Customer side, Companies side and the Administrator of the System. Each side will divide the work to be done by separate functions and then the function will integrate it to do the work

The Administrator Side :

The Administrator can do any thing in the system so as to make it fair for users and companies. He should be active all the time, we put one administrator for our website but it is easy to make it more so as to ensure that there is an administrator active for all the time at least.

The basic administrator is the one who can add more administrators on the system only.

Administrator Pages :

• Administrators Page (admin.aspx) :

[pic]

Any administrator can see this page to view all of the administrators who are active on the website no administrator can do any thing for other except the basic administrator who can add administrators to the system or delete them.

* Administrator Accounts (adminAccount.aspx) :

[pic]

Using this page any administrator can view/change its account information, he can change its address information, email address, phone numbers and also he can change its password that enable him to login to the system.

* Companies Page (companyies.aspx) :

[pic]

Using this page any administrator can View/Edit Enable/Disable any Company on the system, our system is responsible for any company that have finished its period of registration, the system will redirect the company user to update its period in order to login to the system and restart its facilities add edit ,delete products ...etc.

• Users Page (users.aspx) :

[pic]

Any Administrator can view, edit, delete, enable, disable any user in the system. This page will display first all of the users in the system and the will be a link for each user to view its details (user information, user transaction, user balance, user announcements....etc.

• User Announcements (userAnnounce.aspx) :

[pic]

Through this page an administrator can view all of user announcements and also he should enable announcements that are valid and correct for our website.

announcements of users is a free facility for all users that have registered in our system .

* Register Periods (regPeriod.aspx) :

[pic]

Any company that wants to register in our website should pay fees when it chooses the registration period. Administrator is responsible for Editing/View/Adding Registrations Periods that enable companies to choose periods as the price of the periods.

* Administrator Reports (reports.aspx) :

[pic]

This page is used by administrators to get a hardcopy of any company or user information, administrator can view/print/save any report in any format he chooses.

* Transactions Page (transactions.aspx) :

Using this page any administrator can view any transaction of any user or company, its useful when some transactions contain an error as a result of a problem in communications via internet or any other problems.

• Search Functionalities (allSearch.aspx + userSearch.aspx + compSearch.aspx + productSearch.aspx + announceSearch.aspx) :

Any administrator can search for any user by inserting some or its entire user ID or user name.

Any administrator can search for any Company by inserting some or its entire user ID or Responser name.

Any administrator can search for any Product by inserting some or all of its name or Description

Any administrator can search for any announcement by inserting some or all of its name or Description.

And when administrator find what he search for he can do any thing.

The Companies side:

Companies is one of the basic sides in our website, any company that want to take part in our website should first register through the company register page and her the company has to choose the period that it want to present its products in our website.

Companies periods are limited by administrator of the system so the company will not choose any other period that is not included in the system.

After choosing the period, the company has to fill some information about it like addresses, phones, email address, website address, and responser of the company.

The userID and password should be case sensitive, these userID and password are the account information that is used by company when it wants to login to the system and get its facilities that we arranged for it.

The Company Pages:

• The Company Account (compAccount.aspx)

[pic]

Through this page the company will be able to view and change its account information such as addresses, phone numbers, email address, website address …etc.

Company also can update its period of registration which allow it increase the maximum products presented in the system.

• Company Add Products (compAddProduct.aspx):

[pic]

Using this page the company can add more products in the website as the figure above show the company can add products according to its registration period that chose in the registration page or by the update page so the company products is limited according to the fees it pay for us.

Another idea on this page that the company can set its product to be active or inactive when it adds it.

• Company View/Edit Products Page (compEdit.aspx):

[pic]

This page allow companies to view and edit the products that belong for it only so company x can view the products that it has added on the system and later if company x want to change any information about any product such as the amount, price or description for any product it will use this page to accomplish that. And also via this page the company can activate/deactivate products.

The Main Page :

For any web site it should have main page represent the whole project, and give the user or the people how visit the project good facilities to buyer for see the all product and see the all serves on the web site. And the serves that can a chive from the main page:

1- See the Category of the product that the web page give to the user, and see the category product when click on the category.

2- The main page Menu gives the user of the web page facilities to see the Product, Auction, Serves of the Web site and help.

3- In the main page there are to box throw them you can register to the web site as a user or as a company

4- In the top of the page there give facilities to go to login page or go to search page.

5- In the tail of the page there is Product show for the user to buy throw them.

The Login page: Consist of the user name and password that the user or company or admin login throw it, and throw the type of the user that we take it from the data base redirect the user to the correct page, if it a user redirect to User Main Page, if it a Company redirect to Company User Main Page, and if an Admin redirect to Main Page for the Admin. If the user forget his password, can retrieve throw Recover password, we user the session as a security for the page.

Recovery Password: In this Page the user must put his email and user name in the system and it all name that put then the system send to his email the password, we do this for the security in the web page.

Registration: Registration in the web page in tow term for user free, and for company not free.

1- For user: the user can register in our web page to take more serves form our web page.

2- The company that can any company and come to our web site and register on it then it can view it is product, but this not in free, so that we give the company many bids to see which of them is better to the company, that the bids contain a period to show the product and the number of product to show in this period, example 2 month give you 35 product with 30$. If the period of the company end all product of the company do not show, and the company do not login to it user, it redirect to page to choose the period and pay the it will activate.

And in the registration the user or the company gives us information about them.

Search Page: In the Search page give the user to search in the product that the company adds them to the system and the search in the system is in four terms:

1- Product Search, example for search in product x we go to search page and put the name of product in the search textbox and the type choose form the drop down list.

2- Company that add the product search, example search to company1 so we go to search page and put the name of the company then we choose the drop down list to company search.

3- Category of the product search. Example choose category computer then choose drop down list to category search then click search.

4- Announce Search: search on announcement that the user add to the system.

Buy a product:

To buy a product

1- First you go to product and choose the product that you going to buy.

2- Then you click to the product that you choose.

3- You will redirect to the product show .to see the product and the description and all information that may help you in the system.

4- Then after you see the product you choose the mechanism that you will buy the product.

5- Then you go to choose how many product you need to add and then calculate the whole money and then click buy,

6- After the process is successful done then a report give to you of the product, amount of product, your name, address of you, time of buy.

The type of payment to the product:

You can payment to the web page throw tow type on we can use it now another we can use it when the web site become trusted to the people.

Pay Pal payment:

We choose paypal to work with it, because it gives us a virtual environment called the Sandbox.

We have to type to pay throw paypal:

1- Direct Payment: and this done in our web page, we don’t need the user to go to paypal to pay in them web site.

2- Merchant: which you do a hidden page and put on it the user information and the return URL to return to your web site.

We use Direct payment because in the Merchant we need a real IP to return in my web page, put in direct payment we open an connection between our page and paypal and the user put his information in our web site then send them we send them to paypal, and the return to us the response in max time of 30 sec,

The return to us in tow case:

1- If it success the return to us the information

2- If dose not success (if there is an error in the information) it return to us an error number and tow description of the error.

This is the code of the Paypal:

using ASPDotNetSamples;

using ASPDotNetSamples.AspNet;

using com.paypal.sdk.util;

using System.Data.SqlClient;

public partial class PayPal_Default : System.Web.UI.Page

{

com.paypal.sdk.services.NVPCallerServices caller;

protected String ProductID;

protected float Price;

protected int amount;

protected String Comp;

protected Product product;

protected float CompBalance;

protected SqlConnection conn;

protected String productName;

protected int AmountNeed ;

protected void Page_Load(object sender, EventArgs e)

{

product = Session["Product"] as Product;

//The URL contain the product ID;

try

{

if (product == null)

throw new Exception();

}

catch (Exception exp)

{

Response.Redirect("../Main_Page/MainPage.aspx");

}

ProductID = product.Id;

conn = new SqlConnection(ConfigurationManager.ConnectionStrings["connStr1"].ConnectionString);

SqlCommand cmd = new SqlCommand("SELECT CompanyBalance " +

"FROM tblPayPalCompany " +

"WHERE (CompanyUserID = '" + Comp + "')", conn);

conn.Open();

SqlDataReader reader = cmd.ExecuteReader();

while (reader.Read())

{

CompBalance = float.Parse(reader[0].ToString().Trim());

}

conn.Close();

SqlCommand cmd1 = new SqlCommand("SELECT ProductAmount, ProductName " +

"FROM tblProduct "+

"WHERE (ProductNumber = '"+ProductID+"')", conn);

try

{

conn.Open();

SqlDataReader read = cmd1.ExecuteReader();

while (read.Read())

{

amount =int.Parse( read[0].ToString());

productName = read[1].ToString();

}

conn.Close();

}

catch (Exception exp)

{

if (conn.State == ConnectionState.Open)

conn.Close();

}

Price = float.Parse(product.Price);

Comp = product.Describe;

AmountNeed = int.Parse(product.PicName);

Label3.Text = productName;

Label4.Text = Price.ToString()+"$";

try

{

ASPDotNetSamples.AspNet.Global.is3token = true;

SetProfile.SessionProfile = SetProfile.CreateAPIProfile("malekz_1193058726_biz_api1.", "1193058746", "A9bqGHjb1-7GL6DBUhbRfyBBmv4BAauSfvMVT3CwRfn15ixyoXYrHGmT ", "", "");

caller = PayPalAPI.PayPalAPIInitialize();

}

catch (Exception exp)

{

}

}

protected void Button1_Click(object sender, EventArgs e)

{

String TransactionId;

String Address ;

String Name = txtFirstName.Text+" "+txtLastName.Text;

String VisaCard;

String Country = DropDownList1.Text.Trim();

NVPCodec encoder = new NVPCodec();

encoder["METHOD"] = "DoDirectPayment";

encoder["PAYMENTACTION"] = "Sale";

encoder["AMT"] = Price.ToString() ;

encoder["CREDITCARDTYPE"] = DrpCardType.Text.Trim() ;

encoder["ACCT"] = txtCardNumber.Text.Trim() ;

encoder["EXPDATE"] =drpMonth.SelectedValue.Trim()+"/"+drpYear.SelectedValue.Trim();

encoder["CVV2"] = txtVerfication3.Text.Trim() ;

encoder["FIRSTNAME"] =txtFirstName.Text.Trim();

encoder["LASTNAME"] =txtLastName.Text.Trim();

encoder["STREET"] =txtAddress1.Text.Trim();

encoder["CITY"] = "aaa";

encoder["STATE"] = drpState.Text.Trim();

encoder["ZIP"] = txtZipcode.Text.Trim();

encoder["COUNTRYCODE"] = "US";//DropDownList1.SelectedValue.Trim();// txtCountry.Text.Trim();

encoder["CURRENCYCODE"] = "USD";

string pStrrequestforNvp = encoder.Encode();

string pStresponsenvp = caller.Call(pStrrequestforNvp);

NVPCodec decoder = new NVPCodec();

decoder.Decode(pStresponsenvp);

string strAck = decoder["ACK"];

if (strAck != null && (strAck == "Success" || strAck == "SuccessWithWarning"))

{

TransactionId = decoder["TRANSACTIONID"];

Address = txtAddress1.Text + "," + txtAddress2.Text + "," + txtCity.Text + DropDownList1.Text;

string time = decoder["TIMESTAMP"];

VisaCard = txtCardNumber.Text;

SqlCommand cmd = new SqlCommand("INSERT INTO tblPayPal "+

"(TransactionId, Amount, UserName, VisaCard, Address, Country, TransActionTime, ProdcutNumber ,ProductAmount )"

+" VALUES ('"+TransactionId+"','"+Price.ToString()+"','"+Name+"','"+VisaCard+"','"+Address+"','"+Country+"','"+time+"' , '"+ProductID+"') , '"+AmountNeed+"'",conn);

try

{

conn.Open();

cmd.ExecuteNonQuery();

conn.Close();

}

catch (Exception exp)

{

if (conn.State == ConnectionState.Open)

conn.Close();

}

float Balance = CompBalance +Price;

int ProductAmount = amount - AmountNeed;

SqlCommand cmd2 = new SqlCommand("UPDATE tblPayPalCompany " +

"SET CompanyBalance = '" + Balance.ToString() + "' , LastTransactionDate= '"+DateTime.Now.ToString()+"' " +

"WHERE (CompanyUserID = '" + Comp.Trim() + "')", conn);

SqlCommand cmd3 = new SqlCommand("UPDATE tblProduct "+

"SET ProductAmount ='"+ProductAmount+"' "+

"WHERE (ProductNumber = '"+ProductID+"')", conn);

conn.Open();

cmd2.ExecuteNonQuery();

cmd3.ExecuteNonQuery();

conn.Close();

Session.Add("TransactionID", TransactionId);

Response.Redirect("PaypalReport.aspx");

}

else

{

string pStrError =decoder["L_SHORTMESSAGE0"] + "&" +

"Desc2=" + decoder["L_LONGMESSAGE0"];

Response.Redirect("Error.aspx?Msg=" + pStrError + "&"+"ErrorCode=" + decoder["L_ERRORCODE0"]);

}

}

}

}

In this code we give you the principle that we use to pay to paypal.

As you see we use an sdk of the paypal for open the connection.

And you can see that the information that we send to paypal must be encoded and they return the in formation encoded.

We check from the return data the ack if it success we complete and register the transaction to the data base.

Else we redirect the user to an error we page that give you an error number and a description of error take from return response and send the user to error page.

Buy Now:

Buy now is authenticate to the use of the web page only, and it is user to user that have an account in the web page, and this is one of the Features of the system that when the page become trusted that may be used in the system. And we implemented know.

Auction Page:

We implement the auction as that implement in the that the company register in our web page put the product for the auction and put the date of start bid and the date of end the bid.

And the user see the auction in the web page and can put its auction if it is bids max than the max bid put , and the person how put bid must be register in the system for security and for the realism in the auction. The company can put auction date for week month for any period the need.

And the user can put bids until the end date is not come, if a user put a bid the system check if it a user in the web page if it is see the bid that put if max than max_bid put as a new max_bid else talk to user that the bid put less than the Max_Bid and you should put bid than Max_Bid, if the user put bid max than the max_bid the system take the bid and put it as a Max_bid.

And talk to user that your bid is put, and the user can go to it is user and see the auction and see the bids that the user puts.

If the period of auction is end the system not allow to any user to put bid, so the user that put the max bid will have the bid, and he should go and buy the product auction that goes to him.

The User Page:

We build the user page for build an auction that we can not allow to any person to go to auction and out it is bid (it become game) so that we build a user Page that any user can not put an auction else if hi not register in web page as a user .

And we add to it buy now to user of the system to give them more serves of other person, as you know that our project build for small company and so that we not forget the user that need to buy and they do not have an account in the paypal, so hi can open an account in our web page and buy to our web page.

And we give the user ability to add announce to him that put free and the user see his announce and the user how anxious of the announce have an link or an email or address can talk with the announce have.

And we out in the Main user Page system of Messages that put to user a mark that there are anew message to read it. And hi can read all messages and can delete which message read.

And the Main Page Consist of:

Main Page: the main page for a user that put in any web page for user start in his user. And we put to user page search to it and the result view in tow term: term for announce and term for product and auction. And the main page there is many links to user information and balance report…., and there is link or mark if there are new messages and the link to all messages. And in the main page of the user there are an announce view for the user.

User Information:

Give the user information about him, of the user name, password and all information.

And we give the user ability to edit information of them.

User seller:

Give the user of the product that buy from the company, and the date for buy and all information of the product, and give the user ability to view the report of the product buy.

User Auction:

Give the user information about the user bids that put for all products, and in the other tab we view the user product that set to the user.

My Announcement:

Give the user ability to see all announce that the user add in the web page. And give it ability to delete the announcement that dose not need or finish from it. And in announcement we give the user many facilities to put or edit or view the announcement to a chive more user to the system.

Reports:

We give the user many report to user them for the see the information. And there are many type of report we will talk about them now and we will give you an example of this report to see them, this report the user can take them PDF excel word and other many format to user them how he need.

And the next we will give you some of this report as an example to you.

-----------------------

Dec. 10

28

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download