Professional Documents
Culture Documents
Background
Existing System
1
SS TECH BOOK STORE
SYSTEM SUMMARY
The company has now decided to expand its operations and plans
worldwide.
2
SS TECH BOOK STORE
CONFIGURATION
3
SS TECH BOOK STORE
4
SS TECH BOOK STORE
5
SS TECH BOOK STORE
6
SS TECH BOOK STORE
users.
Registration module to register a new user.
Core module 1 to implement the search functionality to
7
SS TECH BOOK STORE
8
SS TECH BOOK STORE
E-R DIAGRAM
9
SS TECH BOOK STORE
10
SS TECH BOOK STORE
Search.aspx.cs ShoppingCart.aspx
Search.aspx
ShoppingCart.aspx.cs
Login.aspx Login.aspx.cs
CreditCard.aspx.cs
Registration.aspx.cs
CheckOut.aspx
CheckOut.aspx.cs
11
SS TECH BOOK STORE
12
SS TECH BOOK STORE
13
SS TECH BOOK STORE
display
the books of a selected
category in data grid
and store
the books selected by
the user
in the shopping cart.
7 ShoppingCart.aspx Contains User
Interface that
displays the final list of
all the
selected books in the
shopping
cart with an option to
remove
any of the selected
books from
the cart. It also has a
link to
the Credit Card details
page
for the payment.
8 ShoppingCart.aspx.cs Contains the code to
accept
the details of the books
purchased by the user
and
calculates the total bill
that the
user needs to pay.
9 CardDetails.aspx Contains the UI that
displays
the form to accept the
credit
card details to make
the
14
SS TECH BOOK STORE
15
SS TECH BOOK STORE
creation of
bill.
13 CurrencyConverter.asmx This is a Web service,
which
converts total book
price
amount in different
world
currencies.
14 CurrencyConverter.asmx.cs Contains the code to
declare
the Web service
method
converting book price
in
different world
currencies.
15 Header.ascx Contains the web
control for
header layout common
to
every page.
16
SS TECH BOOK STORE
What is ASP.Net?
The detailed discussion about IIS has been given as separate topic.
17
SS TECH BOOK STORE
particular web site and has special software installed to send these web
pages to web browsers that request them.
ABOUT HTML:
18
SS TECH BOOK STORE
Design goals
19
SS TECH BOOK STORE
Language name
The name "C sharp" was inspired from musical notation where a sharp
indicates that the written note should be made a half-step higher in
20
SS TECH BOOK STORE
The "sharp" suffix has been used by a number of other .NET languages that
are variants of existing languages, including J# (a .NET language also
designed by Microsoft which is derived from Java 1.1), A# (from Ada), and
the functional F#.The original implementation of Eiffel for .NET was called
Eiffel#, a name since retired since the full Eiffel language is now supported.
The suffix has also been used for libraries, such as Gtk# (a .NET wrapper for
2GTK+ and other GNOME libraries), Cocoa# (a wrapper for Cocoa) and 1Qt#
(a .NET language binding for the Qt toolkit).
History
During the development of the .NET Framework, the class libraries were
originally written using a managed code compiler system called Simple
Managed C (SMC).In January 1999, Anders Hejlsberg formed a team to
build a new language at the time called Cool, which stood for "C-like Object
21
SS TECH BOOK STORE
James Gosling, who created the Java programming language in 1994, and
Billy Joy, a co-founder of Sun Microsystems, the proprietor of Java, called C#
an "imitation" of Java; Gosling further claimed that "[C# is] sort of Java with
reliability, productivity and security deleted."Klaus Kreft and Angelika
Langer (authors of a C++ streams book) stated in a blog post that "Java and
C# are almost identical programming languages. Boring repetition that lacks
innovation," "Hardly anybody will claim that Java or C# are revolutionary
programming languages that changed the way we write programs," and "C#
borrowed a lot from Java - and vice versa. Now that C# supports boxing and
unboxing, we'll have a very similar feature in Java."
22
SS TECH BOOK STORE
Versions
In the course of its development, the C# language has gone through several versions:
Versio Language
Microsoft Compiler
n Specification
Features
23
SS TECH BOOK STORE
24
SS TECH BOOK STORE
25
SS TECH BOOK STORE
SQL Server is one of the most popular RDBMS of today. Its Popularity is
owned to a number of factors like its ability to support dozens to thousands
of simultaneous users, its ability to handle high transaction rates and its
ability to access databases that ranges in size from several hundred
megabytes to many gigabytes.
26
SS TECH BOOK STORE
27
SS TECH BOOK STORE
28
SS TECH BOOK STORE
---------------------------------------------------------------------------------------------------------------------------------
---------------
CardDetails.aspx.CS
---------------------------------------------------------------------------------------------------------------------------------
---------------
using Microsoft.VisualBasic;
using System.Data;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System;
using System.Collections;
using System.Web;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Drawing;
using System.Data.SqlClient;
using System.Text.RegularExpressions;
namespace SSTBS
{
/// <summary>
/// Summary description for CardDetails.
/// </summary>
public partial class CardDetails :
System.Web.UI.Page
{
29
SS TECH BOOK STORE
/// <summary>
/// Required method for Designer support -
do not modify
/// the contents of this method with the
code editor.
/// </summary>
private void InitializeComponent()
{
}
#endregion
try
30
SS TECH BOOK STORE
{
SqlConnection Con = new
SqlConnection("Integrated Security=True;Initial
Catalog=SSTBS; Data Source=CLIENTBASE01");
int RetVal;
Con.Open();
Session["netAmount"] =
CalculateAmount();
SqlCommand cmd = new
SqlCommand("INSERT INTO
Payment(TotalAmount,UserName,CreditCardNum,CreditCa
rdType) Values(" + Session["netAmount"] + ",'" +
Session["UserName"] + "','" + txtCardNo.Text +
"','" + ddlCardType.SelectedItem.Text + "')", Con);
RetVal = cmd.ExecuteNonQuery();
if (RetVal > 0)
{
int i;
object BillNo = GetBillNo();
for (i = 1; i <=
myCollection.Count; i++)
{
SqlCommand cmd1 = new
SqlCommand("Insert into Bill(BillNo,BookID) values
(" + BillNo + "," + myCollection[i] + ")", Con);
RetVal =
cmd1.ExecuteNonQuery();
if (RetVal == 0)
{
lblError.Text =
"Error occured while updating transactions..Please
contact system administrator";
break;
}
}
}
31
SS TECH BOOK STORE
else
{
lblError.Text = "Error occured
while updating transactions..Please contact system
administrator";
}
Con.Close();
Con.Dispose();
}
catch (Exception)
{
lblError.Text = "Error occurred
while card validation. Please contact system
administrator.";
}
}
32
SS TECH BOOK STORE
SqlString = SqlString +
myCollection[i] + ")";
SqlDataAdapter da = new
SqlDataAdapter(SqlString, Con);
Con.Open();
DataSet ds = new DataSet();
da.Fill(ds);
NetAmount =
System.Convert.ToDouble(ds.Tables[0].Rows[0]
["sum"]);
Con.Close();
Con.Dispose();
return NetAmount;
}
catch (Exception)
{
lblError.Text = "Error occurred.
Please contact system administrator.";
return 0;
}
}
33
SS TECH BOOK STORE
billNo = (int)dr[0];
}
else
{
billNo = 0;
}
Session["BillNo"] = billNo;
dr.Close();
return billNo;
}
catch (Exception)
{
lblError.Text = "Error occurred.
Contact system admnistrator";
return 0;
}
34
SS TECH BOOK STORE
}
else if
((ddlMonth.SelectedValue.Trim().ToString() == "0")
|| (ddlYear.SelectedValue.Trim().ToString() ==
"0"))
{
lblError.Text =
lblError.Text + " Please select valid date.";
}
else
{
InsertPayment();
Response.Redirect("CheckOut.aspx");
}
}
}
catch (Exception)
{
lblError.Text = "Error occurred
while submission. Please contact system
administrator.";
}
}
}
---------------------------------------------------------------------------------------------------------------------------------
---------------
CheckOut.aspx.cs
---------------------------------------------------------------------------------------------------------------------------------
---------------
using Microsoft.VisualBasic;
using System.Data;
using System.Web.UI;
using System.Web.UI.HtmlControls;
35
SS TECH BOOK STORE
using System;
using System.Collections;
using System.Web;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Drawing;
using System.Data.SqlClient;
using SSTBS;
namespace SSTBS
{
/// <summary>
/// Summary description for CheckOut.
/// </summary>
public partial class CheckOut :
System.Web.UI.Page
{
36
SS TECH BOOK STORE
/// <summary>
/// Required method for Designer support -
do not modify
/// the contents of this method with the
code editor.
/// </summary>
private void InitializeComponent()
{
}
#endregion
37
SS TECH BOOK STORE
myCollection[i] + ")";
try
{
SqlConnection con = new
SqlConnection("Integrated Security=True;Initial
Catalog=SSTBS; Data Source=CLIENTBASE01");
SqlDataAdapter da = new
SqlDataAdapter(SqlString,con);
da.Fill(ds);
dgCheckOut.DataSource = ds;
dgCheckOut.DataBind();
}
catch (Exception)
{
lblError.Text = "Error
occurred...";
}
}
private void GetBillInfo ()
{
SqlConnection cn = new
SqlConnection("Integrated Security=True;Initial
Catalog=SSTBS; Data Source=CLIENTBASE01");
SqlDataAdapter da = new
SqlDataAdapter("Select max(BillNo) as
billno,max(Currentdate) as date from Payment where
UserName='" + Session["Username"] + "'", cn);
DataSet ds = new DataSet();
try
{
cn.Open();
da.Fill(ds);
BillNo =
System.Convert.ToInt32(ds.Tables[0].Rows[0][0]);
BillDate =
System.Convert.ToDateTime(ds.Tables[0].Rows[0][1]);
}
catch (Exception ex)
38
SS TECH BOOK STORE
{
lblError.Text = ex.Message;
//lblError.Text = "Error occurred
while creating bill. Contact system admnistrator"
}
}
private void BillReport ()
{
try
{
localhost.CurrencyConverter cc =
new localhost.CurrencyConverter();
double[] ArrCurrency =
cc.GetCurrencyInfo(System.Convert.ToDouble(Session[
"netAmount"]));
lblBillNo.Text =
BillNo.ToString();
lblBillDate.Text =
BillDate.ToString();
lblINR.Text =
string.Format("{0:C}", Session["netAmount"]);
lblEuro.Text =
ArrCurrency[0].ToString();
lblRuble.Text =
ArrCurrency[1].ToString();
lblYen.Text =
ArrCurrency[2].ToString();
lblPound.Text =
ArrCurrency[3].ToString();
}
catch (Exception)
{
lblError.Text = lblError.Text +
"Error occurred while creating Bill.";
}
39
SS TECH BOOK STORE
}
}
---------------------------------------------------------------------------------------------------------------------------------
---------------
Login.aspx.cs
---------------------------------------------------------------------------------------------------------------------------------
---------------
using System.Data;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System;
using System.Collections;
using System.Web;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Drawing;
using System.Data.SqlClient;
using System.Web.Security;
namespace SSTBS
{
/// <summary>
/// Summary description for Login.
/// </summary>
public partial class Login : System.Web.UI.Page
{
40
SS TECH BOOK STORE
e)
{
//
// CODEGEN: This call is required by
the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support -
do not modify
/// the contents of this method with the
code editor.
/// </summary>
private void InitializeComponent()
{
}
#endregion
41
SS TECH BOOK STORE
if
(string.Compare(dr["Password"].ToString(), passwd,
false) == 0)
{
dr.Close();
Session["Username"] =
uid;
return true;
}
}
dr.Close();
return false;
}
catch (Exception)
{
lblError.Text = "Error occured
while validating user. Please contact system
administrator.";
return false;
}
}
FormsAuthentication.SetAuthCookie(txtUserName.Value
.Trim(), false);
42
SS TECH BOOK STORE
Response.Redirect("Search.aspx");
}
}
}
}
---------------------------------------------------------------------------------------------------------------------------------
---------------
Registration.aspx.cs
---------------------------------------------------------------------------------------------------------------------------------
---------------
using Microsoft.VisualBasic;
using System.Data;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System;
using System.Collections;
using System.Web;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Drawing;
using System.Data.SqlClient;
using System.Web.Security;
namespace SSTBS
{
/// <summary>
/// Summary description for Registration.
/// </summary>
public partial class Registration :
System.Web.UI.Page
{
43
SS TECH BOOK STORE
/// <summary>
/// Required method for Designer support -
do not modify
/// the contents of this method with the
code editor.
/// </summary>
private void InitializeComponent()
{
}
#endregion
44
SS TECH BOOK STORE
if
(string.Compare(dr["UserName"].ToString(),
UserName, false) == 0)
{
dr.Close();
return true;
}
}
dr.Close();
return false;
}
45
SS TECH BOOK STORE
}
catch (Exception ex)
{
lblErr.Text = ex.Message + " :
Please contact your administrator";
}
return rowsAffected;
}
if
(CheckUserName(txtUserName.Value))
{
UsrLabel.Font.Bold = true;
UsrLabel.Text = "Username
exists..Please choose another Username";
46
SS TECH BOOK STORE
UsrLabel.Visible = true;
}
else
{
if
(InsertRecord(txtUserName.Value, txtPassword.Value,
txtFirstName.Value, txtMiddleName.Value,
txtLastName.Value, txtAddress1.Value,
txtAddress2.Value, txtCity.Value, txtState.Value,
txtZip.Value, txtEmail.Value, txtTelephone.Value)
== 0)
{
lblErr.Font.Bold = true;
lblErr.Text = "Error
occurred while creating your account..Plz contact
the system administrator";
lblErr.Visible = true;
}
else
{
Response.Redirect("login.aspx");
Response.Write("You Have
Been Registered. Log On To Proceed");
}
}
}
}
---------------------------------------------------------------------------------------------------------------------------------
---------------
47
SS TECH BOOK STORE
Search.aspx.cs
---------------------------------------------------------------------------------------------------------------------------------
---------------
using Microsoft.VisualBasic;
using System.Data;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System;
using System.Collections;
using System.Web;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Drawing;
using System.Data.SqlClient;
namespace SSTBS
{
/// <summary>
/// Summary description for Search.
/// </summary>
public partial class Search :
System.Web.UI.Page
{
48
SS TECH BOOK STORE
myCollection =
(Collection)Session["BookIds"];
}
lblError.Text = "";
if (! IsPostBack)
{
pnlBookList.Visible = false;
pnlCombo.Visible = true;
ddlSelectCategory.Items.Add(new
ListItem("Select A Category"));
FillDDL();
// CreateTable()
}
}
/// <summary>
/// Required method for Designer support -
do not modify
/// the contents of this method with the
code editor.
/// </summary>
private void InitializeComponent()
{
this.dgBooklist.ItemCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandl
er(this.dgBooklist_ItemCommand);
49
SS TECH BOOK STORE
}
#endregion
ddlSelectCategory.Items.Add(new
ListItem(dr[0].ToString()));
}
dr.Close();
}
catch (Exception ex)
{
lblError.Text = ex.Message;
}
}
50
SS TECH BOOK STORE
int i;
for (i = 1; i <=
myCollection.Count; i++)
{
if (myCollection[i].ToString()
==
dgBooklist.Items[e.Item.ItemIndex].Cells[0].Text.To
String())
{
lblError.Text = "Book
already in the shopping cart";
return;
}
}
myCollection.Add(dgBooklist.Items[e.Item.ItemIndex]
.Cells[0].Text.ToString(),
dgBooklist.Items[e.Item.ItemIndex].Cells[0].Text.To
String(), null, null);
//Session("myCart") = myCollection
}
protected void
ddlSelectCategory_SelectedIndexChanged(object
sender, System.EventArgs e)
{
DataSet ds = new DataSet();
string SqlString;
pnlBookList.Visible = true;
SqlString = "Select * from BookDetails
Where CategoryName ='" +
ddlSelectCategory.SelectedItem.Text + "'";
try
{
SqlConnection cn = new
SqlConnection("Integrated Security=True;Initial
51
SS TECH BOOK STORE
da.Fill(ds);
dgBooklist.DataSource = ds;
dgBooklist.DataBind();
}
catch (Exception ex)
{
lblError.Text = ex.Message;
}
Response.Redirect("ShoppingCart.aspx");
}
}
}
---------------------------------------------------------------------------------------------------------------------------------
---------------
ShoppingCart.aspx.cs
---------------------------------------------------------------------------------------------------------------------------------
---------------
using Microsoft.VisualBasic;
using System.Data;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System;
using System.Collections;
using System.Web;
using System.Web.UI.WebControls;
using System.Configuration;
52
SS TECH BOOK STORE
using System.Drawing;
using System.Data.SqlClient;
namespace SSTBS
{
/// <summary>
/// Summary description for ShoppingCart.
/// </summary>
public partial class ShoppingCart :
System.Web.UI.Page
{
53
SS TECH BOOK STORE
SqlString = SqlString +
myCollection[i].ToString() + ", ";
}
SqlString = SqlString +
myCollection[myCollection.Count].ToString() + ")";
try
{
SqlConnection con = new
SqlConnection("Integrated Security=True;Initial
Catalog=SSTBS; Data Source=CLIENTBASE01");
SqlDataAdapter da = new
SqlDataAdapter(SqlString, con);
da.Fill(ds);
dgShoppingCart.DataSource = ds;
dgShoppingCart.DataBind();
}
catch (Exception ex)
{
lblError.Text = ex.Message;
}
}
/// <summary>
/// Required method for Designer support -
do not modify
54
SS TECH BOOK STORE
}
#endregion
private void
dgShoppingCart_ItemCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs
e)
{
if (e.CommandName == "REMOVE")
{
myCollection.Remove(dgShoppingCart.Items[e.Item.Ite
mIndex].Cells[0].Text);
FillCartGrid();
}
}
}
}
---------------------------------------------------------------------------------------------------------------------------------
---------------
CurrencyConverter.asmx.cs
---------------------------------------------------------------------------------------------------------------------------------
---------------
using System;
55
SS TECH BOOK STORE
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
namespace SSTBS
{
/// <summary>
/// Summary description for CurrencyConverter.
/// </summary>
public class CurrencyConverter :
System.Web.Services.WebService
{
public CurrencyConverter()
{
//CODEGEN: This call is required by
the ASP.NET Web Services Designer
InitializeComponent();
}
/// <summary>
/// Required method for Designer support -
do not modify
/// the contents of this method with the
code editor.
/// </summary>
private void InitializeComponent()
{
}
/// <summary>
56
SS TECH BOOK STORE
#endregion
[WebMethod()]
public double[] GetCurrencyInfo(double
Currency)
{
double[] currencyInfo = new double[4];
//European Union Euro equivalent of
dollar
currencyInfo[0] = 0.88 * Currency;
//Japanese Yen equivalent of dollar
currencyInfo[1] = 113.98 * Currency;
//Russian Ruble equivalent of dollar
currencyInfo[2] = 30.53 * Currency;
//United Kingdom Pound equivalent of
dollar
currencyInfo[3] = 0.61 * Currency;
57
SS TECH BOOK STORE
Snapshots
1. On the login page user have to enter the User Name and Password for shopping, if it is
not created than click on Registration link for registration with SSTBS online shopping.
58
SS TECH BOOK STORE
2. For searching the books user has to select the category and then category of the books
will be displayed and user can add the books to his cart by clicking on the Add To Cart
Link. Then user can see his cart by clicking on the Show My Cart Link.
59
SS TECH BOOK STORE
REGISTRATION
CHECK OUT
60
SS TECH BOOK STORE
CARD DETAILS
61
SS TECH BOOK STORE
62
SS TECH BOOK STORE
SEARCH
63