Professional Documents
Culture Documents
Programme/Qualification name:
Each NCC Education assessed assignment submitted by you must have this statement attached to
the assignment as the cover page or it will not be accepted for marking. Please ensure that this
statement is either firmly attached to the cover of the assignment or electronically inserted into the
front of the assignment.
Student declaration
I have read and understood NCC Education’s Policy on Academic Dishonesty and
Plagiarism.
Name:
Centre Name:
Module Name:
Module Leader:
Number of words:
I confirm that this is my own work and that I have not plagiarised any part of it. I
have also noted the assessment criteria and pass mark for assignments.
Due Date:
Student Signature:
Submitted Date:
Advanced Visual Basic 1 September 2010
International Advance Diploma In Computer Studies Advance VB
Acknowledgement
This assignment has provided to individual candidate from NCC for Advance Visual
Basic. In this assignment I have exercised various analyzing and designing techniques.
It is a Task that preparing me to facing competition in the world. I have enjoyed doing
this assignment and while I was doing I have recognize a lot of things. I have face
challenging problems but I have overcome my problems help of my teacher MD.
Nazmul Haque. I also appreciate the greatness of NCC and thanks NCC for giving us
such opportunity. I also thank NCC for providing this kind of Global IT Education.
Finally, I thanks to almighty ALLAH, who give me strength and inspiration to complete
this assignment.
Table of contents
Task Page
Task-1……………………………………………………………………… 4-9
Task-2……………………………………………………………………… 10-16
Task-3……………………………………………………………………… 17-24
Task-4……………………………………………………………………… 25-33
Task-5……………………………………………………………………… 34-47
Task-6……………………………………………………………………… 48-54
Task-7……………………………………………………………………… 55-60
Task-8……………………………………………………………………… 61-62
References ………………………………………………………………....
Task-1
The Scenario:
A new company that intends to trade in used Personal Computers has decided to conduct its
business via the Internet. A Web Site would have to be designed and implemented. In addition a
database would have to be designed, implemented and placed on an Internet service provider
along with the Web Site.
Problem Statement:
Design a database structure that meets the requirements of the system described.
Task Description:
For designing the database at first I have designed a normalization process through which I can
find out the database entities/tables, which are then used as the back-bone data source of the
proposed system.
Normalization is the process of identifying the logical associations between data-items and
designing a database which will represent such associations but without suffering the file
maintenance anomalies.
Unnormalized Data-set:
At first I figured the un-normalized data items out from the given scenario. These are:
(PcId, name, monitor, MBoard, Proccsr, HDD, ram, disk_Drive, UseTime, other, qty, price,
SalesSts, InStockDate, avaibility, TrID, FName, LName, address, sex, contact., country email,
TrUName, TrPasswd, SId, SDate, AdminUserName, AdminPasswd)
Here the data-items of un-normalized dataset which are then divided into two different groups:
repetitive and non-repetitive for creating the first normal form:
Non-Repetitive:
(PcId, name, monitor, MBoard, Proccsr, HDD, ram, disk_Drive, UseTime, other, qty, price,
SalesSts, InStockDate, AdminUName, AdminPasswd)
Repetitive:
(SId, Sdate, TrID, FName, LName, address, sex, contact, country, email, TrUName, TrPasswd)
Stock
(PcId, name, monitor, MBoard, Proccsr, HDD, ram, disk_Drive, UseTime, other, qty, price,
SalesSts, InStockDate, AdminUName, AdminPasswd)
Sales
Trader
(TrID, FName, LName, address, sex, contact, country, email, TrUName, TrPasswd)
Admin
(AdminUName, AdminPasswd)
Stock
(PcId, name, monitor, MBoard, Proccsr, HDD, ram, disk_Drive, UseTime, other, qty, price,
SalesSts, InStockDate, availability)
Sales
Trader
(TrID, FName, LName, address, sex, contact, country, email, TrUName, TrPasswd)
Now I have a set of normalized data-items which are suitable for creating an Entity Relationship
Diagram. From this ERD I can now define the database tables and their relationship and can
assume the whole system operations with the use of this database across the system.
ERD
Trader Stock
PK TrId PK PcId
FName TraderId (Fk)
LName Monitor
Address MBoard
sex Proccsr
contact HDD
country Ram
email Disk -Drive
TrUName UseTime
TrPasswd other
qty
Price
SaleSts
InStockDate
Sales
PK SId Admin
Database structure:
Here the structure of the database is represented. This database structure is derived from the
ERD.
This structure defined the data needed with their data-type and other properties:
Database Tables:
There are three four tables that I found from the ERD. These are:
1) Stock.
2) Trader.
3) Sales.
4) Admin.
Stock Table:
Field Name Data Type Length Null? Primary key Foreign key
name Varchar 50 No
Monitor Varchar 50 No
MBoard Varchar 30 No
Proccsr Varchar 50 No
HDD Varchar 50 No
Ram Varchar 50 No
Disk_Drive Varchar 50 No
UseTime Varchar 20 No
qty int 10 No
Trader Table:
Field Name Data Type Length Null? Primary key Foreign key
TrUName Varchar 80 No
Passwd Varchar 20 No
Sales Table:
Field Data Length Null? Primary Foreign Constant Name Ref Ref
Name Type key key Table Column
Task-2
Problem Statement:
Using either Microsoft Access or SQL Server set up the structure of the database designed in
Task 1. Design suitable test data for the tables of the database that has been set up. Using the
database management system or other means enter this test data.
Task Description:
I used Microsoft SQL Server as my database management system and set up the structure of
the database designed in Task 1 that I completed earlier. This designing phase was including
several steps as follows:
I have designed a database based on the structure from the earlier task. This database is
placed in the App_Data folder of the project. These designing steps are as follows:
• From the Visual Studio installed templates select SQL Server Database.
• Click Add.
After connecting it to the SQL server I set up the necessary tables by following these steps:
• Filled the column name with my data-items, their type and other properties identified in
task 1.
My database tables:
Stock table:
Trader Table:
Sales Table:
Admin table:
Trader Table:
Sales Table:
Admin Table:
End of Task-2
Tsak-3
Problem Statement:
In this task I have been asked to:
Design the user interfaces of the SIX interactive Web Forms that correspond to the six Web
Pages named in the Introduction.
Problem Decomposition:
Banner
News Home
Footer section
Banner
“some text
for latest Picture
news”
Pc ID
Name
Processor
Monitor
Motherboard
Hard Disk
Ram
Disk Drive
Other
Used time
Quantity
Price
In Stock Date
Buy
Footer section
Banner
News Search
“some text Search by product Name:
for latest
news”
Product Name:
Search Result
Footer section
Banner
News Registration
“some text
for latest Register With onlinetrade.com
news” First Name:
Last Name:
Address:
Sex:
Contact:
Country:
Email:
User Name:
Password:
Re-Type Password:
Submi Reset
t
Footer section
Design of the Product Upload Page:
Banner
Monitor:
Mother Board:
Processor:
Hard Disk:
Ram:
Disk-Drive:
Use time:
Other:
Quantity:
Price:
In Stock date:
Submi Reset
t
Footer section
Design of the Purchase Page
Banner
Price:
Quantity:
Availabl
e?
Date :
Confirm
Buy
Footer section
Banner
Confirm buying
Footer section
End Of Task-3
Task-4
Problem Statement:
In this task I have been asked to:
Design the logical processes including the connections to the database that will have to lie
behind the interfaces designed in Task 3. These designs to include the design of all the
algorithms required.
Task Description:
At first I have designed the algorithm for database connection to connect with my database.
Then the entire important algorithm for operating and maintaining of this website are described
below:
• Then this object will try to connect to the SQL Server as path specified into
ConnectionString.
While any operation or page try to connect to the database for interaction with it, then this
algorithm will come into action.
Start
Input
ConnectionString
/DB URL
No
Conne
ct ? Error
Message
Yes
Do Operation
End
This algorithm worked out while any type of Authentication and authorization take place as well
as an admin login to the admin page.
Start
Load page
Enter username
Enter
password
Establish Connection
Match No
?
Error
Yes Message
Login Successful
and Redirect to
Default Page
End
Pages applied: Stock page, Search page, Admin Product Detail page, Admin Trader
Detail page, Admin Sales Detail page.
Although Search page depends on the user input but others are retrieve necessary
information directly from the database based on the primary key.
Start
User Input:
Product name
Establish
Connection
Search in stock
table
Fou No
nd?
Display Record
for product
End
Algorithms for Save/Write data in database:
• Load the input form.
This algorithm is correspondence to Registration page and upload product page. While
a user will input all necessary field of the form and click the “submit” button then the
page check the validation. If any invalid data inserted it will produce appropriate error
message. If all fields are filled-up correctly then the page trying to connect to the
database. If it gets connection then save these users input in the table fields.
Start
Check
Not valid
Validati
on?
Error Message
Valid
Establish
Connection
Check Unsuccessful
No
Section Message
and
save? Don’t Save
Yes
Successful
message
End
This page needs to check the user authorization for make a purchase from this website.
Only authorized and authenticate user can get entrance into this page and make
purchase. The algorithm for this page is as follows:
Select the
product to buy
Che Not
ck Authorized
user Redirect to Log In
? page
Authoriz
ed
Input Quantity
Check
Not Available
availabi
lity?
Show Message
Available
Show message
Flow Chart for buy Page:
Process buy
End
International Advance Diploma In Computer Studies Advance VB
End of Task-3
Task-5
Problem Statement:
In this task I have asked to:
Implement and test all that has been designed in Tasks 3 and 4.
Task Description:
In task-3 I was created a rough scratch of six pages that correspond to the six Web
Pages named in the Introduction and in task-4 I have designed the algorithms of all
interaction takes place of these web-pages with the database.
Here I would like to represent that how I implemented these pages and algorithms in
real. I used Visual studio 2005 to create these pages and interaction. I used the
following languages, tools and technology for this purpose in Visual Studio environment:
• XHTML
• CSS
• SQL
Implementation of task 3:
Log In Page:
For implementing this page I use the XHTML code with CSS which are in an external
file named “Style Sheet.css” in the project folder.
Search Page:
For implementing this page I use the XHTML code with CSS which are in an external
file named “Style Sheet.css” in the project folder.
Registration Page:
For implementing this page I use the following XHTML code with CSS which are in an
external file named “Style Sheet.css” in the project folder.
Purchase Page:
For implementing this page I use the following XHTML code with CSS which are in an
external file named “Style Sheet.css” in the project folder.
Maintenance page:
For implementing this page I use the following XHTML code with CSS which are in an
external file named “Style Sheet.css” in the project folder.
Part-2
Implementation of Task-4:
Implementation of dataset connection algorithm:
Code for connecting to the database:
Public Class DBU
Dim con As SqlConnection
• In a sub procedure I declare variable of type string which was initiated the
ConnectionString of the file name and path of the data source including other
attributes.
• This connection object is used whilst the application is trying to connect to the
database.
Dim str As String = String.Format("SELECT * FROM Trader Where TrName='" & Uname & "' and
Passwd='" & Pass & "'")
Dim db As New DBU
Dim a As ArrayList = db.Query(str)
Dim chk As Integer = a.Count
If chk <> 0 Then
Session("un") = txtUserName.Text
Response.Redirect("Stock.aspx")
Else
lblWrongUser.Visible = True
End If
End Sub
End Class
• While the authorized user name and password are inserted and submit button clicked
then the page will redirect to stock page.
• if unauthorized person try to log in with wrong user name or password an error message
will appear in the same page as like:
Here is the code of implementation by which I implemented the algorithm for write data
into database tables:
In page
Partial Class Registration
Inherits System.Web.UI.Page
End Sub
End Class
Code in action:
Implemented code in real page environment:
txtPName.Text = ""
txtMonitor.Text = ""
txtMBoard.Text = ""
txtProccssor.Text = ""
txtHDD.Text = ""
txtRam.Text = ""
txtDiskDrive.Text = ""
txtUTime.Text = ""
txtOther.Text = ""
txtQty.Text = ""
txtPrice.Text = ""
End Sub
End Sub
• Then choose the data connection that the application will use to connect to the
database:
Now the “Details View” is ready for retrieve and display the stock information:
End of Task-5
Task-6
Problem Statement:
Task description:
System Testing:
I select some suitable data set for system testing. Then these data were implemented
into the system. The testing process and suitable screenshot are represented below:
The result of every link is success. That means all Menu link work correctly.
Field Validation (Page: Error Message Before Error Message Before Showed
Registration, upload Submit Submit
product)
The every actions were work properly in this website. All the section design and tested well.
When invalided username or password is given the system will redirect ronguser.jsp page
Field Validation:
Successful Upload:
Field Validation:
Successful Purchase:
End of Task-6
Task-7
Problem Statement:
Produce a user guide. This guide should contain suitable screen shots.
Task Description:
In this task I produced the user guide which will guide the user to use this website
perfectly. Please read this user guide carefully so that it can help you to effeciantly uses
this website and pages.
You always require logging in to view some protected pages of this sit e. these
protected pages are:
3. Search page.
Usually you don’t have any log in name and password until you registered with this
website.
If you are not registered then click on the registration link from the menu:
After a successful registration you can now enable to log in with the user name and password
you just registered.
If you are admin you have to log in through admin log in page to view the company’s data about
trader, sales, product etc.
The log in process is same as trader log in except you have to collect your admin log in name
and password from the system administrator.
• Fill necessary field and click submit to save your product information.
• The page will redirect you to the purchase page where the product id , name and price
will be displayed.
• Then the search result of your selected product will display below. Like:
Task-8
Problem Statement:
Produce a publishable working copy of the completed assignment together with some
installation notes.
Task Description:
This task is completed and included with this hard copy in CD-ROM, which contains the
publishable copy of the completed assignment with some installation notes.
References
Book References:
Professional ASP.NET 2.0 Published By Willey publishing, Inc Edition 2006
By.
Bill Evjrn
Scott HAnselman
Farhan Muhammad
Web References:
http://www.developer.com/net/asp/article.php/3299641/ServerTransfer-Vs
ResponseRedirect.htm
http://support.microsoft.com/kb/312063
http://www.w3schools.com/aspnet/default.asp
http://www.asp101.com/lessons/validation.asp
http://forums.asp.net/p/1562682/3876825.aspx
http://www.microsoft.com/sqlserver/2005/en/us/default.aspx
http://support.microsoft.com/ph/13165
http://www.sql-server-performance.com/
http://blog.sqlauthority.com/2006/11/01/sql-server-query-to-display-foreign-key-relationships-
and-name-of-the-constraint-for-each-table-in-database/
http://msdn.microsoft.com/en-us/library/aa258255(SQL.80).aspx
http://www.vbforums.com/showthread.php?t=366078
http://msdn.microsoft.com/en-us/library/8z6watww(VS.71).aspx