Stock Management
Stock Management
Project ID
08
A
Project Report On
Stock Management
Submitted in the Partial fulfillment of the requirement for awarding the degree of
By
Uravi Movaliya
Riddhi Ghadiya
This report contains all the outputs of a project undertaken to develop a working
model of Stock Management and to study the existing working system. As part of this
study, we analyzed the requirements of the working model and tried to improve it using the
technological functionality that the current computer science provides.
This volume contains the documentation summary of the working system, the
background study and analysis, the technical requirements and the working specification of
the developed system.
We recommend the user to take the advantage of the study presented here and
implement the system with their required improvisation. We hope this study will reduce
the burden of the reanalysis of the development phase.
Acknowledgment
“It is not possible to prepare a project report without the assistance &
encouragement of other people. This one is certainly no exception.”
On the very outset of this report, We would like to extend our sincere & heartfelt
obligation towards all the personages who have helped us in this endeavor. Without their
active guidance, help, cooperation & encouragement, we would not have made headway in
the project. We are ineffably indebted to our HOD / Prof. Jitendra Kabariya for
conscientious guidance and encouragement to accomplish this assignment.
We are extremely thankful and pay our gratitude to our project guide
Prof. Darshit Somaiya his valuable guidance and support on completion of this project in
its presently.
Thanking You
1 Project Profile
1.1 Definition 1
1.2 Scope 1
1.3 Objective 1
4 System Design
4.1 Data Flow Diagram 10
5 Screen Design 16
6 Coding 30
8 Enhancements
8.1 Advantages 104
9 References 105
A Project Report on: Stock Management
1-Project Profile
1.1 Definition
1.2 Scope
1.3 Objective
INTRODUCTION
Preliminary Investigation
The Computer Marketing System is web application which can be used by the user
whenever new user came at a time.They required to register.
People can see the television advertisement and get the information about of
electronic shopping.
Such as TV, Hair Machine, AC, Fan, Laptop, Mobile, Washing Machine in etc. Item
stock: Admin can manage the stock and product.
User can show the category and product.user can show the product and purchase the
product and get the information about our stock.
FEASIBILTY STUDY
Feasibility study is the likelihood that whether the system will be useful to the
organization or not. After studying the requirements, whether the proposed project is feasible
or not is determined by checking the various feasibilities.
The main aim of the feasibility study is to determine whether developing system is
financially and technically feasible. The feasibility study involves analysis of the problem
and collection of data which would be input to the system, the processing required to be
carried out on these data, the output data required to be produced by the system, as well as
study of various constraints on the behavior of the system.
The three aspects in the feasibility study portion are:
Technical Feasibility
Economical Feasibility
Operational Feasibility
Technical Feasibility
In order to develop the web-application except some basic requirement there is no need of
extra technology. Also no other workforce is required to develop the application. Yes,
Internet is required but you can also run it off-line by sharing
Technical Feasibility
Hardware Specification
RAM 1 or 2 GB
Mouse Optical
.
Software Specification
Economical Feasibility
The organization is ready to invest in the proposed system for latest technology and
better result.
As the personnel and the manager know the computer operating, the unit need not
have to appoint any computer operator.
If any of the staff in the firm knows how to operate the computer, than the firm needs
number to recruit a new person.
The unit has to spend not much amount for the computer hardware and software.
The organization is capable for paying the money for proposed system.
Therefore the project possesses the economical feasibility.
Economical Feasibility
CSS, JS Free
Front End
ASP .NET ₹ 1,999
Operational feasibility
The operational feasibility deals with the matter whether the proposed system fulfills
the requirement of the firm or the department requirement.
The operational feasibility deals with the matter whether the proposed system fulfills the
requirement of the user or not. The possibility of the operational feasibility is as under.
Those who have the knowledge of Internet and regularly surfing the sites can easily make
a visit to the site. They would not require special skills, just follow the links or use site-maps.
User side
Home:
Register:
Login:
Feedback:
Product:
Purchase:
Admin side
Login:
Register:
Category:
Sub Category:
Admin can view, add, update or delete the sub category in the site.
Stock:
Admin can view, add, update or delete the stock in the side.
View Feedback:
View Product:
View Purchase:
View Stock:
4-System Design
This System is used the data flow diagram array following meaning.
It Symbolized Connectivity
Unmarked Line without a.
It Symbolized Connectivity
Marked Line without a.
It Symbolized Connectivity
Round Rectangle without a.
4.2 0-level:
4.3 1-level:
Registration:
Feedback:
Category:
Sub category:
Product:
Add to cart:
Bill :
Bill 1:
Home:
Registration:
Login:
Changepassword:
Forgot password1:
Forgot password2:
Forgot password3:
User side:-
Home1:
Contact us:
Product:
Shopping cart:
User purchase:
Thankyou:
Feedback:
Admin side:-
View Registration:
View feedback:
View category:
Add category:
View subcategory:
Add subcategory:
View product:
Add product:
View purchase:
6-Coding
Stock.master:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="stylesheet/style.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div id="wrapper">
<div id="header">
<div id="float_left">
<asp:Image ID="image1" runat="server" ImageUrl="~/image/9.jpg"
Height="100px" Width="119px" />
</div>
<div id="float_right">
<asp:LinkButton ID="user_login" runat="server"
PostBackUrl="~/user/login.aspx"><img src="../image/4.jpg" height="50" width="50"
/></asp:LinkButton>
<asp:LinkButton ID="user_logout" runat="server"
OnClick="user_logout_Click"><img src="../image/69.gif" height="50" width="60"
/></asp:LinkButton></br>
<asp:Label ID="wel_msg" runat="server" Text=""
ForeColor="Black"></asp:Label></br>
<asp:LinkButton ID="user_changepass" runat="server"
PostBackUrl="~/user/changepass.aspx"
ForeColor="Black">Changepassword</asp:LinkButton>
</div>
<div id="header_title">
<b>Stock Management </b>
</div>
</div>
<div id="menu" align="left">
<b>
<asp:LinkButton ID="user_home" runat="server"
PostBackUrl="~/user/home.aspx">Home</asp:LinkButton>
<asp:LinkButton ID="user_about_us" runat="server"
PostBackUrl="~/user/about_us.aspx">About us</asp:LinkButton>
<asp:LinkButton ID="user_contact_us" runat="server"
PostBackUrl="~/user/contact_us.aspx">Contact us</asp:LinkButton>
<%--- %><asp:LinkButton ID="user_feedback" runat="server"
PostBackUrl="~/user/feedback.aspx">Feedback</asp:LinkButton>---%>
Stock.master.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
{
if(Session.Contents.Keys.Count>0)
{
if(Session["u_type"].ToString()=="0")
{
wel_msg.Text = "welcome..." + Session["username"].ToString();
wel_msg.Visible = true;
user_login.Visible = false;
user_logout.Visible = true;
user_home.Visible = true;
user_product.Visible = true;
user_contact_us.Visible = true;
user_feedback.Visible = true;
user_changepass.Visible = true;
user_about_us.Visible = true;
adm_viewreg.Visible = false;
adm_viewfeedback.Visible = false;
adm_viewcategory.Visible = false;
adm_viewproduct.Visible = false;
adm_viewpurchase.Visible = false;
adm_home.Visible = false;
// adm_viewpurchasedetail.Visible = false;
}
else
{
wel_msg.Text = "welcome..." + Session["username"].ToString();
wel_msg.Visible = true;
user_login.Visible = false;
user_logout.Visible = true;
user_home.Visible = true;
user_product.Visible = false;
user_contact_us.Visible = false;
user_feedback.Visible = false;
user_changepass.Visible = true;
user_about_us.Visible = false;
adm_viewreg.Visible = true;
adm_viewfeedback.Visible =true;
adm_viewcategory.Visible = true;
adm_viewproduct.Visible = true;
adm_viewpurchase.Visible =true;
adm_home.Visible = false;
// adm_viewpurchasedetail.Visible = true;
}
}
else
{
wel_msg.Visible = false;
user_login.Visible = true;
user_logout.Visible = false;
user_home.Visible = true;
user_product.Visible = false;
user_contact_us.Visible = true;
user_feedback.Visible = false;
user_about_us.Visible = true;
adm_viewreg.Visible = false;
adm_viewfeedback.Visible = false;
adm_viewcategory.Visible = false;
adm_viewproduct.Visible = false;
adm_viewpurchase.Visible = false;
adm_home.Visible = false;
// adm_viewpurchasedetail.Visible = false;
}
}
protected void user_logout_Click(object sender, EventArgs e)
{
Session.Abandon();
Session.Remove("username");
Session["username"] = "";
Response.Redirect("home.aspx");
}
}
home.aspx:
<div id=”home_content”>
<center><h1 style=”font-family:’MV Boli’;font-size:xx-large;color:black;”>Welcome
to our site…</h1>
</center>
<center>
<img src=”../image/28.jpg” height=”200” width=”300” />
<img src=”../image/23.jpg” height=”200” width=”300” />
<img src=”../image/27.jpg” height=”200” width=”300” />
</center>
</div>
</asp:Content>
Web.config:
<?xml version=”1.0”?>
<!—
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
<configuration>
<connectionStrings>
<add name=”stock” connectionString=”Data Source=(LocalDB)\
v11.0;AttachDbFilename=E:\tybca\stockmanagement\App_Data\
stockmanagement.mdf;Integrated Security=True”
providerName=”System.Data.SqlClient”/>
</connectionStrings>
<system.web>
<compilation debug=”true” targetFramework=”4.5” />
<httpRuntime targetFramework=”4.5” />
</system.web>
<appSettings>
<add key=”ValidationSettings:UnObtrusiveValidationMode” value=”none”/>
</appSettings>
</configuration>
Registration.aspx:
<h1> Registration</h1>
</th>
<table class="table" border="2">
<tr>
<td class="label">
</td>
</tr>
<tr>
<td class="label">
<asp:Label ID="Label5" runat="server"
Text="Email-Id"></asp:Label>
<asp:TextBox Id="emailid" runat="server" TextMode="Email"
CssClass="textbox" placeholder="Enter Email" ToolTip="please enter
email-id"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
ErrorMessage="Enter emailid" ControlToValidate="emailid" ForeColor="Red"
Display="Dynamic" CssClass ="error"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="label">
<asp:Label ID="Label6" runat="server"
Text="UserName"></asp:Label>
<asp:TextBox Id="username" runat="server" CssClass="textbox"
placeholder="Enter username" ToolTip="please enter username"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server"
ErrorMessage="Enter only character" ControlToValidate="username" ForeColor="Red"
Display="Dynamic" CssClass ="error"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="label">
<asp:Label ID="Label7" runat="server"
Text="Password"></asp:Label>
<asp:TextBox Id="password" runat="server" TextMode="Password"
CssClass="textbox" placeholder="Enter Password" ToolTip="please enter
password"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server"
ErrorMessage="Enter password" ControlToValidate="password" ForeColor="Red"
Display="Dynamic" CssClass ="error"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="label">
<asp:Label ID="Label8" runat="server"
Text="Question"></asp:Label>
registration.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
}
protected void Button1_Click(object sender,EventArgs e)
{
String str=ConfigurationManager.ConnectionStrings["stock"].ConnectionString;
con = new SqlConnection(str);
con.Open();
string s = "insert into registration
(fname,lname,address,city,contactno,emailid,username,password,s_question,answer)values('"
+ fnm.Text + "','" + lnm.Text + "','"+add.Text+"','" + city.Text + "','" + cono.Text + "','" +
emailid.Text + "','" + username.Text + "','" + password.Text + "','" +
s_question.SelectedItem.ToString() + "','" + answer.Text + "')";
cmd=new SqlCommand(s,con);
// con.Open();
int i = cmd.ExecuteNonQuery();
if(i>0)
{
Response.Redirect("login.aspx");
}
con.Close();
}
login.aspx:
<tr>
<td colspan="2" align="center">
<a href="registration.aspx" class="for" style="text-
decoration:underline">Create A New Account</a><br />
<a href="forgetpass1.aspx" class="for" style="text-
decoration:underline">Forgot PAssword???</a>
</td>
</tr>
</table>
</center>
</asp:Content>
login.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
}
protected void Button1_Click(object sender, EventArgs e)
{
cmd = new SqlCommand("select * from registration where username='" + usernm.Text
+ "' AND Password='" + password.Text + "'", con);
con.Open();
dr = cmd.ExecuteReader();
if(dr.HasRows)
{
dr.Read();
if(i==0)
{
Session["u_id"] = dr["u_id"].ToString();
Session["u_type"] = dr["u_type"].ToString();
Session["username"] = dr["username"].ToString();
Response.Redirect("../admin/home.aspx");
}
else
{
Session["u_id"] = dr["u_id"].ToString();
Session["u_type"] = dr["u_type"].ToString();
Session["username"] = dr["username"].ToString();
Response.Redirect("../user/home.aspx");
}
}
else
{
lblmsg.Text = "Invalid username and password";
}
con.Close();
}
protected void Button2_Click(object sender, EventArgs e)
{
usernm.Text = "";
password.Text = "";
}
}
changepass.aspx:
<td>
<asp:TextBox ID="txt_old" runat="server" type="password" placeholder="Old
password" CssClass="textbox"></asp:TextBox>
<asp:RequiredFieldValidator ID="req_oldpassword" runat="server"
ErrorMessage="Enter old password" ControlToValidate="txt_old" Font-Bold="True"
ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text="New
Password"></asp:Label>
</td>
<td>
<asp:TextBox ID="txt_new" runat="server" type="password"
placeholder="New password" CssClass="textbox"></asp:TextBox>
<asp:RequiredFieldValidator ID="req_newpassword" runat="server"
ErrorMessage="Enter new password" ControlToValidate="txt_new" Font-Bold="True"
ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label3" runat="server" Text="Confirm
Password"></asp:Label>
</td>
<td>
<asp:TextBox ID="txt_con" runat="server" type="password"
placeholder="Confrom password" CssClass="textbox"></asp:TextBox>
<asp:RequiredFieldValidator ID="req_confirmpassword" runat="server"
ErrorMessage="Enter confirm password" ControlToValidate="txt_con" Font-Bold="True"
ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
</td></tr>
<tr>
<th colspan="3"class="th">
<asp:Button ID="submit" runat="server" Text="submit" CssClass="button"
OnClick="submit_Click"/>
<input type="reset" runat="server" text="Clear" class="button" />
</th>
</tr>
</table><br />
</center>
</asp:Content>
changepass.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
con.Open();
com = new SqlCommand("select * from registration where u_id=" + Session["u_id"]
+ "", con);
dr = com.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
if (txt_old.Text == dr["password"].ToString())
{
dr.Close();
if (txt_new.Text == txt_con.Text)
{
com = new SqlCommand("update registration set password='" + txt_con.Text
+ "' where u_id=" + Session["u_id"] + "", con);
int i = com.ExecuteNonQuery();
if (i > 0)
{
Response.Redirect("login.aspx");
}
else
{
Response.Redirect("changepass.aspx");
}
}
}
}
else
{
Response.Redirect("forgetpass1.aspx");
}
con.Close();
}
}
forgetpass1.aspx:
</center>
</asp:Content>
forgetpass1.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
}
protected void next_Click(object sender, EventArgs e)
{
cmd = new SqlCommand("select * from registration where username='" + txt_unm.Text
+ "'", con);
con.Open();
{
dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
int u_id = Convert.ToInt16(dr["u_id"].ToString());
Response.Redirect("forgetpass2.aspx?u_id=" + u_id);
}
}
con.Close();
}
}
forgetpass2.aspx:
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text="Answer"></asp:Label>
</td>
<td><asp:TextBox ID="txt_ans" runat="server" placeholder="Answer"
CssClass="textbox"></asp:TextBox>
<asp:RequiredFieldValidator ID="Reqanswer" runat="server"
ControlToValidate="txt_ans" ErrorMessage="Enter your answer" Font-Bold="True"
ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
</td>
</tr>
<tr><th class="th" colspan="2">
<asp:Button ID="next" runat="server" Text="Next" CssClass="button"
OnClick="next_Click"></asp:Button>
<asp:Button ID="reset" runat="server" Text="Reset" CssClass="button"
></asp:Button>
</th></tr>
</table><br />
</center>
</asp:Content>
forgetpass2.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public partial class user_forgetpass2 : System.Web.UI.Page
{
SqlConnection con;
SqlCommand cmd;
SqlDataReader dr;
protected void Page_Load(object sender, EventArgs e)
{
string s =
ConfigurationManager.ConnectionStrings["stock"].ConnectionString.ToString();
con = new SqlConnection(s.ToString());
con.Open();
if (IsPostBack == false)
{
cmd = new SqlCommand("select * from registration where u_id=" +
Convert.ToInt16(Request.QueryString["u_id"]).ToString()+"", con);
dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
txt_sq.Text = dr["s_question"].ToString();
}
else
{
Response.Redirect("forgetpass2.aspx");
}
}
con.Close();
}
protected void next_Click(object sender, EventArgs e)
{
con.Open();
cmd = new SqlCommand("select * from registration where u_id=" +
Convert.ToInt16(Request.QueryString["u_id"].ToString()) + "", con);
dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
int u_id = Convert.ToInt16(Request.QueryString["u_id"].ToString());
if (txt_ans.Text == dr["answer"].ToString())
{
Response.Redirect("forgetpass3.aspx?u_id=" + u_id);
}
else
{
Response.Redirect("forgetpass2.aspx");
}
}
else
{
Response.Redirect("forgetpass2.aspx");
}
con.Close();
}
}
forgetpass3.aspx:
</asp:Content>
forgetpass3.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
}
protected void submit_Click(object sender, EventArgs e)
{
if (new_pwd.Text == con_pwd.Text)
{
int u_id = Convert.ToInt16(Request.QueryString["u_id"].ToString());
Response.Write(u_id);
con.Open();
cmd = new SqlCommand("update Registration set password='" + con_pwd.Text + "'
where u_id=" + u_id + "", con);
int i = cmd.ExecuteNonQuery();
if (i > 0)
{
Response.Redirect("login.aspx");
}
else
{
Response.Redirect("forgetpass3.aspx");
}
con.Close();
}
else
{
Response.Redirect("forgetpass3.aspx");
}
}
}
about_us.aspx:
contact_us.aspx:
feedback.aspx:
feedback.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\
v11.0;AttachDbFilename=E:\tybca\stockmanagement\App_Data\
stockmanagement.mdf;Integrated Security=True");
con.Open();
int u_id=Convert.ToInt16(Session["u_id"]);
string s="insert into feedback1
(u_id,username,comment)values('"+u_id+"','"+usernm.Text+"','"+comment.Text+"')";
SqlCommand cmd=new SqlCommand(s,con);
cmd.ExecuteNonQuery();
Response.Redirect("home.aspx");
con.Close();
}
protected void Button2_Click(object sender, EventArgs e)
{
comment.Text = "";
usernm.Text = "";
}
}
product.aspx:
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"></asp:DropDownList
></td></tr></center>
<tr><td><asp:Label ID="Label5" runat="server" Text="SubCategory"></asp:Label></td>
<td><asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="true"
OnSelectedIndexChanged="DropDownList2_SelectedIndexChanged"></asp:DropDownList
></td></tr></center>
</table>
<tr><td>
<asp:Label ID="Label1" runat="server" Text="Price:"></asp:Label>
<asp:Label ID="p_price" runat="server" Text='<%#Eval("p_price")
%>'></asp:Label><br />
<tr> <td>
<asp:Label ID="Label4" runat="server" Text="Stock:"></asp:Label>
<asp:Label ID="p_quantity" runat="server" Text='<
%#Eval("p_quantity") %>'></asp:Label><br />
<tr><td>
<asp:Label ID="Label5" runat="server"
Text="Description:"></asp:Label>
<asp:Label ID="p_desc" runat="server" Text='<%#Eval("p_desc")
%>'></asp:Label><br />
</SelectParameters>
</asp:SqlDataSource>
<asp:DataList ID="DataList2" runat="server" DataKeyField="p_id"
DataSourceID="sqlDataSource2" RepeatColumns="4" RepeatDirection="Horizontal">
<ItemTemplate>
<div class="product">
<asp:Image ID="Image1" runat="server" Height="120px" Width="110px"
ImageUrl='<%#Eval("p_img") %>'></asp:Image> <br />
Name:
<asp:Label ID="Label1" runat="server" Text='<%#Eval("p_nm")
%>'></asp:Label><br />
Price:
<asp:Label ID="Label2" runat="server" Text='<%#Eval("p_price")
%>'></asp:Label><br />
Detail:
<asp:Label ID="Label3" runat="server" Text='<%#Eval("p_desc")
%>'></asp:Label><br />
Quantity:
<asp:Label ID="Label4" runat="server" Text='<%#Eval("p_quantity")
%>'></asp:Label><br />
product.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
SqlConnection con;
SqlCommand com;
SqlDataReader dr;
int c_id;
protected void Page_Load(object sender, EventArgs e)
{
string s = ConfigurationManager.ConnectionStrings["stock"].ConnectionString;
con = new SqlConnection(s.ToString());
if (IsPostBack == false)
{
int id = 0;
DropDownList1.Items.Insert(id, new ListItem("--selected--", "0"));
com = new SqlCommand("select * from category", con);
con.Open();
dr = com.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
id++;
DropDownList1.Items.Insert(id, new ListItem(dr["c_name"].ToString(),
dr["c_id"].ToString()));
DataList1.Visible = true;
DataList2.Visible = false;
}
}
con.Close();
}
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
DataList1.Visible = true;
int i = 0;
DropDownList2.Items.Clear();
if (DropDownList1.SelectedValue.ToString() == "0")
{
DropDownList2.Items.Insert(0, new ListItem("--select--", "0"));
}
else
{
com = new SqlCommand("select * from subcategory where c_id=" +
DropDownList1.SelectedValue.ToString() + "", con);
con.Open();
dr = com.ExecuteReader();
DataList2.Visible = true;
if (dr.HasRows)
{
DropDownList2.Items.Insert(0, new ListItem("--selected--", "0"));
while (dr.Read())
{
i++;
DropDownList2.Items.Insert(i, new ListItem(dr["name"].ToString(),
dr["s_id"].ToString()));
DataList1.Visible = false;
DataList2.Visible = true;
}
}
con.Close();
}
}
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
productdetail.aspx:
productdetail.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public partial class user_productdetail : System.Web.UI.Page
{
SqlCommand cmd;
SqlConnection con;
SqlDataReader dr;
int id;
int p_qty;
{
String str = ConfigurationManager.ConnectionStrings["stock"].ConnectionString;
con = new SqlConnection(str);
if (Session["username"] == null)
{
Response.Redirect("login.aspx");
}
string msg;
if (Request.QueryString["msg"] != null)
{
msg = Request.QueryString["msg"];
if (msg == "1")
{
lbl_msg.Visible = true;
lbl_msg.Text = "Stock not available ...";
}
if (msg == "2")
{
lbl_msg.Visible = true;
lbl_msg.Text = "Out of Stock ...";
}
if (msg == "3")
{
lbl_msg.Visible = true;
lbl_msg.Text = "Please Enter Quantity ...";
}
if (msg == "4")
{
lbl_msg.Visible = true;
lbl_msg.Text = "Only " + Request.QueryString["qt"] + " available ...";
}
}
id = Convert.ToInt16(Request.QueryString["p_id"].ToString());
cmd = new SqlCommand("select * from product where p_id=" + id, con);
con.Open();
dr = cmd.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
Image1.ImageUrl = dr["p_img"].ToString();
lbl_name.Text = dr["p_nm"].ToString();
lbl_price.Text = dr["p_price"].ToString();
p_qty = Convert.ToInt16(dr["p_quantity"].ToString());
lbl_quantity.Text = p_qty.ToString();
}
con.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
}
else
{
if (stock == 0)
{
Response.Redirect("productdetail.aspx?msg=1&p_id=" + id);
}
else
{
Response.Redirect("productdetail.aspx?msg=4&qt=" + stock + "&p_id="
+ id);
}
}
}
}
else
{
con.Close();
cmd = new SqlCommand("insert into addtocart(u_id,p_id,a_quantity)values(" +
r_id + "," + id + "," + txt_quantity.Text + ")", con);
con.Open();
int i = cmd.ExecuteNonQuery();
if (i > 0)
{
Response.Redirect("shoppingcart.aspx?p_id=" + id);
}
con.Close();
}
}
else
{
Response.Redirect("productdetail.aspx?msg=4&qt=" + p_qty + "&p_id=" + id);
}
}
}
purchase.aspx:
<tr>
<th class="th" colspan="2"><h1>User Purchase</h1></th>
</tr>
<table class="table" border="2">
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text="Customer Name"></asp:Label>
</td>
</td></tr>
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text="City Name"></asp:Label>
</td>
ForeColor="Red" ValidationExpression="\S+@\S+\.\S+"
Display="Dynamic"></asp:RegularExpressionValidator>
</td></tr>
<tr>
<td><asp:Label ID="Label4" runat="server" Text="Contact No"></asp:Label></td>
<td><asp:TextBox ID="txt_contactno" runat="server" MaxLength="10"
CssClass="textbox" placeholder="ContactNo"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ErrorMessage="Enter contactno" Font-Bold="True" ForeColor="Red"
ControlToValidate="txt_contactno" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1"
runat="server" ErrorMessage="enter only 10 digit" Font-Bold="True"
ControlToValidate="txt_contactno" ValidationExpression="\d{10}" ForeColor="Red"
Display="Dynamic"></asp:RegularExpressionValidator>
</td></tr>
<tr><td align="center" colspan="2">
<asp:Button ID="Button1" runat="server" Text="Payment" Font-Italic="true" Font-
Bold="true" CssClass="button" OnClick="Button1_Click"
Width="87px"></asp:Button>
<asp:Button ID="Button2" runat="server" Text="Clear" Font-Italic="true" Font-
Bold="true" CssClass="button" OnClick="Button2_Click" Width="64px"></asp:Button>
</td></tr>
</table></div></div><br/>
</asp:Content>
purchase.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
SqlConnection con;
SqlCommand cmd, cmd1, cmd2, cmd3;
SqlDataReader dr, dr1;
int k, id;
int qty1;
protected void Page_Load(object sender, EventArgs e)
{
String str = ConfigurationManager.ConnectionStrings["stock"].ConnectionString;
con.Close();
cmd2 = new SqlCommand("update product set p_quantity=@p_quantity where
p_id=@p_id", con);
con.Open();
cmd2.Parameters.AddWithValue("@p_id", +pid);
cmd2.Parameters.AddWithValue("@p_quantity", p_quantity);
int i1 = cmd2.ExecuteNonQuery();
con.Close();
cmd3 = new SqlCommand("insert into
bill1(b_id,p_id,p_quantity)values(@b_id,@p_id,@p_quantity)", con);
con.Open();
cmd3.Parameters.AddWithValue("@b_id", id);
cmd3.Parameters.AddWithValue("@p_id", pid);
cmd3.Parameters.AddWithValue("@p_quantity", +qty);
int i2 = cmd3.ExecuteNonQuery();
con.Close();
}
cmd = new SqlCommand("delete from addtocart where u_id='" + k + "'", con);
con.Open();
cmd.Parameters.AddWithValue("@u_id", +k);
cmd.ExecuteNonQuery();
int u_id = Convert.ToInt16(Session["u_id"].ToString());
Response.Redirect("thankYou.aspx?u_id=" + u_id);
con.Close();
}
}
protected void Button2_Click(object sender, EventArgs e)
{
txt_contactno.Text = "";
txt_city.Text = "";
txt_mail.Text = "";
txt_uname.Text = "";
}
}
shoppingcart.aspx:
</asp:GridView>
shoppingcart.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
}
e.Row.Cells.Add(tc);
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
int total = 0;
if (e.Row.RowIndex != -1)
{
string a = e.Row.Cells[0].Text;
string b = e.Row.Cells[1].Text;
double c = double.Parse(a) * double.Parse(b);
e.Row.Cells[e.Row.Cells.Count - 1].Text = c.ToString();
}
for (int i = 0; i < GridView1.Rows.Count; i++)
{
total = total + int.Parse(GridView1.Rows[i].Cells[4].Text);
}
Session["total"] = total;
if (e.Row.RowType == DataControlRowType.Footer)
{
Label1.Text = total.ToString();
}
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
thankyou.aspx:
Admin side:-
home.aspx:
view_reg.aspx:
view_reg.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
if(Request.QueryString["u_id"]!=null)
{
int u_id=Convert.ToInt16(Request.QueryString["u_id"].ToString());
cmd=new SqlCommand("delete from registration where u_id='"+u_id+"'",con);
con.Open();
int i=cmd.ExecuteNonQuery();
if(i>0)
{
// Response.Write("record deleted");
}
else
{
//Response.Write("record not deleted");
}
con.Close();
}
}
}
view_feed.aspx:
view_feed.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
else
{
// Response.Write("Record not delete");
}
con.Close();
}
}
}
category.aspx:
<% if(Request.QueryString["c_id"]==null)
{
%>
<asp:Button ID="add" runat="server" Text="Add" CssClass="button"
OnClick="add_Click"></asp:Button>
<%
}
else
{
%>
category.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
view_category.aspx:
<tr><td> <center>
<h1>View Category </h1></td></tr></center>
<center>
<tr><td style="text-align:center;">
<tr><td>
<center>
<Columns>
<%--<asp:BoundField DataField="c_id" HeaderText="c_id"
InsertVisible="False" ReadOnly="True" SortExpression="c_id" />--%>
<asp:BoundField DataField="c_name" HeaderText="Name"
SortExpression="c_name" />
<asp:TemplateField HeaderText="Action">
<ItemTemplate>
<a href='category.aspx?c_id=<%# Eval("c_id") %>'><img
src="../image/edit.gif" height="35" width="35" onclick="return upd();"/></a>
<a href='view_category.aspx?c_id=<%# Eval("c_id") %>'
onclick="return del();"><img src="../image/del.gif" height="35" width="35" onclick="return
del();"/></a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
<HeaderStyle BackColor="#8E4D44" Font-Bold="True" ForeColor="#FFFFCC"
/>
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099"
HorizontalAlign="Center" />
<RowStyle BackColor="White" ForeColor="#330099" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True"
ForeColor="#663399" />
<SortedAscendingCellStyle BackColor="#FEFCEB" />
<SortedAscendingHeaderStyle BackColor="#AF0101" />
<SortedDescendingCellStyle BackColor="#F6F0C0" />
<SortedDescendingHeaderStyle BackColor="#7E0000" />
</asp:GridView>
</td></tr>
</table></div></div>
</asp:Content>
view_category.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
}
protected void new_Click(object sender, EventArgs e)
{
Response.Redirect("category.aspx");
}
}
subcategory.aspx:
<tr>
<td class="td">
<asp:Label ID="Label3" runat="server" Text="category"></asp:Label>
<asp:DropDownList ID="addcategory" runat="server"
OnSelectedIndexChanged="addcategory_SelectedIndexChanged"></asp:DropDownList>
</td></tr>
<tr>
<td> Sub Category
subcategory.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
dr.Read();
addcategory.SelectedValue = dr["c_id"].ToString();
txt_scat.Text = dr["name"].ToString();
}
con.Close();
}
}
}
protected void addcategory_SelectedIndexChanged(object sender, EventArgs e)
{
com = new SqlCommand("select * from category where c_name='" +
addcategory.SelectedItem.Text.ToString() + "'", con);
con.Open();
dr = com.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
id = Convert.ToInt16(dr["c_id"].ToString());
}
con.Close();
}
protected void btn_add_Click(object sender, EventArgs e)
{
string s1 = "select * from subcategory where name='" + txt_scat.Text + "'";
SqlDataAdapter da = new SqlDataAdapter(s1, con);
DataTable dt = new DataTable();
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
Label1.Text = "already existing";
}
else
{
com = new SqlCommand("insert into subcategory(c_id,name) values('" +
addcategory.Text + "','" + txt_scat.Text + "')", con);
com.Parameters.AddWithValue("@name", txt_scat.Text);
con.Open();
int i = com.ExecuteNonQuery();
if (i > 0)
{
Response.Redirect("view_subcategory.aspx");
txt_scat.Text = "";
}
con.Close();
}
}
protected void btn_edit_Click(object sender, EventArgs e)
{
int id = Convert.ToInt16(Request.QueryString["s_id"].ToString());
int c_id = 0;
com = new SqlCommand("select * from category where c_name='" +
addcategory.SelectedItem.ToString() + "'", con);
con.Open();
dr = com.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
c_id = Convert.ToInt16(dr["c_id"].ToString());
}
con.Close();
if (c_id != 0)
{
com = new SqlCommand("update subcategory set c_id=" + c_id + ",name='" +
txt_scat.Text + "' where s_id=" + id, con);
con.Open();
int i = com.ExecuteNonQuery();
if (i > 0)
{
Response.Redirect("view_subcategory.aspx");
}
else
{
Response.Redirect("not updated");
}
}
con.Close();
}
}
view_subcategory.aspx:
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#CCCCCC"/>
<HeaderStyle BackColor="Black" CssClass="ac" Height="45" Font-Bold="True"
ForeColor="White" />
<PagerStyle BackColor="#CCCCCC" ForeColor="Black"
HorizontalAlign="Left" />
<RowStyle BackColor="White" />
<SelectedRowStyle BackColor="#000099" ForeColor="White" Font-
Bold="True" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#808080" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#383838" />
</asp:GridView>
</center>
</asp:Content>
view_subcategory.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
SqlCommand com;
SqlConnection con;
protected void Page_Load(object sender, EventArgs e)
{
string s = ConfigurationManager.ConnectionStrings["stock"].ConnectionString;
con = new SqlConnection(s.ToString());
if (Request.QueryString["s_id"] != null)
{
int i = Convert.ToInt16(Request.QueryString["s_id"].ToString());
com = new SqlCommand("delete from subcategory where s_id='" + i + "'", con);
con.Open();
i = com.ExecuteNonQuery();
if (i > 0)
{
Response.Redirect("view_subcategory.aspx");
}
con.Close();
}
}
}
add_product.aspx:
</td> </tr>
<tr> <td><asp:Label ID="Label2" runat="server" Text="Subcategory"></asp:Label>
</td>
<td style="width: 158px">
<asp:DropDownList ID="drop_subcategory" runat="server"
OnSelectedIndexChanged="drop_subcategory_SelectedIndexChanged"></asp:DropDownLis
t>
</td></tr>
add_product.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
SqlCommand com;
SqlConnection con;
SqlDataReader dr;
String img;
public int i, cid;
protected void Page_Load(object sender, EventArgs e)
{
string s = ConfigurationManager.ConnectionStrings["stock"].ConnectionString;
}
protected void btn_edit_Click(object sender, EventArgs e)
{
if (Request.QueryString["p_id"] != null)
{
string img = "../image/" + FileUpload1.FileName;
if (FileUpload1.FileName == "")
{
img = Image1.ImageUrl.ToString();
}
else
{
FileUpload1.SaveAs(MapPath("image/" + FileUpload1.FileName));
}
int i = Convert.ToInt16(Request.QueryString["p_id"].ToString());
com = new SqlCommand("update product set c_id='" + drop_category.SelectedValue
+ "',s_id='" + drop_subcategory.SelectedValue + "',p_name='" + txt_name.Text + "',p_img='"
+ img + "',p_price='" + txt_price.Text + "',p_quantity='" + txt_quantity.Text +
"',p_description='" + TextBox1.Text + "'where p_id='" + i + "'", con);
con.Open();
int i1 = com.ExecuteNonQuery();
if (i1 > 0)
{
Response.Redirect("view_product.aspx");
}
con.Close();
}
}
protected void btn_add_Click(object sender, EventArgs e)
{
string s1 = "select * from product where p_img='" + Image1.ImageUrl + "'";
SqlDataAdapter da = new SqlDataAdapter(s1, con);
DataTable dt = new DataTable();
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
Label1.Text = "Product Already Existing..";
}
else
{
com = new SqlCommand("select * from category where c_name=@c_name", con);
con.Open();
com.Parameters.AddWithValue("c_name",
drop_category.SelectedItem.Text.ToString());
dr = com.ExecuteReader();
if (dr.HasRows)
{
dr.Read();
cid = Convert.ToInt16(dr["c_id"].ToString());
}
con.Close();
if (FileUpload1.HasFile)
{
FileUpload1.SaveAs(MapPath("~/image/" + FileUpload1.FileName));
img = "~/image/" + FileUpload1.FileName;
}
else
{
Response.Write("not insert");
}
img = "~/image/" + FileUpload1.FileName;
com = new SqlCommand("insert into
product(c_id,s_id,p_nm,p_img,p_price,p_quantity,p_desc)values('" +
drop_category.SelectedValue + "','" + drop_subcategory.SelectedValue + "','" +
txt_name.Text + "','" + img + "','" + txt_price.Text + "','" + txt_quantity.Text + "','" +
TextBox1.Text + "')", con);
con.Open();
int i = com.ExecuteNonQuery();
if (i > 0)
{
Response.Redirect("view_product.aspx");
}
con.Close();
}
}
}
view_product.aspx:
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" DefaultValue="0" Name="s_id"
PropertyName="selectedvalue" />
</SelectParameters>
</asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"
DataKeyNames="p_id" DataSourceID="SqlDataSource1"
OnSelectedIndexChanged="GridView1_SelectedIndexChanged" CellPadding="4"
ForeColor="Black" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid"
BorderWidth="3px" CellSpacing="2">
<Columns>
<asp:TemplateField HeaderText="image">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%#Bind("p_img")
%>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Image ID="Image1" runat="server" Height="43px" ImageUrl='<
%#Eval("p_img") %>' Width="63px"></asp:Image>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="p_nm" HeaderText="name"
SortExpression="p_nm" />
<asp:BoundField DataField="p_price" HeaderText="price"
SortExpression="p_price" />
<asp:BoundField DataField="p_desc" HeaderText="description"
SortExpression="p_desc" />
<asp:BoundField DataField="p_quantity" HeaderText="quantity"
SortExpression="quantity" />
<asp:TemplateField HeaderText="Action">
<ItemTemplate>
<a href="add_product.aspx?p_id=<%#Eval("p_id") %>" onclick="return
upd();">
<img src="../image/edit.gif" height="25px" width="25px" /></a>
<a href="view_product.aspx?p_id=<%#Eval("p_id") %>" onclick="return
del();">
<img src="../image/del.gif" height="25" width="25" /></a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
view_product.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public partial class admin_view_product : System.Web.UI.Page
{
SqlCommand com;
SqlConnection con;
SqlDataReader dr;
protected void Page_Load(object sender, EventArgs e)
{
String s = ConfigurationManager.ConnectionStrings["stock"].ConnectionString;
con = new SqlConnection(s.ToString());
//int i=o;
if (IsPostBack == false)
{
int id = 0;
DropDownList1.Items.Insert(id, new ListItem("--select--", "0"));
com = new SqlCommand("select * from category", con);
con.Open();
dr = com.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
id++;
DropDownList1.Items.Insert(id, new ListItem(dr["c_name"].ToString(),
dr["c_id"].ToString()));
}
}
con.Close();
}
if (DropDownList1.SelectedValue.ToString() == "0")
{
SqlDataSource1.SelectCommand = "SELECT *FROM[product]";
}
if (Request.QueryString["p_id"] != null)
{
int a = Convert.ToInt16(Request.QueryString["p_id"].ToString());
com = new SqlCommand("delete from product where p_id=@p_id", con);
con.Open();
com.Parameters.AddWithValue("@p_id", +a);
int i = com.ExecuteNonQuery();
if (i > 0)
{
Response.Redirect("view_product.aspx");
}
con.Close();
}
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
int i = 0;
DropDownList2.Items.Clear();
if (DropDownList1.SelectedValue.ToString() == "0")
{
DropDownList2.Items.Insert(0, new ListItem("--select--", "0"));
}
else
{
com = new SqlCommand("select* from subcategory where c_id=" +
DropDownList1.SelectedValue.ToString() + "", con);
con.Open();
dr = com.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
DropDownList2.Items.Insert(i, new ListItem(dr["name"].ToString(),
dr["s_id"].ToString()));
i++;
}
}
con.Close();
}
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
view_purchase.aspx:
<tr><td><center>
<h1>ViewPurchase</h1></td></tr></center>
<center>
<tr><td style="text-align:center;">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="b_id" DataSourceID="SqlDataSource1" AllowPaging="True"
BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px"
CellPadding="4" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" >
<Columns>
<asp:BoundField DataField="pur_date" FooterText="Date" SortExpression="pur_date"
HeaderText="Date" />
<asp:BoundField DataField="b_nm" FooterText="uname" SortExpression="b_nm"
HeaderText="Name" />
<asp:BoundField DataField="b_eid" FooterText="email" SortExpression="b_eid"
HeaderText="E-mail" />
<asp:BoundField DataField="b_con" FooterText="contactno" SortExpression="b_con"
HeaderText="Contact" />
<asp:BoundField DataField="b_city" FooterText="city" SortExpression="b_city"
HeaderText="City" />
<asp:TemplateField HeaderText="Actoin">
<ItemTemplate>
<a href="view_purchsedetail.aspx?b_id=<%# Eval("b_id") %>">View</a>
<a href="view_purchase.aspx?b_id=<%# Eval("b_id") %>">Shipping</a>
</ItemTemplate>
</asp:TemplateField> </Columns>
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
<HeaderStyle BackColor="#8E4D44" CssClass="ac" Height="45" Font-
Bold="True" ForeColor="#FFFFCC" />
view_purchase.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public partial class admin_view_purchase : System.Web.UI.Page
{
SqlConnection con;
SqlCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
String str = ConfigurationManager.ConnectionStrings["stock"].ConnectionString;
con = new SqlConnection(str);
if (Request.QueryString["b_id"] != null)
{
int a = Convert.ToInt16(Request.QueryString["b_id"].ToString());
cmd = new SqlCommand("update bill set b_status='" + 1 + "' where b_id=@b_id",
con);
con.Open();
cmd.Parameters.AddWithValue("@b_id", a);
int i = cmd.ExecuteNonQuery();
con.Close();
}
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
view_purchasedetail.aspx:
<ItemTemplate>
<asp:Label ID="lbl_total" runat="server" Text='<%#
Convert.ToInt32( Eval("p_price"))*Convert.ToInt32(Eval("p_quantity")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
<HeaderStyle BackColor="#8E4D44" Font-Bold="True" ForeColor="#FFFFCC" />
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099"
HorizontalAlign="Center" />
<RowStyle BackColor="White" ForeColor="#330099" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True"
ForeColor="#663399" />
<SortedAscendingCellStyle BackColor="#FEFCEB" />
<SortedAscendingHeaderStyle BackColor="#AF0101" />
<SortedDescendingCellStyle BackColor="#F6F0C0" />
<SortedDescendingHeaderStyle BackColor="#7E0000" />
</asp:GridView></td></tr></table>
<asp:Button ID="Button1" runat="server" Text="Back" OnClick="Button1_Click"
CssClass="button"/>
<span class="auto-style2">Total</span>:-<asp:Label ID="Label1" runat="server"
ForeColor="Black" Text="Label"></asp:Label>
<br /></div></div>
</asp:Content>
view_purchasedetail.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
{
Response. Redirect("view_purchase.aspx");
}
}
1) Role of Testing:
A project is like a load trip, some projects are simple routine like Driving to store in broad
daylight. But most project work doing are driving a Truck in mountains at night those project
needs headlights as light the way.
You illuminate the road ahead so the programmer & manager, However the blocker over the
map , can at least see where they are what they Are about to run over & how close they are to
diff. The details mission of the Group varies from company. Behind those details there is
common factor.
Testing is done to find information critical decision about the project or products that are
made on basic of that information.
2) Testing:
Once source code has been generated software must be tested to uncover many errors
possible before to customer.
Its goal is design series of test cases that have likelihood of finding Errors software testing
techniques provide systematic guidance for designing.
Test that:-
a) Exercise internal logic of software components.
b) Exercise the I/P & O/P domains of program Functional behavior & performance.
Testing phase must maximize the number of errors detected & minimize the
number of test cases.
Testing is process of executing program with the intent of finding an error. A good test case
is one then has high probability of finding yet UN-discovers error.
Guarantee that all individual paths within module have been exercise at least
once.
Exercise all logical decision on their true & false side.
Exercise all loops at their boundaries & within their optional bound.
Exercise interval data to ensure there validity.
Black box testing also called behavior testing focus on functional requirement of
software.
Black box testing enable the software engine to device the set input or output
condition that will fully exercise all functional requirement programs.
Black box testing concerned with the proper execution of the system
specification.
7.2Test Cases:-
Criteria:-
Input 1:-only character.
Inpur 2:-only digit.
Input 3:-character with digit.
Input 4:-character with special symbol.
Register:
Login:
Forgot password1:
Forgot password2:
Change password:
Feedback:
Category:
Sub Category:
Add to cart:
Product:
Purchase:
Bill 1:
Bill 2:
8- Enhancement
8.1 advantages:
Easy shopping
Wide range of items
Value for money of different items
Publicity of different companies and their products
Easy to purchase
8.2 Limitation:
9- References
Books:
Website:
Http//:www.w3schools.com