SlideShare a Scribd company logo
1 of 256
My project working well, but there no relationship between the
tables of database because each table working alone
I want make relationship between them even that order to
change some
names of the tables and I want this relationship to work in the
project well
For example:
-From this table
-To this
Online Car Sales/EWAPP/AdminAddNewItem.aspx
<%@ Page Language="C#"
MasterPageFile="~/AdminMasterPage.master"
MaintainScrollPositionOnPostback="true"
AutoEventWireup="true"
CodeFile="AdminAddNewItem.aspx.cs" Inherits="AdminPage"
Title="OurShopping - Online Shopping Store" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head"
Runat="Server">
<style type="text/css">
.style9
{
text-decoration: underline;
}
</style>
</asp:Content>
<asp:Content ID="Content2"
ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<hr>
<p>
<span __designer:mapid="16c" class="style9">Adding
New Item:</span>
<br __designer:mapid="d3" />
<br __designer:mapid="d4" />
<br __designer:mapid="d5" />
Product&#39;s Name:
</p>
<p>
<asp:TextBox ID="txtProductName"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtProductName"
ErrorMessage="Product's Name is
Requierd">*</asp:RequiredFieldValidator>
<br __designer:mapid="169" />
<br __designer:mapid="16a" />
Product&#39;s Short Description:</p>
<p>
&nbsp;<asp:TextBox ID="txtShortDescription"
runat="server" Height="62px"
TextMode="MultiLine"
Width="326px"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator2" runat="server"
ControlToValidate="txtShortDescription"
ErrorMessage="Description is
Reqiuerd">*</asp:RequiredFieldValidator>
</p>
<p>
<br __designer:mapid="d7" />
<br __designer:mapid="d8" />
Product&#39;s Description:
</p>
<p>
<asp:TextBox ID="txtProductDescription"
runat="server" Height="156px"
TextMode="MultiLine"
Width="375px"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator3" runat="server"
ControlToValidate="txtProductDescription"
ErrorMessage="Description is
Requierd">*</asp:RequiredFieldValidator>
<br __designer:mapid="da" />
<br __designer:mapid="db" />
Make:
<asp:DropDownList ID="dropCatInsert" runat="server"
DataSourceID="SqlDataSource2"
DataTextField="Category"
DataValueField="Category">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource2"
runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM
[ProductCategory]">
<SelectParameters>
<asp:Parameter DefaultValue="1"
Name="CategoryID" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</p>
<table border="1" style="background-color: LightGray">
<tr><td colspan="2"
align="center"><b>Specifications</b></td></tr>
<tr>
<td width="300">Price</td>
<td><asp:TextBox ID="txtInitialPrice"
runat="server"></asp:TextBox>
<asp:CompareValidator
ID="CompareValidator56" runat="server"
ControlToValidate="txtInitialPrice"
ErrorMessage="Only Numbers are Accepted"
Operator="DataTypeCheck"
Type="Integer">*</asp:CompareValidator>
<asp:CompareValidator
ID="CompareValidator57" runat="server"
ControlToValidate="txtInitialPrice"
ErrorMessage="Must be Positive Value"
Operator="GreaterThanEqual"
ValueToCompare="0" >*</asp:CompareValidator>
</td>
</tr>
<tr>
<td width="300">Average MPG</td>
<td><asp:TextBox ID="txtAverageMPG"
runat="server"></asp:TextBox>
<asp:CompareValidator
ID="CompareValidator23" runat="server"
ControlToValidate="txtAverageMPG"
ErrorMessage="Only Numbers are Accepted"
Operator="DataTypeCheck"
Type="Integer">*</asp:CompareValidator>
<asp:CompareValidator
ID="CompareValidator25" runat="server"
ControlToValidate="txtAverageMPG"
ErrorMessage="Rating Must be Positive Value"
Operator="GreaterThanEqual"
ValueToCompare="0" >*</asp:CompareValidator>
</td>
</tr>
<tr>
<td width="300">Body Type</td>
<td>
<asp:DropDownList ID="ddlBodyType" runat="server">
<asp:ListItem Value="Manual">Hatchback</asp:ListItem>
<asp:ListItem Value="Mini MPV">Mini MPV</asp:ListItem>
<asp:ListItem Value="Coupe">Coupe</asp:ListItem>
<asp:ListItem Value="Convertible">Convertible</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td width="300">Exterior Color</td>
<td>
<asp:DropDownList ID="ddlExteriorColor" runat="server">
<asp:ListItem Value="Red">Red</asp:ListItem>
<asp:ListItem Value="Blue">Blue</asp:ListItem>
<asp:ListItem Value="White">White</asp:ListItem>
<asp:ListItem Value="Black">Black</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td width="300">Interior Color</td>
<td>
<asp:DropDownList ID="ddlInteriorColor" runat="server">
<asp:ListItem Value="Red">Red</asp:ListItem>
<asp:ListItem Value="Blue">Blue</asp:ListItem>
<asp:ListItem Value="White">White</asp:ListItem>
<asp:ListItem Value="Black">Black</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td width="300">Engine</td>
<td>
<asp:DropDownList ID="ddlEngine" runat="server">
<asp:ListItem Value="6 Cylinder">6 Cylinder</asp:ListItem>
<asp:ListItem Value="4 Cylinder">4 Cylinder</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td width="300">Drive Type</td>
<td>
<asp:DropDownList ID="ddlDriveType" runat="server">
<asp:ListItem Value="All Wheel Drive">All Wheel
Drive</asp:ListItem>
<asp:ListItem Value="Two Drive">Two Drive</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td width="300">Fuel</td>
<td>
<asp:DropDownList ID="ddlFuel" runat="server">
<asp:ListItem Value="Petrol">Petrol</asp:ListItem>
<asp:ListItem Value="Diesel">Diesel</asp:ListItem>
<asp:ListItem Value="Unleaded">Unleaded</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td width="300">Doors</td>
<td>
<asp:DropDownList ID="ddlDoors" runat="server">
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
<asp:ListItem Value="4">4</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
<p>
Price:
<asp:TextBox ID="txtPrice"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator4" runat="server"
ControlToValidate="txtPrice"
ErrorMessage="Price is
reqiuerd">*</asp:RequiredFieldValidator>
<asp:CompareValidator
ID="CompareValidator1" runat="server"
ControlToValidate="txtPrice"
ErrorMessage="Onlt numbers are accepted"
Operator="DataTypeCheck"
Type="Integer">*</asp:CompareValidator>
</p>
<p>
&nbsp;</p>
<hr />
<p>
<br __designer:mapid="167" />
Upload Product Full Size Image:
</p>
<p>
<asp:FileUpload ID="FileUpload1" runat="server"
ondatabinding="btnsaveProduct_Click" />
&nbsp;<asp:RequiredFieldValidator
ID="RequiredFieldValidator5" runat="server"
ControlToValidate="FileUpload1"
ErrorMessage="you must enter product
full size image">*</asp:RequiredFieldValidator>
&nbsp;<asp:Label ID="lblFullSizeImage"
runat="server" style="color: #FFFFFF"></asp:Label>
</p>
<p>
Upload Product Thumbnail Size Image:</p>
<p>
<asp:FileUpload ID="FileUpload2"
runat="server"
ondatabinding="btnsaveProduct_Click" />
&nbsp;<asp:RequiredFieldValidator
ID="RequiredFieldValidator6" runat="server"
ControlToValidate="FileUpload2"
ErrorMessage="you must enter product
thubnail size image">*</asp:RequiredFieldValidator>
&nbsp;<asp:Label ID="lblThumbSizeImage"
runat="server"
style="font-weight: 700; color:
#FFFFFF"></asp:Label>
</p>
<p>
&nbsp;</p>
<hr />
<p>
<br __designer:mapid="de" />
</p>
<asp:ValidationSummary
ID="ValidationSummary1" runat="server" />
<p>
<br __designer:mapid="df" />
<br __designer:mapid="e1" />
<br __designer:mapid="e2" />
<asp:Label ID="lblAddingNewItem" runat="server"
ForeColor="#FF3300"></asp:Label>
<br __designer:mapid="e4" />
<br __designer:mapid="e5" />
<asp:Button ID="btnsaveProduct" runat="server"
Text="Add The Item"
onclick="btnsaveProduct_Click" />
<asp:Button ID="btnInsert" runat="server" Text="insert
another Item"
onclick="btnInsert_Click" />
<br __designer:mapid="e8" />
<br __designer:mapid="e9" />
<br __designer:mapid="ea" />
<br __designer:mapid="eb" />
<asp:SqlDataSource ID="SqlDataSource1"
runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [ProductTable]
WHERE [ProductID] = @ProductID"
InsertCommand="INSERT INTO [ProductTable]
([ProductName], [ProductDescription],
[ProductShortDescription], [Price], [Category], [ProductImage],
[ProductImageThumb]) VALUES (@ProductName,
@ProductDescription, @ProductShortDescription, @Price,
@Category, @ProductImage, @ProductImageThumb)"
SelectCommand="SELECT * FROM [ProductTable]"
UpdateCommand="UPDATE
[ProductTable] SET [ProductName] = @ProductName,
[ProductDescription] = @ProductDescription,
[ProductShortDescription] = @ProductShortDescription, [Price]
= @Price, [Category] = @Category, [ProductImage] =
@ProductImage, [ProductImageThumb] =
@ProductImageThumb WHERE [ProductID] = @ProductID">
<DeleteParameters>
<asp:Parameter Name="ProductID" Type="Int32"
/>
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="ProductName"
Type="String" />
<asp:Parameter Name="ProductDescription"
Type="String" />
<asp:Parameter Name="ProductShortDescription"
Type="String" />
<asp:Parameter Name="Price" Type="Double" />
<asp:Parameter Name="Category" Type="String"
/>
<asp:Parameter Name="ProductImage"
Type="String" />
<asp:Parameter Name="ProductImageThumb"
Type="String" />
<asp:Parameter Name="ProductID" Type="Int32"
/>
</UpdateParameters>
<InsertParameters>
<asp:ControlParameter
ControlID="txtProductName" Name="ProductName"
PropertyName="Text" Type="String" />
<asp:ControlParameter
ControlID="txtProductDescription"
Name="ProductDescription"
PropertyName="Text" Type="String" />
<asp:ControlParameter
ControlID="txtProductDescription"
Name="ProductShortDescription"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="txtPrice"
Name="Price" PropertyName="Text"
Type="Double" />
<asp:ControlParameter ControlID="dropCatInsert"
Name="Category"
PropertyName="SelectedValue" Type="String"
/>
<asp:ControlParameter
ControlID="lblFullSizeImage" Name="ProductImage"
PropertyName="Text" Type="String" />
<asp:ControlParameter
ControlID="lblThumbSizeImage" Name="ProductImageThumb"
PropertyName="Text" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
</p>
<p>
&nbsp;</p>
<p>
</p>
<p>
<br />
</p>
<p>
</p>
</asp:Content>
Online Car Sales/EWAPP/AdminAddNewItem.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
public partial class AdminPage : System.Web.UI.Page
{
SqlConnection con;
SqlCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
string strcon =
System.Configuration.ConfigurationManager.ConnectionStrings
["ConnectionString"].ConnectionString;
con = new SqlConnection(strcon);
btnInsert.Visible = false;
// btnsaveProduct.Visible = false;
}
protected void
RadioButtonList1_SelectedIndexChanged(object sender,
EventArgs e)
{
// MultiView1.ActiveViewIndex =
RadioButtonList1.SelectedIndex;
}
protected void btnsaveProduct_Click(object sender,
EventArgs e)
{
if (FileUpload1.HasFile)
{
FileUpload1.SaveAs(HttpContext.Current.Request.PhysicalAppl
icationPath + "//Uploadedpix//" + FileUpload1.FileName);
lblFullSizeImage.Text = FileUpload1.FileName;
}
if (FileUpload2.HasFile)
{
FileUpload2.SaveAs(HttpContext.Current.Request.PhysicalAppl
icationPath + "//Thumbnails//" + FileUpload2.FileName);
}
lblThumbSizeImage.Text = FileUpload2.FileName;
btnsaveProduct.Visible = true;
SqlDataSource1.Insert();
con.Open();
cmd = new SqlCommand("Select Max(ProductID) from
ProductTable", con);
int MaxProductId =
Convert.ToInt32(cmd.ExecuteScalar());
con.Close();
con.Open();
cmd = new SqlCommand("Insert into
CarSpecs(CarId,Price,Mileage,BodyStyle,ExteriorColor,Interior
Color,Engine,DriveType,FuelType,Doors) Values ("
+ MaxProductId + ","
+ Convert.ToDouble(txtInitialPrice.Text) + ","
+ Convert.ToInt32(txtAverageMPG.Text) + ",'"
+ ddlBodyType.Text + "','"
+ ddlExteriorColor.Text + "','"
+ ddlInteriorColor.Text + "','"
+ ddlEngine.Text + "','"
+ ddlDriveType.Text + "','"
+ ddlFuel.Text + "',"
+ Convert.ToInt32(ddlDoors.Text) + ")", con);
cmd.ExecuteNonQuery();
con.Close();
this.lblAddingNewItem.Text = "Item Has Been Added
into the Database";
btnsaveProduct.Visible = false;
btnInsert.Visible = true;
txtPrice.Enabled = false;
txtShortDescription.Enabled = false;
txtProductDescription.Enabled = false;
txtProductName.Enabled = false;
dropCatInsert.Enabled = false;
}
protected void btnInsert_Click(object sender, EventArgs e)
{
txtPrice.Text = "";
txtProductDescription.Text = "";
txtProductName.Text = "";
txtPrice.Enabled = true;
txtProductDescription.Enabled = true;
txtProductName.Enabled = true;
btnsaveProduct.Visible = true;
dropCatInsert.Enabled = true;
}
protected void LinkButton1_Click(object sender, EventArgs
e)
{
// txtsearchUser.Visible = true;
//btn1.Visible = true;
//txtUserIDSearch.Visible = false;
// btn2.Visible = false;
// LinkButton1.Visible = false;
}
protected void LinkButton2_Click(object sender, EventArgs
e)
{
//txtUserIDSearch.Visible = true;
// btn2.Visible = true;
// txtsearchUser.Visible = false;
//btn1.Visible = false;
// LinkButton2.Visible = false;
}
protected void
DropSearchItems_SelectedIndexChanged(object sender,
EventArgs e)
{
}
//protected void btnuploadImages_Click(object sender,
EventArgs e)
//{
// if (FileUpload1.HasFile)
// {
// FileUpload1.SaveAs("F:/Documents and
Settings/shift/Desktop/EWAPP/Uploadedpix/" +
FileUpload1.FileName);
// }
// if (FileUpload2.HasFile)
// {
// FileUpload2.SaveAs("F:/Documents and
Settings/shift/Desktop/EWAPP/Thumbnails/" +
FileUpload2.FileName);
// }
// txtFimage.Text = FileUpload1.FileName;
// txtTimage.Text = FileUpload2.FileName;
// Label1.Visible = false;
// // btnsaveProduct.Visible = true;
//}
}
Online Car Sales/EWAPP/AdminCategoryMaintenance.aspx
<%@ Page Title="" Language="C#"
MasterPageFile="~/AdminMasterPage.master"
AutoEventWireup="true"
CodeFile="AdminCategoryMaintenance.aspx.cs"
Inherits="AdminCategoryMaintenance" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head"
Runat="Server">
</asp:Content>
<asp:Content ID="Content2"
ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<asp:RadioButtonList ID="RadioButtonList1" runat="server"
AutoPostBack="True"
onselectedindexchanged="RadioButtonList1_SelectedIndexChan
ged">
<asp:ListItem Value="0">Add New
Category</asp:ListItem>
<asp:ListItem Value="1">View / modify
Categories</asp:ListItem>
</asp:RadioButtonList>
<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="View1" runat="server">
<table class="style17">
<tr>
<td colspan="2"
style="border-color: #000080; background-
color: #AABFEA; border-bottom-style: solid;">
Add New Category</td>
</tr>
<tr>
<td>
Category Name:
</td>
<td>
<asp:TextBox ID="txtCategoryName"
runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Category Description:
</td>
<td>
<asp:TextBox ID="txtCategoryDesc"
TextMode=MultiLine runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2">
<td class="style18">
<asp:SqlDataSource ID="SqlDataSource2"
runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM
[ProductCategory] WHERE [CategoryID] = @CategoryID"
InsertCommand="INSERT INTO
[ProductCategory] ([Category]) VALUES (@NewCategory)"
SelectCommand="SELECT * FROM
[ProductCategory] WHERE [CategoryID] = @CategoryID"
UpdateCommand="UPDATE
[ProductCategory] SET [Category] = @NewCategory WHERE
[CategoryID] = @CategoryID">
<DeleteParameters>
<asp:Parameter Name="CategoryID"
Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Category"
Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:ControlParameter
ControlID="txtCategoryName" Name="NewCategory"
PropertyName="Text" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
</td>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Button ID="btnInsert" runat="server"
Text="Insert"
onclick="btnInsert_Click" />
</td>
</tr>
</table>
</asp:View>
<asp:View ID="View2" runat="server">
<br /><br />
<asp:GridView ID="GridView2" runat="server"
AutoGenerateColumns="False"
BackColor="White" BorderColor="#999999"
BorderStyle="None" BorderWidth="1px"
CellPadding="3" DataKeyNames="CategoryID"
DataSourceID="SqlDataSource10"
GridLines="Vertical">
<FooterStyle BackColor="#CCCCCC"
ForeColor="Black" />
<RowStyle BackColor="#EEEEEE"
ForeColor="Black" />
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="CategoryID"
HeaderText="Category ID" InsertVisible="False"
ReadOnly="True"
SortExpression="CategoryID" />
<asp:BoundField DataField="Category"
HeaderText="Category"
SortExpression="Category" />
</Columns>
<PagerStyle BackColor="#999999"
ForeColor="Black" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#008A8C" Font-
Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#000084" Font-
Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#DCDCDC" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource10"
runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM
[ProductCategory] WHERE [CategoryID] = @CategoryID"
InsertCommand="INSERT INTO [ProductCategory]
([Category]) VALUES (@Category)"
SelectCommand="SELECT * FROM
[ProductCategory]"
UpdateCommand="UPDATE [ProductCategory] SET
[Category] = @Category WHERE [CategoryID] =
@CategoryID">
<SelectParameters>
<asp:Parameter DefaultValue="1"
Name="CategoryID" Type="Int32" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="CategoryID"
Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Category" Type="String"
/>
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Category" Type="String"
/>
</InsertParameters>
</asp:SqlDataSource>
<br />
<asp:FormView ID="FormView2" runat="server"
DataKeyNames="CategoryID"
DataSourceID="SqlDataSource11"
OnItemUpdated="FormView2_ItemUpdated"
OnItemDeleted="FormView2_ItemDeleted" >
<EditItemTemplate>
<table class="style17">
<tr>
<td class="style20">
Category ID:</td>
<td>
<asp:Label ID="IDLabel0" runat="server"
Text='<%# Eval("CategoryID") %>' />
</td>
</tr>
<tr>
<td class="style20">
Category:</td>
<td>
<asp:TextBox ID="CategoryLabel0"
runat="server" Text='<%# Bind("Category") %>' />
</td>
</tr>
</table>
<asp:LinkButton ID="UpdateButton0"
runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton
ID="UpdateCancelButton0" runat="server"
CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
<br />
<asp:ValidationSummary
ID="ValidationSummary3" runat="server" />
</EditItemTemplate>
<InsertItemTemplate>
Category:
<asp:TextBox ID="CategoryTextBox0"
runat="server"
Text='<%# Bind("Category") %>' />
<asp:LinkButton ID="InsertButton0"
runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;<asp:LinkButton
ID="InsertCancelButton0" runat="server"
CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
<table class="style17">
<tr>
<td class="style20">
Category ID:</td>
<td>
<asp:Label ID="IDLabel1" runat="server"
Text='<%# Eval("CategoryID") %>' />
</td>
</tr>
<tr>
<td class="style20">
Category:</td>
<td>
<asp:Label ID="CategoryLabel1"
runat="server" Text='<%# Bind("Category") %>' />
</td>
</tr>
</table>
<asp:LinkButton ID="EditButton0" runat="server"
CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton0"
runat="server" CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;
</ItemTemplate>
</asp:FormView>
<br />
<asp:SqlDataSource ID="SqlDataSource11"
runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM
[ProductCategory] WHERE [CategoryID] = @CategoryID"
InsertCommand="INSERT INTO [ProductCategory]
([Category]) VALUES (@Category)"
SelectCommand="SELECT * FROM
[ProductCategory] WHERE [CategoryID] = @CategoryID"
UpdateCommand="UPDATE [ProductCategory] SET
[Category] = @Category WHERE [CategoryID] =
@CategoryID">
<SelectParameters>
<asp:ControlParameter ControlID="GridView2"
Name="CategoryID"
PropertyName="SelectedValue" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="CategoryID"
Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Category" Type="String"
/>
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Category" Type="String"
/>
</InsertParameters>
</asp:SqlDataSource>
</asp:View>
</asp:MultiView>
</asp:Content>
Online Car Sales/EWAPP/AdminCategoryMaintenance.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.Configuration;
using System.Data;
public partial class AdminCategoryMaintenance :
System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void
RadioButtonList1_SelectedIndexChanged(object sender,
EventArgs e)
{
MultiView1.ActiveViewIndex =
RadioButtonList1.SelectedIndex;
}
protected void btnInsert_Click(object sender, EventArgs e)
{
SqlDataSource sds = new SqlDataSource();
sds.ConnectionString =
ConfigurationManager.ConnectionStrings["ConnectionString"].
ToString();
sds.SelectParameters.Add("NewCategory",
TypeCode.String, this.txtCategoryName.Text);
sds.SelectCommand = "SELECT * FROM
[ProductCategory] WHERE [Category] = @NewCategory";
DataView dv =
(DataView)sds.Select(DataSourceSelectArguments.Empty);
if (dv.Count != 0)
{
return;
}
else
{
this.SqlDataSource2.Insert();
//this.Label1.Text = "New User Profile has been created
you can login now";
btnInsert.Enabled = false;
}
}
protected void FormView2_ItemUpdated(object sender,
FormViewUpdatedEventArgs e)
{
this.GridView2.DataBind();
}
protected void FormView2_ItemDeleted(object sender,
FormViewDeletedEventArgs e)
{
this.GridView2.DataBind();
}
}
Online Car Sales/EWAPP/AdminMaintainItems.aspx
<%@ Page Language="C#"
MasterPageFile="~/AdminMasterPage.master"
MaintainScrollPositionOnPostback="true"
AutoEventWireup="true"
CodeFile="AdminMaintainItems.aspx.cs"
Inherits="AdminMaintainItems" Title="OurShopping - Online
Shopping Store" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head"
Runat="Server">
<style type="text/css">
.style9
{
width: 100%;
}
</style>
</asp:Content>
<asp:Content ID="Content2"
ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<hr />
<p>
Maintain Items:</p>
<p>
Select Category:
<asp:DropDownList ID="DropSearchCat" runat="server"
AutoPostBack="True"
DataSourceID="SqlDataSource1"
DataTextField="Category"
DataValueField="Category"
onselectedindexchanged="DropSearchCat_SelectedIndexChange
d">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Category] FROM
[ProductCategory]">
</asp:SqlDataSource>
</p>
<p>
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False"
CellPadding="4" DataKeyNames="ProductID"
DataSourceID="SqlDataSource2"
ForeColor="#333333" GridLines="None">
<FooterStyle BackColor="#507CD1" Font-Bold="True"
ForeColor="White" />
<RowStyle BackColor="#EFF3FB" />
<Columns>
<asp:CommandField ButtonType="Button"
ShowSelectButton="True" />
<asp:BoundField DataField="ProductID"
HeaderText="ProductID"
InsertVisible="False" ReadOnly="True"
SortExpression="ProductID" />
<asp:BoundField DataField="ProductName"
HeaderText="ProductName"
SortExpression="ProductName" />
<asp:BoundField
DataField="ProductShortDescription"
HeaderText="ProductShortDescription"
SortExpression="ProductShortDescription" />
<asp:BoundField DataField="Price"
HeaderText="Price" SortExpression="Price" />
<asp:BoundField DataField="Category"
HeaderText="Category"
SortExpression="Category" />
<asp:BoundField DataField="ProductImage"
HeaderText="ProductImage"
SortExpression="ProductImage" />
</Columns>
<PagerStyle BackColor="#2461BF" ForeColor="White"
HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#D1DDF1" Font-
Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True"
ForeColor="White" />
<EditRowStyle BackColor="#2461BF" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [ProductTable]
WHERE [ProductID] = @ProductID"
InsertCommand="INSERT INTO [ProductTable]
([ProductName], [ProductDescription],
[ProductShortDescription], [Price], [Category], [ProductImage])
VALUES (@ProductName, @ProductDescription,
@ProductShortDescription, @Price, @Category,
@ProductImage)"
SelectCommand="SELECT * FROM [ProductTable]
WHERE ([Category] = @Category)"
UpdateCommand="UPDATE [ProductTable] SET
[ProductName] = @ProductName, [ProductDescription] =
@ProductDescription, [ProductShortDescription] =
@ProductShortDescription, [Price] = @Price, [Category] =
@Category, [ProductImage] = @ProductImage WHERE
[ProductID] = @ProductID">
<SelectParameters>
<asp:ControlParameter ControlID="DropSearchCat"
Name="Category"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="ProductID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="ProductName" Type="String"
/>
<asp:Parameter Name="ProductDescription"
Type="String" />
<asp:Parameter Name="ProductShortDescription"
Type="String" />
<asp:Parameter Name="Price" Type="Double" />
<asp:Parameter Name="Category" Type="String" />
<asp:Parameter Name="ProductImage"
Type="String" />
<asp:Parameter Name="ProductID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="ProductName" Type="String"
/>
<asp:Parameter Name="ProductDescription"
Type="String" />
<asp:Parameter Name="ProductShortDescription"
Type="String" />
<asp:Parameter Name="Price" Type="Double" />
<asp:Parameter Name="Category" Type="String" />
<asp:Parameter Name="ProductImage"
Type="String" />
</InsertParameters>
</asp:SqlDataSource>
</p>
<p>
<asp:FormView ID="FormView2" runat="server"
DataKeyNames="ProductID"
DataSourceID="SqlDataSource3"
onitemupdated="FormView2_ItemUpdated"
Width="532px">
<EditItemTemplate>
<table class="style9">
<tr>
<td>
ProductID:</td>
<td>
<asp:Label ID="ProductIDLabel"
runat="server" Text='<%# Eval("ProductID") %>' />
</td>
</tr>
<tr>
<td>
Product Name:</td>
<td>
<asp:TextBox ID="ProductNameTextBox"
runat="server"
Text='<%# Bind("ProductName") %>' />
<asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server"
ControlToValidate="ProductNameTextBox"
ErrorMessage="Product's Name is
requierd">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Description:</td>
<td>
<asp:TextBox
ID="ProductDescriptionTextBox" runat="server"
Height="62px"
Text='<%# Bind("ProductDescription")
%>' TextMode="MultiLine" Width="190px" />
<asp:RequiredFieldValidator
ID="RequiredFieldValidator2" runat="server"
ControlToValidate="ProductDescriptionTextBox"
ErrorMessage="Description is
requierd">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Short Description:</td>
<td>
<asp:TextBox
ID="ProductShortDescriptionTextBox" runat="server"
Text='<%#
Bind("ProductShortDescription") %>' TextMode="MultiLine"
Width="188px" />
<asp:RequiredFieldValidator
ID="RequiredFieldValidator3" runat="server"
ControlToValidate="ProductShortDescriptionTextBox"
ErrorMessage="Description is
requierd">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Price:</td>
<td>
<asp:TextBox ID="PriceTextBox"
runat="server" Text='<%# Bind("Price") %>' />
<asp:RequiredFieldValidator
ID="RequiredFieldValidator4" runat="server"
ControlToValidate="PriceTextBox"
ErrorMessage="image is
requierd">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Category:</td>
<td>
<asp:DropDownList ID="DropDownList1"
runat="server"
DataSourceID="SqlDataSource1"
DataTextField="Category"
DataValueField="Category"
SelectedValue='<%# Bind("Category") %>'>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1"
runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM
[ProductCategory]"></asp:SqlDataSource>
</td>
</tr>
<tr>
<td>
Image:</td>
<td>
<asp:TextBox ID="ProductImageTextBox"
runat="server"
Text='<%# Bind("ProductImage") %>' />
<asp:RequiredFieldValidator
ID="RequiredFieldValidator5" runat="server"
ControlToValidate="ProductImageTextBox"
ErrorMessage="Product's Name is
requierd">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
&nbsp;ImageThumb:</td>
<td>
<asp:TextBox
ID="ProductImageThumbTextBox" runat="server"
Text='<%# Bind("ProductImageThumb")
%>' />
<asp:RequiredFieldValidator
ID="RequiredFieldValidator6" runat="server"
ControlToValidate="ProductImageThumbTextBox"
ErrorMessage="image is
requierd">*</asp:RequiredFieldValidator>
</td>
</tr>
</table>
<asp:LinkButton ID="UpdateButton" runat="server"
CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton"
runat="server"
CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
<br />
<asp:ValidationSummary ID="ValidationSummary1"
runat="server" />
</EditItemTemplate>
<InsertItemTemplate>
ProductName:
<asp:TextBox ID="ProductNameTextBox"
runat="server"
Text='<%# Bind("ProductName") %>' />
<br />
ProductDescription:
<asp:TextBox ID="ProductDescriptionTextBox"
runat="server"
Text='<%# Bind("ProductDescription") %>' />
<br />
ProductShortDescription:
<asp:TextBox ID="ProductShortDescriptionTextBox"
runat="server"
Text='<%# Bind("ProductShortDescription") %>'
/>
<br />
Price:
<asp:TextBox ID="PriceTextBox" runat="server"
Text='<%# Bind("Price") %>' />
<br />
Category:
<asp:TextBox ID="CategoryTextBox" runat="server"
Text='<%# Bind("Category") %>' />
<br />
ProductImage:
<asp:TextBox ID="ProductImageTextBox"
runat="server"
Text='<%# Bind("ProductImage") %>' />
<br />
ProductImageThumb:
<asp:TextBox ID="ProductImageThumbTextBox"
runat="server"
Text='<%# Bind("ProductImageThumb") %>' />
<br />
<asp:LinkButton ID="InsertButton" runat="server"
CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;<asp:LinkButton ID="InsertCancelButton"
runat="server"
CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
<table class="style9">
<tr>
<td>
ProductID:</td>
<td>
<asp:Label ID="ProductIDLabel"
runat="server" Text='<%# Eval("ProductID") %>' />
</td>
</tr>
<tr>
<td>
Product Name:</td>
<td>
<asp:Label ID="ProductNameLabel"
runat="server"
Text='<%# Bind("ProductName") %>' />
</td>
</tr>
<tr>
<td>
Description:</td>
<td>
<asp:Label ID="ProductDescriptionLabel"
runat="server"
Text='<%# Bind("ProductDescription")
%>' />
</td>
</tr>
<tr>
<td>
Short Description:</td>
<td>
<asp:Label
ID="ProductShortDescriptionLabel" runat="server"
Text='<%#
Bind("ProductShortDescription") %>' />
</td>
</tr>
<tr>
<td>
Price:</td>
<td>
<asp:Label ID="PriceLabel" runat="server"
Text='<%# Bind("Price") %>' />
</td>
</tr>
<tr>
<td>
Category:</td>
<td>
<asp:Label ID="CategoryLabel"
runat="server" Text='<%# Bind("Category") %>' />
</td>
</tr>
<tr>
<td>
Image:</td>
<td>
<asp:Label ID="ProductImageLabel"
runat="server"
Text='<%# Bind("ProductImage") %>' />
</td>
</tr>
<tr>
<td>
&nbsp;ImageThumb:</td>
<td>
<asp:Label ID="ProductImageThumbLabel"
runat="server"
Text='<%# Bind("ProductImageThumb")
%>' />
</td>
</tr>
</table>
<asp:LinkButton ID="EditButton" runat="server"
CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton"
runat="server" CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;<asp:LinkButton ID="NewButton"
runat="server" CausesValidation="False"
CommandName="New" Text="New" />
</ItemTemplate>
</asp:FormView>
</p>
<p>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [ProductTable]
WHERE [ProductID] = @ProductID"
InsertCommand="INSERT INTO [ProductTable]
([ProductName], [ProductDescription],
[ProductShortDescription], [Price], [Category], [ProductImage],
[ProductImageThumb]) VALUES (@ProductName,
@ProductDescription, @ProductShortDescription, @Price,
@Category, @ProductImage, @ProductImageThumb)"
SelectCommand="SELECT * FROM [ProductTable]
Where ProductID = @ProductID"
UpdateCommand="UPDATE [ProductTable] SET
[ProductName] = @ProductName, [ProductDescription] =
@ProductDescription, [ProductShortDescription] =
@ProductShortDescription, [Price] = @Price, [Category] =
@Category, [ProductImage] = @ProductImage,
[ProductImageThumb] = @ProductImageThumb WHERE
[ProductID] = @ProductID">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1"
Name="ProductID"
PropertyName="SelectedValue" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="ProductID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="ProductName" Type="String"
/>
<asp:Parameter Name="ProductDescription"
Type="String" />
<asp:Parameter Name="ProductShortDescription"
Type="String" />
<asp:Parameter Name="Price" Type="Double" />
<asp:Parameter Name="Category" Type="String" />
<asp:Parameter Name="ProductImage"
Type="String" />
<asp:Parameter Name="ProductImageThumb"
Type="String" />
<asp:Parameter Name="ProductID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="ProductName" Type="String"
/>
<asp:Parameter Name="ProductDescription"
Type="String" />
<asp:Parameter Name="ProductShortDescription"
Type="String" />
<asp:Parameter Name="Price" Type="Double" />
<asp:Parameter Name="Category" Type="String" />
<asp:Parameter Name="ProductImage"
Type="String" />
<asp:Parameter Name="ProductImageThumb"
Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<br />
</p>
</asp:Content>
Online Car Sales/EWAPP/AdminMaintainItems.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class AdminMaintainItems : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void DropSearchCat_SelectedIndexChanged(object
sender, EventArgs e)
{
}
protected void FormView2_ItemUpdated(object sender,
FormViewUpdatedEventArgs e)
{
this.GridView1.DataBind();
}
}
Online Car
Sales/EWAPP/AdminMasterPage.masterHomeCategoriesUsersS
alesAdd Car(s)Manage Car(s)User Reviews
Name:
Name:
Welcome:
Logout
Welcome: Guest
Login
© OurShopping.Com 2013
Online Car Sales/EWAPP/AdminMasterPage.master.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
public partial class MasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["UserType"] == null ||
!Session["UserType"].Equals("admin"))
Response.Redirect("Default.aspx");
}
protected void LinkButton1_Click(object sender, EventArgs
e)
{
Session.Abandon();
Response.Redirect("MainPage.aspx");
}
protected void LinkButton2_Click(object sender, EventArgs
e)
{
Response.Redirect("login.aspx");
}
}
Online Car Sales/EWAPP/AdminSalesMaintenance.aspx
<%@ Page EnableEventValidation="false" Language="C#"
MasterPageFile="~/AdminMasterPage.master"
MaintainScrollPositionOnPostback="true"
AutoEventWireup="true"
CodeFile="AdminSalesMaintenance.aspx.cs"
Inherits="AdminSalesMaintenance" Title="OurShopping -
Online Shopping Store"%>
<asp:Content ID="Content1" ContentPlaceHolderID="head"
Runat="Server">
<style type="text/css">
.style9
{
width: 100%;
}
</style>
</asp:Content>
<asp:Content ID="Content2"
ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<p>
&nbsp;<asp:RadioButtonList ID="RadioButtonList1"
runat="server" AutoPostBack="True"
onselectedindexchanged="RadioButtonList1_SelectedIndexChan
ged">
<asp:ListItem Value="0">Show All Open
Orders</asp:ListItem>
<asp:ListItem Value="1">Show All Closed
Orders</asp:ListItem>
<asp:ListItem Value="2">Search For
Order</asp:ListItem>
</asp:RadioButtonList>
</p>
<p>
<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="View1" runat="server">
<hr />
<br />
All open Orders:<br />
<asp:GridView ID="GridView3" runat="server"
AutoGenerateColumns="False"
BackColor="White" BorderColor="#999999"
BorderStyle="None" BorderWidth="1px"
CellPadding="3" DataKeyNames="ShoppingID"
DataSourceID="SqlDataSource1"
GridLines="Vertical"
onrowupdated="GridView3_RowUpdated">
<FooterStyle BackColor="#CCCCCC"
ForeColor="Black" />
<RowStyle BackColor="#EEEEEE"
ForeColor="Black" />
<Columns>
<asp:CommandField ButtonType="Button"
ShowSelectButton="True" />
<asp:BoundField DataField="ShoppingID"
HeaderText="ShoppingID"
InsertVisible="False" ReadOnly="True"
SortExpression="ShoppingID" />
<asp:BoundField DataField="ProductIDNo"
HeaderText="ProductIDNo"
SortExpression="ProductIDNo" />
<asp:BoundField DataField="UserID"
HeaderText="UserID"
SortExpression="UserID" />
<asp:BoundField DataField="SalesStatus"
HeaderText="SalesStatus"
SortExpression="SalesStatus" />
<asp:BoundField DataField="qty"
HeaderText="qty" SortExpression="qty" />
</Columns>
<PagerStyle BackColor="#999999"
ForeColor="Black" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#008A8C" Font-
Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#000084" Font-
Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#DCDCDC" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1"
runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM
[ShoppingCart] WHERE (([SalesStatus] = @SalesStatus) OR
([SalesStatus] = @SalesStatus2)) AND
ShoppingCart.ShoppingID in (Select ShoppingID from
FinalizedOrders)">
<SelectParameters>
<asp:Parameter DefaultValue="Open"
Name="SalesStatus" Type="String" />
<asp:Parameter DefaultValue="Pending"
Name="SalesStatus2" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<br />
<asp:SqlDataSource ID="SqlDataSource4"
runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM
[ShoppingCart] WHERE [ShoppingID] = @ShoppingID"
InsertCommand="INSERT INTO [ShoppingCart]
([ProductIDNo], [UserID], [SalesStatus], [qty]) VALUES
(@ProductIDNo, @UserID, @SalesStatus, @qty)"
SelectCommand="SELECT
ShoppingCart.ShoppingID, ShoppingCart.ProductIDNo,
ShoppingCart.UserID, ShoppingCart.SalesStatus,
ShoppingCart.qty, ProductTable.Price,
ProductTable.ProductName, UserTable.Email,
UserTable.Address, UserTable.Name FROM ShoppingCart
INNER JOIN UserTable ON ShoppingCart.UserID =
UserTable.Username INNER JOIN ProductTable ON
ShoppingCart.ProductIDNo = ProductTable.ProductID WHERE
(ShoppingCart.ShoppingID = @ShoppingID)"
UpdateCommand="UPDATE [ShoppingCart] SET
[ProductIDNo] = @ProductIDNo, [UserID] = @UserID,
[SalesStatus] = @SalesStatus, [qty] = @qty WHERE
[ShoppingID] = @ShoppingID">
<SelectParameters>
<asp:ControlParameter ControlID="GridView3"
Name="ShoppingID"
PropertyName="SelectedValue" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="ShoppingID"
Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="ProductIDNo"
Type="String" />
<asp:Parameter Name="UserID" Type="String"
/>
<asp:Parameter Name="SalesStatus"
Type="String" />
<asp:Parameter Name="qty" Type="Int32" />
<asp:Parameter Name="ShoppingID"
Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="ProductIDNo"
Type="String" />
<asp:Parameter Name="UserID" Type="String"
/>
<asp:Parameter Name="SalesStatus"
Type="String" />
<asp:Parameter Name="qty" Type="Int32" />
</InsertParameters>
</asp:SqlDataSource>
<br />
<asp:FormView ID="FormView2" runat="server"
BackColor="White"
BorderColor="#CCCCCC" BorderStyle="None"
BorderWidth="1px" CellPadding="3"
DataKeyNames="ShoppingID"
DataSourceID="SqlDataSource4" GridLines="Both"
onitemupdated="FormView2_ItemUpdated"
Width="205px">
<FooterStyle BackColor="White"
ForeColor="#000066" />
<RowStyle ForeColor="#000066" />
<EditItemTemplate>
<table class="style9"
style="border-bottom-style: solid; border-
bottom-color: #000080;">
<tr>
<td>
ShoppingID:</td>
<td>
<asp:Label ID="ShoppingIDLabel"
runat="server"
Text='<%# Eval("ShoppingID") %>'
/>
</td>
</tr>
<tr>
<td>
ProductIDNo:</td>
<td>
<asp:Label ID="ProductIDNoLabel0"
runat="server"
Text='<%# Bind("ProductIDNo")
%>' />
</td>
</tr>
<tr>
<td>
UserID:</td>
<td>
<asp:Label ID="UserIDLabel0"
runat="server" Text='<%# Bind("UserID") %>' />
</td>
</tr>
<tr>
<td>
SalesStatus:</td>
<td>
<asp:DropDownList
ID="DropDownList1" runat="server"
SelectedValue='<%#
Bind("SalesStatus") %>'>
<asp:ListItem>Open</asp:ListItem>
<asp:ListItem>Pending</asp:ListItem>
<asp:ListItem>Completed</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
qty:</td>
<td>
<asp:Label ID="qtyLabel0"
runat="server" Text='<%# Bind("qty") %>' />
</td>
</tr>
<tr>
<td>
Price:</td>
<td>
<asp:Label ID="PriceLabel0"
runat="server" Text='<%# Bind("Price") %>' />
</td>
</tr>
<tr>
<td>
ProductName:</td>
<td>
<asp:Label ID="ProductNameLabel0"
runat="server"
Text='<%# Bind("ProductName")
%>' />
</td>
</tr>
<tr>
<td>
Email:</td>
<td>
<asp:Label ID="EmailLabel0"
runat="server" Text='<%# Bind("Email") %>' />
</td>
</tr>
<tr>
<td>
Address:</td>
<td>
<asp:Label ID="AddressLabel0"
runat="server" Text='<%# Bind("Address") %>' />
</td>
</tr>
<tr>
<td>
Name:</td>
<td>
<asp:Label ID="NameLabel0"
runat="server" Text='<%# Bind("Name") %>' />
</td>
</tr>
</table>
<asp:LinkButton ID="EditButton"
runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton"
runat="server" CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;<br />
<asp:LinkButton ID="UpdateButton"
runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton
ID="UpdateCancelButton" runat="server"
CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<InsertItemTemplate>
ProductIDNo:
<asp:TextBox ID="ProductIDNoTextBox"
runat="server"
Text='<%# Bind("ProductIDNo") %>' />
<br />
UserID:
<asp:TextBox ID="UserIDTextBox"
runat="server" Text='<%# Bind("UserID") %>' />
<br />
SalesStatus:
<asp:TextBox ID="SalesStatusTextBox"
runat="server"
Text='<%# Bind("SalesStatus") %>' />
<br />
qty:
<asp:TextBox ID="qtyTextBox" runat="server"
Text='<%# Bind("qty") %>' />
<br />
Price:
<asp:TextBox ID="PriceTextBox"
runat="server" Text='<%# Bind("Price") %>' />
<br />
ProductName:
<asp:TextBox ID="ProductNameTextBox"
runat="server"
Text='<%# Bind("ProductName") %>' />
<br />
Email:
<asp:TextBox ID="EmailTextBox"
runat="server" Text='<%# Bind("Email") %>' />
<br />
Address:
<asp:TextBox ID="AddressTextBox"
runat="server" Text='<%# Bind("Address") %>' />
<br />
Name:
<asp:TextBox ID="NameTextBox"
runat="server" Text='<%# Bind("Name") %>' />
<br />
<asp:LinkButton ID="InsertButton"
runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;<asp:LinkButton
ID="InsertCancelButton" runat="server"
CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
<table class="style9" style="border-bottom-
style: solid; border-color: #000080">
<tr>
<td>
ShoppingID:</td>
<td>
<asp:Label ID="ShoppingIDLabel"
runat="server"
Text='<%# Eval("ShoppingID") %>'
/>
</td>
</tr>
<tr>
<td>
ProductIDNo:</td>
<td>
<asp:Label ID="ProductIDNoLabel"
runat="server"
Text='<%# Bind("ProductIDNo")
%>' />
</td>
</tr>
<tr>
<td>
UserID:</td>
<td>
<asp:Label ID="UserIDLabel"
runat="server" Text='<%# Bind("UserID") %>' />
</td>
</tr>
<tr>
<td>
SalesStatus:</td>
<td>
<asp:Label ID="SalesStatusLabel"
runat="server"
Text='<%# Bind("SalesStatus") %>'
/>
</td>
</tr>
<tr>
<td>
qty:</td>
<td>
<asp:Label ID="qtyLabel"
runat="server" Text='<%# Bind("qty") %>' />
</td>
</tr>
<tr>
<td>
Price:</td>
<td>
<asp:Label ID="PriceLabel"
runat="server" Text='<%# Bind("Price") %>' />
</td>
</tr>
<tr>
<td>
ProductName:</td>
<td>
<asp:Label ID="ProductNameLabel"
runat="server"
Text='<%# Bind("ProductName")
%>' />
</td>
</tr>
<tr>
<td>
Email:</td>
<td>
<asp:Label ID="EmailLabel"
runat="server" Text='<%# Bind("Email") %>' />
</td>
</tr>
<tr>
<td>
Address:</td>
<td>
<asp:Label ID="AddressLabel"
runat="server" Text='<%# Bind("Address") %>' />
</td>
</tr>
<tr>
<td>
Name:</td>
<td>
<asp:Label ID="NameLabel"
runat="server" Text='<%# Bind("Name") %>' />
</td>
</tr>
</table>
&nbsp;<asp:LinkButton ID="EditButton"
runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton"
runat="server" CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;
</ItemTemplate>
<PagerStyle BackColor="White"
ForeColor="#000066" HorizontalAlign="Left" />
<HeaderStyle BackColor="#006699" Font-
Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#669999" Font-
Bold="True" ForeColor="White" />
</asp:FormView>
<br />
</asp:View>
<br />
<br />
<asp:View ID="View2" runat="server">
<hr />
All Closed Orders:<br />
<br />
<asp:GridView ID="GridView2" runat="server"
AutoGenerateColumns="False"
DataKeyNames="ShoppingID"
DataSourceID="SqlDataSource2" BackColor="White"
BorderColor="#999999" BorderStyle="None"
BorderWidth="1px" CellPadding="3"
GridLines="Vertical">
<FooterStyle BackColor="#CCCCCC"
ForeColor="Black" />
<RowStyle BackColor="#EEEEEE"
ForeColor="Black" />
<Columns>
<asp:CommandField ShowSelectButton="True"
/>
<asp:BoundField DataField="ShoppingID"
HeaderText="ShoppingID"
InsertVisible="False" ReadOnly="True"
SortExpression="ShoppingID" />
<asp:BoundField DataField="ProductIDNo"
HeaderText="ProductIDNo"
SortExpression="ProductIDNo" />
<asp:BoundField DataField="UserID"
HeaderText="UserID"
SortExpression="UserID" />
<asp:BoundField DataField="SalesStatus"
HeaderText="SalesStatus"
SortExpression="SalesStatus" />
<asp:BoundField DataField="qty"
HeaderText="qty"
SortExpression="qty" />
</Columns>
<PagerStyle BackColor="#999999"
ForeColor="Black" HorizontalAlign="Center" />
<EmptyDataTemplate>
<span class="style10"><b>No Closed
orders</b></span>
</EmptyDataTemplate>
<SelectedRowStyle BackColor="#008A8C" Font-
Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#000084" Font-
Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#DCDCDC" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource2"
runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM
[ShoppingCart] WHERE ([SalesStatus] = @SalesStatus)">
<SelectParameters>
<asp:Parameter DefaultValue="Completed"
Name="SalesStatus" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<br />
<br />
<asp:FormView ID="FormView3" runat="server"
BackColor="White"
BorderColor="#CCCCCC" BorderStyle="None"
BorderWidth="1px" CellPadding="3"
DataKeyNames="ShoppingID"
DataSourceID="SqlDataSource5" GridLines="Both"
onitemupdated="FormView2_ItemUpdated"
Width="205px">
<FooterStyle BackColor="White"
ForeColor="#000066" />
<RowStyle ForeColor="#000066" />
<EditItemTemplate>
<table class="style9"
style="border-bottom-style: solid; border-
bottom-color: #000080;">
<tr>
<td>
ShoppingID:</td>
<td>
<asp:Label ID="ShoppingIDLabel0"
runat="server"
Text='<%# Eval("ShoppingID") %>'
/>
</td>
</tr>
<tr>
<td>
ProductIDNo:</td>
<td>
<asp:Label ID="ProductIDNoLabel1"
runat="server"
Text='<%# Bind("ProductIDNo")
%>' />
</td>
</tr>
<tr>
<td>
UserID:</td>
<td>
<asp:Label ID="UserIDLabel1"
runat="server" Text='<%# Bind("UserID") %>' />
</td>
</tr>
<tr>
<td>
SalesStatus:</td>
<td>
<asp:DropDownList
ID="DropDownList2" runat="server"
SelectedValue='<%#
Bind("SalesStatus") %>'>
<asp:ListItem>Open</asp:ListItem>
<asp:ListItem>Pending</asp:ListItem>
<asp:ListItem>Completed</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
qty:</td>
<td>
<asp:Label ID="qtyLabel1"
runat="server" Text='<%# Bind("qty") %>' />
</td>
</tr>
<tr>
<td>
Price:</td>
<td>
<asp:Label ID="PriceLabel1"
runat="server" Text='<%# Bind("Price") %>' />
</td>
</tr>
<tr>
<td>
ProductName:</td>
<td>
<asp:Label ID="ProductNameLabel1"
runat="server"
Text='<%# Bind("ProductName")
%>' />
</td>
</tr>
<tr>
<td>
Email:</td>
<td>
<asp:Label ID="EmailLabel1"
runat="server" Text='<%# Bind("Email") %>' />
</td>
</tr>
<tr>
<td>
Address:</td>
<td>
<asp:Label ID="AddressLabel1"
runat="server" Text='<%# Bind("Address") %>' />
</td>
</tr>
<tr>
<td>
Name:</td>
<td>
<asp:Label ID="NameLabel1"
runat="server" Text='<%# Bind("Name") %>' />
</td>
</tr>
</table>
<asp:LinkButton ID="UpdateCancelButton"
runat="server" CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
&nbsp;<asp:LinkButton ID="UpdateButton0"
runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;
</EditItemTemplate>
<InsertItemTemplate>
ProductIDNo:
<asp:TextBox ID="ProductIDNoTextBox"
runat="server"
Text='<%# Bind("ProductIDNo") %>' />
<br />
UserID:
<asp:TextBox ID="UserIDTextBox"
runat="server" Text='<%# Bind("UserID") %>' />
<br />
SalesStatus:
<asp:TextBox ID="SalesStatusTextBox"
runat="server"
Text='<%# Bind("SalesStatus") %>' />
<br />
qty:
<asp:TextBox ID="qtyTextBox" runat="server"
Text='<%# Bind("qty") %>' />
<br />
Price:
<asp:TextBox ID="PriceTextBox"
runat="server" Text='<%# Bind("Price") %>' />
<br />
ProductName:
<asp:TextBox ID="ProductNameTextBox"
runat="server"
Text='<%# Bind("ProductName") %>' />
<br />
Email:
<asp:TextBox ID="EmailTextBox"
runat="server" Text='<%# Bind("Email") %>' />
<br />
Address:
<asp:TextBox ID="AddressTextBox"
runat="server" Text='<%# Bind("Address") %>' />
<br />
Name:
<asp:TextBox ID="NameTextBox"
runat="server" Text='<%# Bind("Name") %>' />
<br />
<asp:LinkButton ID="InsertButton"
runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;<asp:LinkButton
ID="InsertCancelButton" runat="server"
CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
<table class="style9" style="border-bottom-
style: solid; border-color: #000080">
<tr>
<td>
ShoppingID:</td>
<td>
<asp:Label ID="ShoppingIDLabel1"
runat="server"
Text='<%# Eval("ShoppingID") %>'
/>
</td>
</tr>
<tr>
<td>
ProductIDNo:</td>
<td>
<asp:Label ID="ProductIDNoLabel2"
runat="server"
Text='<%# Bind("ProductIDNo")
%>' />
</td>
</tr>
<tr>
<td>
UserID:</td>
<td>
<asp:Label ID="UserIDLabel2"
runat="server" Text='<%# Bind("UserID") %>' />
</td>
</tr>
<tr>
<td>
SalesStatus:</td>
<td>
<asp:Label ID="SalesStatusLabel0"
runat="server"
Text='<%# Bind("SalesStatus") %>'
/>
</td>
</tr>
<tr>
<td>
qty:</td>
<td>
<asp:Label ID="qtyLabel2"
runat="server" Text='<%# Bind("qty") %>' />
</td>
</tr>
<tr>
<td>
Price:</td>
<td>
<asp:Label ID="PriceLabel2"
runat="server" Text='<%# Bind("Price") %>' />
</td>
</tr>
<tr>
<td>
ProductName:</td>
<td>
<asp:Label ID="ProductNameLabel2"
runat="server"
Text='<%# Bind("ProductName")
%>' />
</td>
</tr>
<tr>
<td>
Email:</td>
<td>
<asp:Label ID="EmailLabel2"
runat="server" Text='<%# Bind("Email") %>' />
</td>
</tr>
<tr>
<td>
Address:</td>
<td>
<asp:Label ID="AddressLabel2"
runat="server" Text='<%# Bind("Address") %>' />
</td>
</tr>
<tr>
<td>
Name:</td>
<td>
<asp:Label ID="NameLabel2"
runat="server" Text='<%# Bind("Name") %>' />
</td>
</tr>
</table>
<asp:LinkButton ID="EditButton0"
runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton1"
runat="server" CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;
</ItemTemplate>
<PagerStyle BackColor="White"
ForeColor="#000066" HorizontalAlign="Left" />
<HeaderStyle BackColor="#006699" Font-
Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#669999" Font-
Bold="True" ForeColor="White" />
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource5"
runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM
[ShoppingCart] WHERE [ShoppingID] = @ShoppingID"
InsertCommand="INSERT INTO [ShoppingCart]
([ProductIDNo], [UserID], [SalesStatus], [qty]) VALUES
(@ProductIDNo, @UserID, @SalesStatus, @qty)"
SelectCommand="SELECT
ShoppingCart.ShoppingID, ShoppingCart.ProductIDNo,
ShoppingCart.UserID, ShoppingCart.SalesStatus,
ShoppingCart.qty, ProductTable.Price,
ProductTable.ProductName, UserTable.Email,
UserTable.Address, UserTable.Name FROM ShoppingCart
INNER JOIN UserTable ON ShoppingCart.UserID =
UserTable.Username INNER JOIN ProductTable ON
ShoppingCart.ProductIDNo = ProductTable.ProductID where
ShoppingID = @ShoppingID"
UpdateCommand="UPDATE [ShoppingCart] SET
[ProductIDNo] = @ProductIDNo, [UserID] = @UserID,
[SalesStatus] = @SalesStatus, [qty] = @qty WHERE
[ShoppingID] = @ShoppingID">
<SelectParameters>
<asp:ControlParameter ControlID="GridView2"
Name="ShoppingID"
PropertyName="SelectedValue" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="ShoppingID"
Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="ProductIDNo"
Type="String" />
<asp:Parameter Name="UserID" Type="String"
/>
<asp:Parameter Name="SalesStatus"
Type="String" />
<asp:Parameter Name="qty" Type="Int32" />
<asp:Parameter Name="ShoppingID"
Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="ProductIDNo"
Type="String" />
<asp:Parameter Name="UserID" Type="String"
/>
<asp:Parameter Name="SalesStatus"
Type="String" />
<asp:Parameter Name="qty" Type="Int32" />
</InsertParameters>
</asp:SqlDataSource>
</asp:View>
<br />
<asp:View ID="View3" runat="server">
<hr />
Enter Order Number:
<asp:TextBox ID="txtSearchSerial"
runat="server"></asp:TextBox>
<br />
<br />
<asp:FormView ID="FormView4" runat="server"
BackColor="White"
BorderColor="#CCCCCC" BorderStyle="None"
BorderWidth="1px" CellPadding="3"
DataKeyNames="ShoppingID"
DataSourceID="SqlDataSource3" GridLines="Both"
onitemupdated="FormView2_ItemUpdated"
Width="205px">
<FooterStyle BackColor="White"
ForeColor="#000066" />
<RowStyle ForeColor="#000066" />
<EditItemTemplate>
<table class="style9"
style="border-bottom-style: solid; border-
bottom-color: #000080;">
<tr>
<td>
ShoppingID:</td>
<td>
<asp:Label ID="ShoppingIDLabel2"
runat="server"
Text='<%# Eval("ShoppingID") %>'
/>
</td>
</tr>
<tr>
<td>
ProductIDNo:</td>
<td>
<asp:Label ID="ProductIDNoLabel3"
runat="server"
Text='<%# Bind("ProductIDNo")
%>' />
</td>
</tr>
<tr>
<td>
UserID:</td>
<td>
<asp:Label ID="UserIDLabel3"
runat="server" Text='<%# Bind("UserID") %>' />
</td>
</tr>
<tr>
<td>
SalesStatus:</td>
<td>
<asp:DropDownList
ID="DropDownList3" runat="server"
SelectedValue='<%#
Bind("SalesStatus") %>'>
<asp:ListItem>Open</asp:ListItem>
<asp:ListItem>Pending</asp:ListItem>
<asp:ListItem>Completed</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
qty:</td>
<td>
<asp:Label ID="qtyLabel3"
runat="server" Text='<%# Bind("qty") %>' />
</td>
</tr>
<tr>
<td>
Price:</td>
<td>
<asp:Label ID="PriceLabel3"
runat="server" Text='<%# Bind("Price") %>' />
</td>
</tr>
<tr>
<td>
ProductName:</td>
<td>
<asp:Label ID="ProductNameLabel3"
runat="server"
Text='<%# Bind("ProductName")
%>' />
</td>
</tr>
<tr>
<td>
Email:</td>
<td>
<asp:Label ID="EmailLabel3"
runat="server" Text='<%# Bind("Email") %>' />
</td>
</tr>
<tr>
<td>
Address:</td>
<td>
<asp:Label ID="AddressLabel3"
runat="server" Text='<%# Bind("Address") %>' />
</td>
</tr>
<tr>
<td>
Name:</td>
<td>
<asp:Label ID="NameLabel3"
runat="server" Text='<%# Bind("Name") %>' />
</td>
</tr>
</table>
<asp:LinkButton ID="UpdateCancelButton0"
runat="server"
CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
&nbsp;<asp:LinkButton ID="UpdateButton1"
runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;
</EditItemTemplate>
<InsertItemTemplate>
ProductIDNo:
<asp:TextBox ID="ProductIDNoTextBox0"
runat="server"
Text='<%# Bind("ProductIDNo") %>' />
<br />
UserID:
<asp:TextBox ID="UserIDTextBox0"
runat="server" Text='<%# Bind("UserID") %>' />
<br />
SalesStatus:
<asp:TextBox ID="SalesStatusTextBox0"
runat="server"
Text='<%# Bind("SalesStatus") %>' />
<br />
qty:
<asp:TextBox ID="qtyTextBox0"
runat="server" Text='<%# Bind("qty") %>' />
<br />
Price:
<asp:TextBox ID="PriceTextBox0"
runat="server" Text='<%# Bind("Price") %>' />
<br />
ProductName:
<asp:TextBox ID="ProductNameTextBox0"
runat="server"
Text='<%# Bind("ProductName") %>' />
<br />
Email:
<asp:TextBox ID="EmailTextBox0"
runat="server" Text='<%# Bind("Email") %>' />
<br />
Address:
<asp:TextBox ID="AddressTextBox0"
runat="server"
Text='<%# Bind("Address") %>' />
<br />
Name:
<asp:TextBox ID="NameTextBox0"
runat="server" Text='<%# Bind("Name") %>' />
<br />
<asp:LinkButton ID="InsertButton0"
runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;<asp:LinkButton
ID="InsertCancelButton0" runat="server"
CausesValidation="False"
CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
<table class="style9" style="border-bottom-
style: solid; border-color: #000080">
<tr>
<td>
ShoppingID:</td>
<td>
<asp:Label ID="ShoppingIDLabel3"
runat="server"
Text='<%# Eval("ShoppingID") %>'
/>
</td>
</tr>
<tr>
<td>
ProductIDNo:</td>
<td>
<asp:Label ID="ProductIDNoLabel4"
runat="server"
Text='<%# Bind("ProductIDNo")
%>' />
</td>
</tr>
<tr>
<td>
UserID:</td>
<td>
<asp:Label ID="UserIDLabel4"
runat="server" Text='<%# Bind("UserID") %>' />
</td>
</tr>
<tr>
<td>
SalesStatus:</td>
<td>
<asp:Label ID="SalesStatusLabel1"
runat="server"
Text='<%# Bind("SalesStatus") %>'
/>
</td>
</tr>
<tr>
<td>
qty:</td>
<td>
<asp:Label ID="qtyLabel4"
runat="server" Text='<%# Bind("qty") %>' />
</td>
</tr>
<tr>
<td>
Price:</td>
<td>
<asp:Label ID="PriceLabel4"
runat="server" Text='<%# Bind("Price") %>' />
</td>
</tr>
<tr>
<td>
ProductName:</td>
<td>
<asp:Label ID="ProductNameLabel4"
runat="server"
Text='<%# Bind("ProductName")
%>' />
</td>
</tr>
<tr>
<td>
Email:</td>
<td>
<asp:Label ID="EmailLabel4"
runat="server" Text='<%# Bind("Email") %>' />
</td>
</tr>
<tr>
<td>
Address:</td>
<td>
<asp:Label ID="AddressLabel4"
runat="server" Text='<%# Bind("Address") %>' />
</td>
</tr>
<tr>
<td>
Name:</td>
<td>
<asp:Label ID="NameLabel4"
runat="server" Text='<%# Bind("Name") %>' />
</td>
</tr>
</table>
<asp:LinkButton ID="EditButton1"
runat="server" CausesValidation="False"
CommandName="Edit" Text="Edit" />
&nbsp;<asp:LinkButton ID="DeleteButton2"
runat="server" CausesValidation="False"
CommandName="Delete" Text="Delete" />
&nbsp;
</ItemTemplate>
<PagerStyle BackColor="White"
ForeColor="#000066" HorizontalAlign="Left" />
<HeaderStyle BackColor="#006699" Font-
Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#669999" Font-
Bold="True" ForeColor="White" />
</asp:FormView>
<br />
<br />
<asp:SqlDataSource ID="SqlDataSource3"
runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT
ShoppingCart.ShoppingID, ShoppingCart.ProductIDNo,
ShoppingCart.UserID, ShoppingCart.SalesStatus,
ShoppingCart.qty, ProductTable.Price,
ProductTable.ProductName, UserTable.Email,
UserTable.Address, UserTable.Name FROM ShoppingCart
INNER JOIN UserTable ON ShoppingCart.UserID =
UserTable.Username INNER JOIN ProductTable ON
ShoppingCart.ProductIDNo = ProductTable.ProductID WHERE
([ShoppingID] = @ShoppingID)"
UpdateCommand="UPDATE [ShoppingCart] SET
[ProductIDNo] = @ProductIDNo, [UserID] = @UserID,
[SalesStatus] = @SalesStatus, [qty] = @qty WHERE
[ShoppingID] = @ShoppingID">
<SelectParameters>
<asp:ControlParameter
ControlID="txtSearchSerial" Name="ShoppingID"
PropertyName="Text" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</asp:View>
<br />
<br />
</asp:MultiView>
</p>
<p>
&nbsp;</p>
</asp:Content>
Online Car Sales/EWAPP/AdminSalesMaintenance.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;
using System.Net.Mail;
public partial class AdminSalesMaintenance :
System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void
RadioButtonList1_SelectedIndexChanged(object sender,
EventArgs e)
{
MultiView1.ActiveViewIndex =
RadioButtonList1.SelectedIndex;
}
protected void FormView2_ItemUpdated(object sender,
FormViewUpdatedEventArgs e)
{
this.GridView3.DataBind();
String ToEMail =
(FormView2.Row.FindControl("EmailLabel0") as Label).Text;
using (StringWriter sw = new StringWriter())
{
using (HtmlTextWriter hw = new HtmlTextWriter(sw))
{
FormView2.RenderControl(hw);
StringReader sr = new StringReader(sw.ToString());
MailMessage mm = new
MailMessage("[email protected]", ToEMail);
mm.Subject = "Your Order Status has been
modified";
mm.Body = "Order Status: " + sw.ToString() +
"<br><br> You will be Notified Once Your Order is processed";
mm.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
System.Net.NetworkCredential NetworkCred = new
System.Net.NetworkCredential();
NetworkCred.UserName = "[email protected]";
NetworkCred.Password = "aminroop";
smtp.UseDefaultCredentials = true;
smtp.Credentials = NetworkCred;
smtp.Port = 587;
smtp.Send(mm);
}
}
}
public override void VerifyRenderingInServerForm(Control
control)
{
/* Verifies that the control is rendered */
}
protected void FormView3_ItemUpdated(object sender,
FormViewUpdatedEventArgs e)
{
this.GridView2.DataBind();
}
protected void GridView3_RowUpdated(object sender,
GridViewUpdatedEventArgs e)
{
}
}
Online Car Sales/EWAPP/AdminUserMaintenance.aspx
<%@ Page Language="C#"
MasterPageFile="~/AdminMasterPage.master"
MaintainScrollPositionOnPostback="true"
AutoEventWireup="true"
CodeFile="AdminUserMaintenance.aspx.cs"
Inherits="AdminUserMaintenance" Title="OurShopping -
Online Shopping Store" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head"
Runat="Server">
<style type="text/css">
.style17
{
width: 100%;
}
.style19
{
text-align: center;
font-weight: bold;
font-size: medium;
}
.style18
{
width: 156px;
}
.style20
{
width: 132px;
}
</style>
</asp:Content>
<asp:Content ID="Content2"
ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<asp:RadioButtonList ID="RadioButtonList1" runat="server"
AutoPostBack="True"
onselectedindexchanged="RadioButtonList1_SelectedIndexChan
ged">
<asp:ListItem Value="0">Add New
Account</asp:ListItem>
<asp:ListItem Value="1">View / modify My
account</asp:ListItem>
<asp:ListItem Value="2">View / Modify All User
Accounts</asp:ListItem>
</asp:RadioButtonList>
<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="View1" runat="server">
<table class="style17">
<tr>
<td class="style19" colspan="2"
style="border-color: #000080; background-
color: #AABFEA; border-bottom-style: solid;">
Add New Administrator Account</td>
</tr>
<tr>
<td class="style18">
Name</td>
<td>
<asp:TextBox ID="txtName" runat="server"
Width="139px"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtName"
ErrorMessage="Name Is
requierd">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style18">
Passport Number</td>
<td>
<asp:TextBox ID="txtpassportNumber"
runat="server" Width="139px"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator2" runat="server"
ControlToValidate="txtpassportNumber"
ErrorMessage="Please Enter your Passport
Number">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style18">
UserName</td>
<td>
<asp:TextBox ID="txtUserName"
runat="server" Width="139px"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator3" runat="server"
ControlToValidate="txtUserName"
ErrorMessage="Please Enter your
username">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style18">
Password</td>
<td>
<asp:TextBox ID="txtPassword1"
runat="server" Width="139px"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator4" runat="server"
ControlToValidate="txtPassword1"
ErrorMessage="please enter your
password">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style18">
Re-Type Password</td>
<td>
<asp:TextBox ID="txtpassword2"
runat="server" Width="137px"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator5" runat="server"
ControlToValidate="txtpassword2"
ErrorMessage="please enter The password
again">*</asp:RequiredFieldValidator>
<asp:CompareValidator
ID="CompareValidator1" runat="server"
ControlToCompare="txtPassword1"
ControlToValidate="txtpassword2"
ErrorMessage="Password is not
matched">*</asp:CompareValidator>
</td>
</tr>
<tr>
<td class="style18">
Email</td>
<td>
<asp:TextBox ID="txtEmail1" runat="server"
Width="136px"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator6" runat="server"
ControlToValidate="txtEmail1"
ErrorMessage="Please Enter your
Email">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator
ID="RegularExpressionValidator1" runat="server"
ControlToValidate="txtEmail1"
ErrorMessage="RegularExpressionValidator"
ValidationExpression="w+([-
+.']w+)*@w+([-.]w+)*.w+([-
.]w+)*">*</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td class="style18">
Confirm your Email</td>
<td>
<asp:TextBox ID="txtEmail2" runat="server"
Width="138px"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator7" runat="server"
ControlToValidate="txtEmail2"
ErrorMessage="Please Enter your
Email">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator
ID="RegularExpressionValidator2" runat="server"
ControlToValidate="txtEmail2"
ErrorMessage="accepted format is [email protected]"
ValidationExpression="w+([-
+.']w+)*@w+([-.]w+)*.w+([-
.]w+)*">*</asp:RegularExpressionValidator>
<asp:CompareValidator
ID="CompareValidator2" runat="server"
ControlToCompare="txtEmail1"
ControlToValidate="txtEmail2"
ErrorMessage="The Email address does not
matched">*</asp:CompareValidator>
</td>
</tr>
<tr>
<td class="style18">
Address:</td>
<td>
<asp:TextBox ID="txtAddress" runat="server"
TextMode="MultiLine" Width="141px"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator8" runat="server"
ControlToValidate="txtAddress"
ErrorMessage="accepted format is
[email protected]">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style18">
Choose the user Role</td>
<td>
<asp:ListBox ID="ListBox1" runat="server"
AutoPostBack="True">
<asp:ListItem>admin</asp:ListItem>
<asp:ListItem>user</asp:ListItem>
</asp:ListBox>
</td>
</tr>
<tr>
<td class="style18">
&nbsp;</td>
<td>
<asp:Label ID="Label1" runat="server"
ForeColor="#000066"></asp:Label>
<asp:ValidationSummary
ID="ValidationSummary1" runat="server" />
</td>
</tr>
<tr>
<td class="style18">
<asp:SqlDataSource ID="SqlDataSource2"
runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM
[UserTable] WHERE [ID] = @ID"
InsertCommand="INSERT INTO [UserTable]
([Username], [Password], [Email], [Address], [Name],
[IDnumber], [UserType]) VALUES (@Username, @Password,
@Email, @Address, @Name, @IDnumber, @UserType)"
SelectCommand="SELECT * FROM
[UserTable]"
UpdateCommand="UPDATE [UserTable]
SET [Username] = @Username, [Password] = @Password,
[Email] = @Email, [Address] = @Address, [Name] = @Name,
[IDnumber] = @IDnumber, [UserType] = @UserType WHERE
[ID] = @ID">
<DeleteParameters>
<asp:Parameter Name="ID" Type="Int32"
/>
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Username"
Type="String" />
<asp:Parameter Name="Password"
Type="String" />
<asp:Parameter Name="Email"
Type="String" />
<asp:Parameter Name="Address"
Type="String" />
<asp:Parameter Name="Name"
Type="String" />
<asp:Parameter Name="IDnumber"
Type="String" />
<asp:Parameter Name="UserType"
Type="String" />
<asp:Parameter Name="ID" Type="Int32"
/>
</UpdateParameters>
<InsertParameters>
<asp:ControlParameter
ControlID="txtUserName" Name="Username"
PropertyName="Text" Type="String" />
<asp:ControlParameter
ControlID="txtPassword1" Name="Password"
PropertyName="Text" Type="String" />
<asp:ControlParameter
ControlID="txtEmail1" Name="Email" PropertyName="Text"
Type="String" />
<asp:ControlParameter
ControlID="txtAddress" Name="Address"
PropertyName="Text"
Type="String" />
<asp:ControlParameter
ControlID="txtName" Name="Name" PropertyName="Text"
Type="String" />
<asp:ControlParameter
ControlID="txtpassportNumber" Name="IDnumber"
PropertyName="Text" Type="String" />
<asp:ControlParameter
ControlID="ListBox1" Name="UserType"
PropertyName="SelectedValue"
Type="String" />
</InsertParameters>
</asp:SqlDataSource>
</td>
<td>
<asp:Button ID="Button1" runat="server"
onclick="Button1_Click"
Text="Register" />
</td>
</tr>
</table>
</asp:View>
<br />
<br />
<asp:View ID="View2" runat="server">
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False"
CellPadding="3" DataKeyNames="ID"
DataSourceID="SqlDataSource3"
GridLines="Vertical" BackColor="White"
BorderColor="#999999" BorderStyle="None"
BorderWidth="1px">
<FooterStyle BackColor="#CCCCCC"
ForeColor="Black" />
<RowStyle BackColor="#EEEEEE"
ForeColor="Black" />
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="ID"
HeaderText="ID" InsertVisible="False"
ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="Username"
HeaderText="Username"
SortExpression="Username" />
<asp:BoundField DataField="Password"
HeaderText="Password"
SortExpression="Password" />
<asp:BoundField DataField="Email"
HeaderText="Email" SortExpression="Email" />
<asp:BoundField DataField="Address"
HeaderText="Address"
SortExpression="Address" />
<asp:BoundField DataField="Name"
HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="IDnumber"
HeaderText="IDnumber"
SortExpression="IDnumber" />
</Columns>
<PagerStyle BackColor="#999999"
ForeColor="Black" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#008A8C" Font-
Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#000084" Font-
Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#DCDCDC" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource3"
runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [UserTable]
WHERE ([UserType] = @UserType) AND ([Username] =
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx

More Related Content

Similar to My project working well, but there no relationship between the t.docx

sri_ITSD325_IP3Code-ShoppingAbout UsfrmAboutus.aspx@ Page.docx
sri_ITSD325_IP3Code-ShoppingAbout UsfrmAboutus.aspx@ Page.docxsri_ITSD325_IP3Code-ShoppingAbout UsfrmAboutus.aspx@ Page.docx
sri_ITSD325_IP3Code-ShoppingAbout UsfrmAboutus.aspx@ Page.docx
whitneyleman54422
 
Desenvolvimento web com Ruby on Rails (parte 2)
Desenvolvimento web com Ruby on Rails (parte 2)Desenvolvimento web com Ruby on Rails (parte 2)
Desenvolvimento web com Ruby on Rails (parte 2)
Joao Lucas Santana
 
Introduction to angular js july 6th 2014
Introduction to angular js   july 6th 2014Introduction to angular js   july 6th 2014
Introduction to angular js july 6th 2014
Simona Clapan
 
Diva10
Diva10Diva10
Diva10
diva23
 
MYSQL
MYSQLMYSQL
MYSQL
ARJUN
 

Similar to My project working well, but there no relationship between the t.docx (20)

Converting DTDs to XML Schemas.pdf
Converting DTDs to XML Schemas.pdfConverting DTDs to XML Schemas.pdf
Converting DTDs to XML Schemas.pdf
 
Converting dt ds to xml schemas
Converting dt ds to xml schemasConverting dt ds to xml schemas
Converting dt ds to xml schemas
 
sri_ITSD325_IP3Code-ShoppingAbout UsfrmAboutus.aspx@ Page.docx
sri_ITSD325_IP3Code-ShoppingAbout UsfrmAboutus.aspx@ Page.docxsri_ITSD325_IP3Code-ShoppingAbout UsfrmAboutus.aspx@ Page.docx
sri_ITSD325_IP3Code-ShoppingAbout UsfrmAboutus.aspx@ Page.docx
 
Html server control - ASP. NET with c#
Html server control - ASP. NET with c#Html server control - ASP. NET with c#
Html server control - ASP. NET with c#
 
Vaadin Components @ Angular U
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular U
 
Desenvolvimento web com Ruby on Rails (parte 2)
Desenvolvimento web com Ruby on Rails (parte 2)Desenvolvimento web com Ruby on Rails (parte 2)
Desenvolvimento web com Ruby on Rails (parte 2)
 
Introduction to angular js july 6th 2014
Introduction to angular js   july 6th 2014Introduction to angular js   july 6th 2014
Introduction to angular js july 6th 2014
 
Creating web api and consuming part 2
Creating web api and consuming part 2Creating web api and consuming part 2
Creating web api and consuming part 2
 
Update statement in PHP
Update statement in PHPUpdate statement in PHP
Update statement in PHP
 
Working with Javascript in Rails
Working with Javascript in RailsWorking with Javascript in Rails
Working with Javascript in Rails
 
Idoc script beginner guide
Idoc script beginner guide Idoc script beginner guide
Idoc script beginner guide
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Broadleaf Presents Thymeleaf
Broadleaf Presents ThymeleafBroadleaf Presents Thymeleaf
Broadleaf Presents Thymeleaf
 
Html and css
Html and cssHtml and css
Html and css
 
Diva10
Diva10Diva10
Diva10
 
9. Php MongoDB cautarea unui document
9. Php MongoDB cautarea unui document9. Php MongoDB cautarea unui document
9. Php MongoDB cautarea unui document
 
16-DOMTree.pptx
16-DOMTree.pptx16-DOMTree.pptx
16-DOMTree.pptx
 
8. Php MongoDB stergerea unui document
8. Php MongoDB stergerea unui document8. Php MongoDB stergerea unui document
8. Php MongoDB stergerea unui document
 
MYSQL
MYSQLMYSQL
MYSQL
 
vue-components.pdf
vue-components.pdfvue-components.pdf
vue-components.pdf
 

More from rosemarybdodson23141

Your abilities in international management have been recognize.docx
Your abilities in international management have been recognize.docxYour abilities in international management have been recognize.docx
Your abilities in international management have been recognize.docx
rosemarybdodson23141
 
Young and the RestlessWeek 11 Couples Therapy Movie Experience .docx
Young and the RestlessWeek 11 Couples Therapy Movie Experience .docxYoung and the RestlessWeek 11 Couples Therapy Movie Experience .docx
Young and the RestlessWeek 11 Couples Therapy Movie Experience .docx
rosemarybdodson23141
 
You-Attitude A Linguistic PerspectiveLllita RodmanThe Uni.docx
You-Attitude A Linguistic PerspectiveLllita RodmanThe Uni.docxYou-Attitude A Linguistic PerspectiveLllita RodmanThe Uni.docx
You-Attitude A Linguistic PerspectiveLllita RodmanThe Uni.docx
rosemarybdodson23141
 
You  may have seen how financial news outlets provide real-time .docx
You  may have seen how financial news outlets provide real-time .docxYou  may have seen how financial news outlets provide real-time .docx
You  may have seen how financial news outlets provide real-time .docx
rosemarybdodson23141
 
You wrote this scenario from the perspective of Behaviorism learni.docx
You wrote this scenario from the perspective of Behaviorism learni.docxYou wrote this scenario from the perspective of Behaviorism learni.docx
You wrote this scenario from the perspective of Behaviorism learni.docx
rosemarybdodson23141
 
You work in the IT department of a financial services company that s.docx
You work in the IT department of a financial services company that s.docxYou work in the IT department of a financial services company that s.docx
You work in the IT department of a financial services company that s.docx
rosemarybdodson23141
 
You work for OneEarth, an environmental consulting company that .docx
You work for OneEarth, an environmental consulting company that .docxYou work for OneEarth, an environmental consulting company that .docx
You work for OneEarth, an environmental consulting company that .docx
rosemarybdodson23141
 
You work for an international construction company that has been con.docx
You work for an international construction company that has been con.docxYou work for an international construction company that has been con.docx
You work for an international construction company that has been con.docx
rosemarybdodson23141
 
You will write your Literature Review Section of your EBP Projec.docx
You will write your Literature Review Section of your EBP Projec.docxYou will write your Literature Review Section of your EBP Projec.docx
You will write your Literature Review Section of your EBP Projec.docx
rosemarybdodson23141
 
You work for an airline, a small airline, so small you have only one.docx
You work for an airline, a small airline, so small you have only one.docxYou work for an airline, a small airline, so small you have only one.docx
You work for an airline, a small airline, so small you have only one.docx
rosemarybdodson23141
 

More from rosemarybdodson23141 (20)

Young Adulthood begins with the individual being on the verge of att.docx
Young Adulthood begins with the individual being on the verge of att.docxYoung Adulthood begins with the individual being on the verge of att.docx
Young Adulthood begins with the individual being on the verge of att.docx
 
Your abilities in international management have been recognize.docx
Your abilities in international management have been recognize.docxYour abilities in international management have been recognize.docx
Your abilities in international management have been recognize.docx
 
your 14 years daughter accidently leaves her purse open in the fam.docx
your 14 years daughter accidently leaves her purse open in the fam.docxyour 14 years daughter accidently leaves her purse open in the fam.docx
your 14 years daughter accidently leaves her purse open in the fam.docx
 
Young people are ruining the English languageIn your reflectio.docx
Young people are ruining the English languageIn your reflectio.docxYoung people are ruining the English languageIn your reflectio.docx
Young people are ruining the English languageIn your reflectio.docx
 
Young man drops out of school in seventh grade and becomes his mothe.docx
Young man drops out of school in seventh grade and becomes his mothe.docxYoung man drops out of school in seventh grade and becomes his mothe.docx
Young man drops out of school in seventh grade and becomes his mothe.docx
 
Young and the RestlessWeek 11 Couples Therapy Movie Experience .docx
Young and the RestlessWeek 11 Couples Therapy Movie Experience .docxYoung and the RestlessWeek 11 Couples Therapy Movie Experience .docx
Young and the RestlessWeek 11 Couples Therapy Movie Experience .docx
 
You-Attitude A Linguistic PerspectiveLllita RodmanThe Uni.docx
You-Attitude A Linguistic PerspectiveLllita RodmanThe Uni.docxYou-Attitude A Linguistic PerspectiveLllita RodmanThe Uni.docx
You-Attitude A Linguistic PerspectiveLllita RodmanThe Uni.docx
 
You  may have seen how financial news outlets provide real-time .docx
You  may have seen how financial news outlets provide real-time .docxYou  may have seen how financial news outlets provide real-time .docx
You  may have seen how financial news outlets provide real-time .docx
 
You  are responsible for putting together the Harmony Day celebr.docx
You  are responsible for putting together the Harmony Day celebr.docxYou  are responsible for putting together the Harmony Day celebr.docx
You  are responsible for putting together the Harmony Day celebr.docx
 
You wrote this scenario from the perspective of Behaviorism learni.docx
You wrote this scenario from the perspective of Behaviorism learni.docxYou wrote this scenario from the perspective of Behaviorism learni.docx
You wrote this scenario from the perspective of Behaviorism learni.docx
 
You worked closely with your IT managers to develop a complementing .docx
You worked closely with your IT managers to develop a complementing .docxYou worked closely with your IT managers to develop a complementing .docx
You worked closely with your IT managers to develop a complementing .docx
 
You work in the office of a personal financial planner. He has asked.docx
You work in the office of a personal financial planner. He has asked.docxYou work in the office of a personal financial planner. He has asked.docx
You work in the office of a personal financial planner. He has asked.docx
 
You work in the IT department of a financial services company that s.docx
You work in the IT department of a financial services company that s.docxYou work in the IT department of a financial services company that s.docx
You work in the IT department of a financial services company that s.docx
 
You work for the Jaguars Bank as the Chief Information Officer.  It .docx
You work for the Jaguars Bank as the Chief Information Officer.  It .docxYou work for the Jaguars Bank as the Chief Information Officer.  It .docx
You work for the Jaguars Bank as the Chief Information Officer.  It .docx
 
You work for OneEarth, an environmental consulting company that .docx
You work for OneEarth, an environmental consulting company that .docxYou work for OneEarth, an environmental consulting company that .docx
You work for OneEarth, an environmental consulting company that .docx
 
You work for an international construction company that has been con.docx
You work for an international construction company that has been con.docxYou work for an international construction company that has been con.docx
You work for an international construction company that has been con.docx
 
You will write your Literature Review Section of your EBP Projec.docx
You will write your Literature Review Section of your EBP Projec.docxYou will write your Literature Review Section of your EBP Projec.docx
You will write your Literature Review Section of your EBP Projec.docx
 
You work for an airline, a small airline, so small you have only one.docx
You work for an airline, a small airline, so small you have only one.docxYou work for an airline, a small airline, so small you have only one.docx
You work for an airline, a small airline, so small you have only one.docx
 
You work for a small community hospital that has recently updated it.docx
You work for a small community hospital that has recently updated it.docxYou work for a small community hospital that has recently updated it.docx
You work for a small community hospital that has recently updated it.docx
 
You work for a regional forensic computer lab and have been tasked w.docx
You work for a regional forensic computer lab and have been tasked w.docxYou work for a regional forensic computer lab and have been tasked w.docx
You work for a regional forensic computer lab and have been tasked w.docx
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 

Recently uploaded (20)

PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 

My project working well, but there no relationship between the t.docx

  • 1. My project working well, but there no relationship between the tables of database because each table working alone I want make relationship between them even that order to change some names of the tables and I want this relationship to work in the project well For example: -From this table -To this Online Car Sales/EWAPP/AdminAddNewItem.aspx <%@ Page Language="C#" MasterPageFile="~/AdminMasterPage.master" MaintainScrollPositionOnPostback="true" AutoEventWireup="true" CodeFile="AdminAddNewItem.aspx.cs" Inherits="AdminPage" Title="OurShopping - Online Shopping Store" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <style type="text/css"> .style9
  • 2. { text-decoration: underline; } </style> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <hr> <p> <span __designer:mapid="16c" class="style9">Adding New Item:</span> <br __designer:mapid="d3" /> <br __designer:mapid="d4" /> <br __designer:mapid="d5" /> Product&#39;s Name: </p> <p> <asp:TextBox ID="txtProductName" runat="server"></asp:TextBox>
  • 3. <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtProductName" ErrorMessage="Product's Name is Requierd">*</asp:RequiredFieldValidator> <br __designer:mapid="169" /> <br __designer:mapid="16a" /> Product&#39;s Short Description:</p> <p> &nbsp;<asp:TextBox ID="txtShortDescription" runat="server" Height="62px" TextMode="MultiLine" Width="326px"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtShortDescription" ErrorMessage="Description is Reqiuerd">*</asp:RequiredFieldValidator> </p> <p> <br __designer:mapid="d7" /> <br __designer:mapid="d8" />
  • 4. Product&#39;s Description: </p> <p> <asp:TextBox ID="txtProductDescription" runat="server" Height="156px" TextMode="MultiLine" Width="375px"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtProductDescription" ErrorMessage="Description is Requierd">*</asp:RequiredFieldValidator> <br __designer:mapid="da" /> <br __designer:mapid="db" /> Make: <asp:DropDownList ID="dropCatInsert" runat="server" DataSourceID="SqlDataSource2" DataTextField="Category" DataValueField="Category">
  • 5. </asp:DropDownList> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [ProductCategory]"> <SelectParameters> <asp:Parameter DefaultValue="1" Name="CategoryID" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> </p> <table border="1" style="background-color: LightGray"> <tr><td colspan="2" align="center"><b>Specifications</b></td></tr> <tr>
  • 6. <td width="300">Price</td> <td><asp:TextBox ID="txtInitialPrice" runat="server"></asp:TextBox> <asp:CompareValidator ID="CompareValidator56" runat="server" ControlToValidate="txtInitialPrice" ErrorMessage="Only Numbers are Accepted" Operator="DataTypeCheck" Type="Integer">*</asp:CompareValidator> <asp:CompareValidator ID="CompareValidator57" runat="server" ControlToValidate="txtInitialPrice" ErrorMessage="Must be Positive Value" Operator="GreaterThanEqual" ValueToCompare="0" >*</asp:CompareValidator> </td> </tr> <tr> <td width="300">Average MPG</td> <td><asp:TextBox ID="txtAverageMPG"
  • 7. runat="server"></asp:TextBox> <asp:CompareValidator ID="CompareValidator23" runat="server" ControlToValidate="txtAverageMPG" ErrorMessage="Only Numbers are Accepted" Operator="DataTypeCheck" Type="Integer">*</asp:CompareValidator> <asp:CompareValidator ID="CompareValidator25" runat="server" ControlToValidate="txtAverageMPG" ErrorMessage="Rating Must be Positive Value" Operator="GreaterThanEqual" ValueToCompare="0" >*</asp:CompareValidator> </td> </tr> <tr> <td width="300">Body Type</td> <td> <asp:DropDownList ID="ddlBodyType" runat="server"> <asp:ListItem Value="Manual">Hatchback</asp:ListItem>
  • 8. <asp:ListItem Value="Mini MPV">Mini MPV</asp:ListItem> <asp:ListItem Value="Coupe">Coupe</asp:ListItem> <asp:ListItem Value="Convertible">Convertible</asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td width="300">Exterior Color</td> <td> <asp:DropDownList ID="ddlExteriorColor" runat="server"> <asp:ListItem Value="Red">Red</asp:ListItem> <asp:ListItem Value="Blue">Blue</asp:ListItem> <asp:ListItem Value="White">White</asp:ListItem> <asp:ListItem Value="Black">Black</asp:ListItem> </asp:DropDownList> </td> </tr>
  • 9. <tr> <td width="300">Interior Color</td> <td> <asp:DropDownList ID="ddlInteriorColor" runat="server"> <asp:ListItem Value="Red">Red</asp:ListItem> <asp:ListItem Value="Blue">Blue</asp:ListItem> <asp:ListItem Value="White">White</asp:ListItem> <asp:ListItem Value="Black">Black</asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td width="300">Engine</td> <td> <asp:DropDownList ID="ddlEngine" runat="server"> <asp:ListItem Value="6 Cylinder">6 Cylinder</asp:ListItem>
  • 10. <asp:ListItem Value="4 Cylinder">4 Cylinder</asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td width="300">Drive Type</td> <td> <asp:DropDownList ID="ddlDriveType" runat="server"> <asp:ListItem Value="All Wheel Drive">All Wheel Drive</asp:ListItem> <asp:ListItem Value="Two Drive">Two Drive</asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td width="300">Fuel</td>
  • 11. <td> <asp:DropDownList ID="ddlFuel" runat="server"> <asp:ListItem Value="Petrol">Petrol</asp:ListItem> <asp:ListItem Value="Diesel">Diesel</asp:ListItem> <asp:ListItem Value="Unleaded">Unleaded</asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td width="300">Doors</td> <td> <asp:DropDownList ID="ddlDoors" runat="server"> <asp:ListItem Value="2">2</asp:ListItem> <asp:ListItem Value="3">3</asp:ListItem> <asp:ListItem Value="4">4</asp:ListItem> </asp:DropDownList> </td>
  • 12. </tr> </table> <p> Price: <asp:TextBox ID="txtPrice" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtPrice" ErrorMessage="Price is reqiuerd">*</asp:RequiredFieldValidator> <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtPrice" ErrorMessage="Onlt numbers are accepted" Operator="DataTypeCheck" Type="Integer">*</asp:CompareValidator>
  • 13. </p> <p> &nbsp;</p> <hr /> <p> <br __designer:mapid="167" /> Upload Product Full Size Image: </p> <p> <asp:FileUpload ID="FileUpload1" runat="server" ondatabinding="btnsaveProduct_Click" /> &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="FileUpload1" ErrorMessage="you must enter product full size image">*</asp:RequiredFieldValidator> &nbsp;<asp:Label ID="lblFullSizeImage" runat="server" style="color: #FFFFFF"></asp:Label> </p> <p>
  • 14. Upload Product Thumbnail Size Image:</p> <p> <asp:FileUpload ID="FileUpload2" runat="server" ondatabinding="btnsaveProduct_Click" /> &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="FileUpload2" ErrorMessage="you must enter product thubnail size image">*</asp:RequiredFieldValidator> &nbsp;<asp:Label ID="lblThumbSizeImage" runat="server" style="font-weight: 700; color: #FFFFFF"></asp:Label> </p> <p> &nbsp;</p> <hr /> <p> <br __designer:mapid="de" /> </p>
  • 15. <asp:ValidationSummary ID="ValidationSummary1" runat="server" /> <p> <br __designer:mapid="df" /> <br __designer:mapid="e1" /> <br __designer:mapid="e2" /> <asp:Label ID="lblAddingNewItem" runat="server" ForeColor="#FF3300"></asp:Label> <br __designer:mapid="e4" /> <br __designer:mapid="e5" /> <asp:Button ID="btnsaveProduct" runat="server" Text="Add The Item" onclick="btnsaveProduct_Click" /> <asp:Button ID="btnInsert" runat="server" Text="insert another Item" onclick="btnInsert_Click" /> <br __designer:mapid="e8" /> <br __designer:mapid="e9" /> <br __designer:mapid="ea" /> <br __designer:mapid="eb" />
  • 16. <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [ProductTable] WHERE [ProductID] = @ProductID" InsertCommand="INSERT INTO [ProductTable] ([ProductName], [ProductDescription], [ProductShortDescription], [Price], [Category], [ProductImage], [ProductImageThumb]) VALUES (@ProductName, @ProductDescription, @ProductShortDescription, @Price, @Category, @ProductImage, @ProductImageThumb)" SelectCommand="SELECT * FROM [ProductTable]" UpdateCommand="UPDATE [ProductTable] SET [ProductName] = @ProductName, [ProductDescription] = @ProductDescription, [ProductShortDescription] = @ProductShortDescription, [Price] = @Price, [Category] = @Category, [ProductImage] = @ProductImage, [ProductImageThumb] = @ProductImageThumb WHERE [ProductID] = @ProductID">
  • 17. <DeleteParameters> <asp:Parameter Name="ProductID" Type="Int32" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="ProductName" Type="String" /> <asp:Parameter Name="ProductDescription" Type="String" /> <asp:Parameter Name="ProductShortDescription" Type="String" /> <asp:Parameter Name="Price" Type="Double" /> <asp:Parameter Name="Category" Type="String" /> <asp:Parameter Name="ProductImage" Type="String" /> <asp:Parameter Name="ProductImageThumb" Type="String" /> <asp:Parameter Name="ProductID" Type="Int32" /> </UpdateParameters> <InsertParameters>
  • 18. <asp:ControlParameter ControlID="txtProductName" Name="ProductName" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="txtProductDescription" Name="ProductDescription" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="txtProductDescription" Name="ProductShortDescription" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="txtPrice" Name="Price" PropertyName="Text" Type="Double" /> <asp:ControlParameter ControlID="dropCatInsert" Name="Category" PropertyName="SelectedValue" Type="String" /> <asp:ControlParameter ControlID="lblFullSizeImage" Name="ProductImage" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="lblThumbSizeImage" Name="ProductImageThumb"
  • 19. PropertyName="Text" Type="String" /> </InsertParameters> </asp:SqlDataSource> </p> <p> &nbsp;</p> <p> </p> <p> <br /> </p> <p> </p> </asp:Content> Online Car Sales/EWAPP/AdminAddNewItem.aspx.cs
  • 20. using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data; using System.Data.Sql; using System.Data.SqlClient; public partial class AdminPage : System.Web.UI.Page {
  • 21. SqlConnection con; SqlCommand cmd; protected void Page_Load(object sender, EventArgs e) { string strcon = System.Configuration.ConfigurationManager.ConnectionStrings ["ConnectionString"].ConnectionString; con = new SqlConnection(strcon); btnInsert.Visible = false; // btnsaveProduct.Visible = false; } protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) {
  • 22. // MultiView1.ActiveViewIndex = RadioButtonList1.SelectedIndex; } protected void btnsaveProduct_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { FileUpload1.SaveAs(HttpContext.Current.Request.PhysicalAppl icationPath + "//Uploadedpix//" + FileUpload1.FileName); lblFullSizeImage.Text = FileUpload1.FileName; } if (FileUpload2.HasFile) { FileUpload2.SaveAs(HttpContext.Current.Request.PhysicalAppl icationPath + "//Thumbnails//" + FileUpload2.FileName); }
  • 23. lblThumbSizeImage.Text = FileUpload2.FileName; btnsaveProduct.Visible = true; SqlDataSource1.Insert(); con.Open(); cmd = new SqlCommand("Select Max(ProductID) from ProductTable", con); int MaxProductId = Convert.ToInt32(cmd.ExecuteScalar()); con.Close();
  • 24. con.Open(); cmd = new SqlCommand("Insert into CarSpecs(CarId,Price,Mileage,BodyStyle,ExteriorColor,Interior Color,Engine,DriveType,FuelType,Doors) Values (" + MaxProductId + "," + Convert.ToDouble(txtInitialPrice.Text) + "," + Convert.ToInt32(txtAverageMPG.Text) + ",'" + ddlBodyType.Text + "','" + ddlExteriorColor.Text + "','" + ddlInteriorColor.Text + "','" + ddlEngine.Text + "','" + ddlDriveType.Text + "','" + ddlFuel.Text + "'," + Convert.ToInt32(ddlDoors.Text) + ")", con); cmd.ExecuteNonQuery(); con.Close();
  • 25. this.lblAddingNewItem.Text = "Item Has Been Added into the Database"; btnsaveProduct.Visible = false; btnInsert.Visible = true; txtPrice.Enabled = false; txtShortDescription.Enabled = false; txtProductDescription.Enabled = false; txtProductName.Enabled = false; dropCatInsert.Enabled = false; } protected void btnInsert_Click(object sender, EventArgs e) { txtPrice.Text = ""; txtProductDescription.Text = ""; txtProductName.Text = ""; txtPrice.Enabled = true; txtProductDescription.Enabled = true; txtProductName.Enabled = true;
  • 26. btnsaveProduct.Visible = true; dropCatInsert.Enabled = true; } protected void LinkButton1_Click(object sender, EventArgs e) { // txtsearchUser.Visible = true; //btn1.Visible = true; //txtUserIDSearch.Visible = false; // btn2.Visible = false; // LinkButton1.Visible = false; } protected void LinkButton2_Click(object sender, EventArgs e) { //txtUserIDSearch.Visible = true; // btn2.Visible = true;
  • 27. // txtsearchUser.Visible = false; //btn1.Visible = false; // LinkButton2.Visible = false; } protected void DropSearchItems_SelectedIndexChanged(object sender, EventArgs e) { } //protected void btnuploadImages_Click(object sender, EventArgs e) //{ // if (FileUpload1.HasFile) // { // FileUpload1.SaveAs("F:/Documents and Settings/shift/Desktop/EWAPP/Uploadedpix/" + FileUpload1.FileName);
  • 28. // } // if (FileUpload2.HasFile) // { // FileUpload2.SaveAs("F:/Documents and Settings/shift/Desktop/EWAPP/Thumbnails/" + FileUpload2.FileName); // } // txtFimage.Text = FileUpload1.FileName; // txtTimage.Text = FileUpload2.FileName; // Label1.Visible = false; // // btnsaveProduct.Visible = true; //} } Online Car Sales/EWAPP/AdminCategoryMaintenance.aspx <%@ Page Title="" Language="C#" MasterPageFile="~/AdminMasterPage.master" AutoEventWireup="true" CodeFile="AdminCategoryMaintenance.aspx.cs" Inherits="AdminCategoryMaintenance" %>
  • 29. <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" onselectedindexchanged="RadioButtonList1_SelectedIndexChan ged"> <asp:ListItem Value="0">Add New Category</asp:ListItem> <asp:ListItem Value="1">View / modify Categories</asp:ListItem> </asp:RadioButtonList> <asp:MultiView ID="MultiView1" runat="server"> <asp:View ID="View1" runat="server">
  • 30. <table class="style17"> <tr> <td colspan="2" style="border-color: #000080; background- color: #AABFEA; border-bottom-style: solid;"> Add New Category</td> </tr> <tr> <td> Category Name: </td> <td> <asp:TextBox ID="txtCategoryName" runat="server"></asp:TextBox> </td> </tr> <tr>
  • 31. <td> Category Description: </td> <td> <asp:TextBox ID="txtCategoryDesc" TextMode=MultiLine runat="server"></asp:TextBox> </td> </tr> <tr> <td colspan="2"> <td class="style18"> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [ProductCategory] WHERE [CategoryID] = @CategoryID" InsertCommand="INSERT INTO [ProductCategory] ([Category]) VALUES (@NewCategory)" SelectCommand="SELECT * FROM [ProductCategory] WHERE [CategoryID] = @CategoryID"
  • 32. UpdateCommand="UPDATE [ProductCategory] SET [Category] = @NewCategory WHERE [CategoryID] = @CategoryID"> <DeleteParameters> <asp:Parameter Name="CategoryID" Type="Int32" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="Category" Type="String" /> </UpdateParameters> <InsertParameters> <asp:ControlParameter ControlID="txtCategoryName" Name="NewCategory" PropertyName="Text" Type="String" /> </InsertParameters> </asp:SqlDataSource> </td> </td> </tr>
  • 33. <tr> <td colspan="2" align="center"> <asp:Button ID="btnInsert" runat="server" Text="Insert" onclick="btnInsert_Click" /> </td> </tr> </table> </asp:View> <asp:View ID="View2" runat="server"> <br /><br /> <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="CategoryID" DataSourceID="SqlDataSource10"
  • 34. GridLines="Vertical"> <FooterStyle BackColor="#CCCCCC" ForeColor="Black" /> <RowStyle BackColor="#EEEEEE" ForeColor="Black" /> <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField DataField="CategoryID" HeaderText="Category ID" InsertVisible="False" ReadOnly="True" SortExpression="CategoryID" /> <asp:BoundField DataField="Category" HeaderText="Category" SortExpression="Category" /> </Columns> <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#008A8C" Font- Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#000084" Font- Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="#DCDCDC" />
  • 35. </asp:GridView> <asp:SqlDataSource ID="SqlDataSource10" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [ProductCategory] WHERE [CategoryID] = @CategoryID" InsertCommand="INSERT INTO [ProductCategory] ([Category]) VALUES (@Category)" SelectCommand="SELECT * FROM [ProductCategory]" UpdateCommand="UPDATE [ProductCategory] SET [Category] = @Category WHERE [CategoryID] = @CategoryID"> <SelectParameters> <asp:Parameter DefaultValue="1" Name="CategoryID" Type="Int32" /> </SelectParameters> <DeleteParameters> <asp:Parameter Name="CategoryID" Type="Int32" /> </DeleteParameters> <UpdateParameters>
  • 36. <asp:Parameter Name="Category" Type="String" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="Category" Type="String" /> </InsertParameters> </asp:SqlDataSource> <br /> <asp:FormView ID="FormView2" runat="server" DataKeyNames="CategoryID" DataSourceID="SqlDataSource11" OnItemUpdated="FormView2_ItemUpdated" OnItemDeleted="FormView2_ItemDeleted" > <EditItemTemplate> <table class="style17"> <tr> <td class="style20"> Category ID:</td> <td>
  • 37. <asp:Label ID="IDLabel0" runat="server" Text='<%# Eval("CategoryID") %>' /> </td> </tr> <tr> <td class="style20"> Category:</td> <td> <asp:TextBox ID="CategoryLabel0" runat="server" Text='<%# Bind("Category") %>' /> </td> </tr> </table> <asp:LinkButton ID="UpdateButton0" runat="server" CausesValidation="True" CommandName="Update" Text="Update" /> &nbsp;<asp:LinkButton ID="UpdateCancelButton0" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> <br />
  • 38. <asp:ValidationSummary ID="ValidationSummary3" runat="server" /> </EditItemTemplate> <InsertItemTemplate> Category: <asp:TextBox ID="CategoryTextBox0" runat="server" Text='<%# Bind("Category") %>' /> <asp:LinkButton ID="InsertButton0" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" /> &nbsp;<asp:LinkButton ID="InsertCancelButton0" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> </InsertItemTemplate> <ItemTemplate> <table class="style17"> <tr>
  • 39. <td class="style20"> Category ID:</td> <td> <asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("CategoryID") %>' /> </td> </tr> <tr> <td class="style20"> Category:</td> <td> <asp:Label ID="CategoryLabel1" runat="server" Text='<%# Bind("Category") %>' /> </td> </tr> </table> <asp:LinkButton ID="EditButton0" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" />
  • 40. &nbsp;<asp:LinkButton ID="DeleteButton0" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" /> &nbsp; </ItemTemplate> </asp:FormView> <br /> <asp:SqlDataSource ID="SqlDataSource11" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [ProductCategory] WHERE [CategoryID] = @CategoryID" InsertCommand="INSERT INTO [ProductCategory] ([Category]) VALUES (@Category)" SelectCommand="SELECT * FROM [ProductCategory] WHERE [CategoryID] = @CategoryID" UpdateCommand="UPDATE [ProductCategory] SET [Category] = @Category WHERE [CategoryID] = @CategoryID"> <SelectParameters> <asp:ControlParameter ControlID="GridView2"
  • 41. Name="CategoryID" PropertyName="SelectedValue" /> </SelectParameters> <DeleteParameters> <asp:Parameter Name="CategoryID" Type="Int32" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="Category" Type="String" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="Category" Type="String" /> </InsertParameters> </asp:SqlDataSource> </asp:View> </asp:MultiView>
  • 42. </asp:Content> Online Car Sales/EWAPP/AdminCategoryMaintenance.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.Configuration; using System.Data; public partial class AdminCategoryMaintenance : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) {
  • 43. } protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) { MultiView1.ActiveViewIndex = RadioButtonList1.SelectedIndex; } protected void btnInsert_Click(object sender, EventArgs e) { SqlDataSource sds = new SqlDataSource(); sds.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"]. ToString(); sds.SelectParameters.Add("NewCategory", TypeCode.String, this.txtCategoryName.Text); sds.SelectCommand = "SELECT * FROM [ProductCategory] WHERE [Category] = @NewCategory";
  • 44. DataView dv = (DataView)sds.Select(DataSourceSelectArguments.Empty); if (dv.Count != 0) { return; } else { this.SqlDataSource2.Insert(); //this.Label1.Text = "New User Profile has been created you can login now"; btnInsert.Enabled = false; }
  • 45. } protected void FormView2_ItemUpdated(object sender, FormViewUpdatedEventArgs e) { this.GridView2.DataBind(); } protected void FormView2_ItemDeleted(object sender, FormViewDeletedEventArgs e) { this.GridView2.DataBind(); } } Online Car Sales/EWAPP/AdminMaintainItems.aspx <%@ Page Language="C#" MasterPageFile="~/AdminMasterPage.master" MaintainScrollPositionOnPostback="true" AutoEventWireup="true" CodeFile="AdminMaintainItems.aspx.cs" Inherits="AdminMaintainItems" Title="OurShopping - Online Shopping Store" %> <asp:Content ID="Content1" ContentPlaceHolderID="head"
  • 46. Runat="Server"> <style type="text/css"> .style9 { width: 100%; } </style> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <hr /> <p> Maintain Items:</p> <p> Select Category: <asp:DropDownList ID="DropSearchCat" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1" DataTextField="Category"
  • 47. DataValueField="Category" onselectedindexchanged="DropSearchCat_SelectedIndexChange d"> </asp:DropDownList> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [Category] FROM [ProductCategory]"> </asp:SqlDataSource> </p> <p> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="ProductID" DataSourceID="SqlDataSource2" ForeColor="#333333" GridLines="None"> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <RowStyle BackColor="#EFF3FB" /> <Columns>
  • 48. <asp:CommandField ButtonType="Button" ShowSelectButton="True" /> <asp:BoundField DataField="ProductID" HeaderText="ProductID" InsertVisible="False" ReadOnly="True" SortExpression="ProductID" /> <asp:BoundField DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" /> <asp:BoundField DataField="ProductShortDescription" HeaderText="ProductShortDescription" SortExpression="ProductShortDescription" /> <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" /> <asp:BoundField DataField="Category" HeaderText="Category" SortExpression="Category" /> <asp:BoundField DataField="ProductImage" HeaderText="ProductImage" SortExpression="ProductImage" /> </Columns>
  • 49. <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#D1DDF1" Font- Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#2461BF" /> <AlternatingRowStyle BackColor="White" /> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [ProductTable] WHERE [ProductID] = @ProductID" InsertCommand="INSERT INTO [ProductTable] ([ProductName], [ProductDescription], [ProductShortDescription], [Price], [Category], [ProductImage]) VALUES (@ProductName, @ProductDescription, @ProductShortDescription, @Price, @Category, @ProductImage)" SelectCommand="SELECT * FROM [ProductTable] WHERE ([Category] = @Category)" UpdateCommand="UPDATE [ProductTable] SET [ProductName] = @ProductName, [ProductDescription] = @ProductDescription, [ProductShortDescription] =
  • 50. @ProductShortDescription, [Price] = @Price, [Category] = @Category, [ProductImage] = @ProductImage WHERE [ProductID] = @ProductID"> <SelectParameters> <asp:ControlParameter ControlID="DropSearchCat" Name="Category" PropertyName="SelectedValue" Type="String" /> </SelectParameters> <DeleteParameters> <asp:Parameter Name="ProductID" Type="Int32" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="ProductName" Type="String" /> <asp:Parameter Name="ProductDescription" Type="String" /> <asp:Parameter Name="ProductShortDescription" Type="String" /> <asp:Parameter Name="Price" Type="Double" /> <asp:Parameter Name="Category" Type="String" /> <asp:Parameter Name="ProductImage" Type="String" />
  • 51. <asp:Parameter Name="ProductID" Type="Int32" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="ProductName" Type="String" /> <asp:Parameter Name="ProductDescription" Type="String" /> <asp:Parameter Name="ProductShortDescription" Type="String" /> <asp:Parameter Name="Price" Type="Double" /> <asp:Parameter Name="Category" Type="String" /> <asp:Parameter Name="ProductImage" Type="String" /> </InsertParameters> </asp:SqlDataSource> </p> <p> <asp:FormView ID="FormView2" runat="server" DataKeyNames="ProductID" DataSourceID="SqlDataSource3"
  • 52. onitemupdated="FormView2_ItemUpdated" Width="532px"> <EditItemTemplate> <table class="style9"> <tr> <td> ProductID:</td> <td> <asp:Label ID="ProductIDLabel" runat="server" Text='<%# Eval("ProductID") %>' /> </td> </tr> <tr> <td> Product Name:</td> <td> <asp:TextBox ID="ProductNameTextBox" runat="server" Text='<%# Bind("ProductName") %>' /> <asp:RequiredFieldValidator
  • 53. ID="RequiredFieldValidator1" runat="server" ControlToValidate="ProductNameTextBox" ErrorMessage="Product's Name is requierd">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td> Description:</td> <td> <asp:TextBox ID="ProductDescriptionTextBox" runat="server" Height="62px" Text='<%# Bind("ProductDescription") %>' TextMode="MultiLine" Width="190px" /> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ProductDescriptionTextBox" ErrorMessage="Description is requierd">*</asp:RequiredFieldValidator>
  • 54. </td> </tr> <tr> <td> Short Description:</td> <td> <asp:TextBox ID="ProductShortDescriptionTextBox" runat="server" Text='<%# Bind("ProductShortDescription") %>' TextMode="MultiLine" Width="188px" /> <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ProductShortDescriptionTextBox" ErrorMessage="Description is requierd">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td>
  • 55. Price:</td> <td> <asp:TextBox ID="PriceTextBox" runat="server" Text='<%# Bind("Price") %>' /> <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="PriceTextBox" ErrorMessage="image is requierd">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td> Category:</td> <td> <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1" DataTextField="Category" DataValueField="Category" SelectedValue='<%# Bind("Category") %>'>
  • 56. </asp:DropDownList> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [ProductCategory]"></asp:SqlDataSource> </td> </tr> <tr> <td> Image:</td> <td> <asp:TextBox ID="ProductImageTextBox" runat="server" Text='<%# Bind("ProductImage") %>' /> <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="ProductImageTextBox" ErrorMessage="Product's Name is requierd">*</asp:RequiredFieldValidator>
  • 57. </td> </tr> <tr> <td> &nbsp;ImageThumb:</td> <td> <asp:TextBox ID="ProductImageThumbTextBox" runat="server" Text='<%# Bind("ProductImageThumb") %>' /> <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="ProductImageThumbTextBox" ErrorMessage="image is requierd">*</asp:RequiredFieldValidator> </td> </tr> </table> <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
  • 58. CommandName="Update" Text="Update" /> &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> <br /> <asp:ValidationSummary ID="ValidationSummary1" runat="server" /> </EditItemTemplate> <InsertItemTemplate> ProductName: <asp:TextBox ID="ProductNameTextBox" runat="server" Text='<%# Bind("ProductName") %>' /> <br /> ProductDescription: <asp:TextBox ID="ProductDescriptionTextBox" runat="server" Text='<%# Bind("ProductDescription") %>' /> <br /> ProductShortDescription:
  • 59. <asp:TextBox ID="ProductShortDescriptionTextBox" runat="server" Text='<%# Bind("ProductShortDescription") %>' /> <br /> Price: <asp:TextBox ID="PriceTextBox" runat="server" Text='<%# Bind("Price") %>' /> <br /> Category: <asp:TextBox ID="CategoryTextBox" runat="server" Text='<%# Bind("Category") %>' /> <br /> ProductImage: <asp:TextBox ID="ProductImageTextBox" runat="server" Text='<%# Bind("ProductImage") %>' /> <br /> ProductImageThumb: <asp:TextBox ID="ProductImageThumbTextBox"
  • 60. runat="server" Text='<%# Bind("ProductImageThumb") %>' /> <br /> <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" /> &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> </InsertItemTemplate> <ItemTemplate> <table class="style9"> <tr> <td> ProductID:</td> <td> <asp:Label ID="ProductIDLabel" runat="server" Text='<%# Eval("ProductID") %>' /> </td>
  • 61. </tr> <tr> <td> Product Name:</td> <td> <asp:Label ID="ProductNameLabel" runat="server" Text='<%# Bind("ProductName") %>' /> </td> </tr> <tr> <td> Description:</td> <td> <asp:Label ID="ProductDescriptionLabel" runat="server" Text='<%# Bind("ProductDescription") %>' /> </td> </tr>
  • 62. <tr> <td> Short Description:</td> <td> <asp:Label ID="ProductShortDescriptionLabel" runat="server" Text='<%# Bind("ProductShortDescription") %>' /> </td> </tr> <tr> <td> Price:</td> <td> <asp:Label ID="PriceLabel" runat="server" Text='<%# Bind("Price") %>' /> </td> </tr> <tr>
  • 63. <td> Category:</td> <td> <asp:Label ID="CategoryLabel" runat="server" Text='<%# Bind("Category") %>' /> </td> </tr> <tr> <td> Image:</td> <td> <asp:Label ID="ProductImageLabel" runat="server" Text='<%# Bind("ProductImage") %>' /> </td> </tr> <tr> <td> &nbsp;ImageThumb:</td>
  • 64. <td> <asp:Label ID="ProductImageThumbLabel" runat="server" Text='<%# Bind("ProductImageThumb") %>' /> </td> </tr> </table> <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" /> &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" /> &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New" Text="New" /> </ItemTemplate> </asp:FormView> </p> <p>
  • 65. <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [ProductTable] WHERE [ProductID] = @ProductID" InsertCommand="INSERT INTO [ProductTable] ([ProductName], [ProductDescription], [ProductShortDescription], [Price], [Category], [ProductImage], [ProductImageThumb]) VALUES (@ProductName, @ProductDescription, @ProductShortDescription, @Price, @Category, @ProductImage, @ProductImageThumb)" SelectCommand="SELECT * FROM [ProductTable] Where ProductID = @ProductID" UpdateCommand="UPDATE [ProductTable] SET [ProductName] = @ProductName, [ProductDescription] = @ProductDescription, [ProductShortDescription] = @ProductShortDescription, [Price] = @Price, [Category] = @Category, [ProductImage] = @ProductImage, [ProductImageThumb] = @ProductImageThumb WHERE [ProductID] = @ProductID"> <SelectParameters> <asp:ControlParameter ControlID="GridView1" Name="ProductID" PropertyName="SelectedValue" /> </SelectParameters>
  • 66. <DeleteParameters> <asp:Parameter Name="ProductID" Type="Int32" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="ProductName" Type="String" /> <asp:Parameter Name="ProductDescription" Type="String" /> <asp:Parameter Name="ProductShortDescription" Type="String" /> <asp:Parameter Name="Price" Type="Double" /> <asp:Parameter Name="Category" Type="String" /> <asp:Parameter Name="ProductImage" Type="String" /> <asp:Parameter Name="ProductImageThumb" Type="String" /> <asp:Parameter Name="ProductID" Type="Int32" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="ProductName" Type="String" />
  • 67. <asp:Parameter Name="ProductDescription" Type="String" /> <asp:Parameter Name="ProductShortDescription" Type="String" /> <asp:Parameter Name="Price" Type="Double" /> <asp:Parameter Name="Category" Type="String" /> <asp:Parameter Name="ProductImage" Type="String" /> <asp:Parameter Name="ProductImageThumb" Type="String" /> </InsertParameters> </asp:SqlDataSource> <br /> </p> </asp:Content> Online Car Sales/EWAPP/AdminMaintainItems.aspx.cs using System; using System.Collections; using System.Configuration;
  • 68. using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; public partial class AdminMaintainItems : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void DropSearchCat_SelectedIndexChanged(object sender, EventArgs e)
  • 69. { } protected void FormView2_ItemUpdated(object sender, FormViewUpdatedEventArgs e) { this.GridView1.DataBind(); } } Online Car Sales/EWAPP/AdminMasterPage.masterHomeCategoriesUsersS alesAdd Car(s)Manage Car(s)User Reviews Name: Name:
  • 70. Welcome: Logout Welcome: Guest Login © OurShopping.Com 2013 Online Car Sales/EWAPP/AdminMasterPage.master.cs using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq;
  • 71. using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Xml.Linq; public partial class MasterPage : System.Web.UI.MasterPage { protected void Page_Load(object sender, EventArgs e) { if (Session["UserType"] == null || !Session["UserType"].Equals("admin")) Response.Redirect("Default.aspx"); }
  • 72. protected void LinkButton1_Click(object sender, EventArgs e) { Session.Abandon(); Response.Redirect("MainPage.aspx"); } protected void LinkButton2_Click(object sender, EventArgs e) { Response.Redirect("login.aspx"); } } Online Car Sales/EWAPP/AdminSalesMaintenance.aspx <%@ Page EnableEventValidation="false" Language="C#" MasterPageFile="~/AdminMasterPage.master" MaintainScrollPositionOnPostback="true" AutoEventWireup="true" CodeFile="AdminSalesMaintenance.aspx.cs" Inherits="AdminSalesMaintenance" Title="OurShopping -
  • 73. Online Shopping Store"%> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <style type="text/css"> .style9 { width: 100%; } </style> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <p> &nbsp;<asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" onselectedindexchanged="RadioButtonList1_SelectedIndexChan ged"> <asp:ListItem Value="0">Show All Open Orders</asp:ListItem>
  • 74. <asp:ListItem Value="1">Show All Closed Orders</asp:ListItem> <asp:ListItem Value="2">Search For Order</asp:ListItem> </asp:RadioButtonList> </p> <p> <asp:MultiView ID="MultiView1" runat="server"> <asp:View ID="View1" runat="server"> <hr /> <br /> All open Orders:<br /> <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="ShoppingID" DataSourceID="SqlDataSource1" GridLines="Vertical" onrowupdated="GridView3_RowUpdated"> <FooterStyle BackColor="#CCCCCC"
  • 75. ForeColor="Black" /> <RowStyle BackColor="#EEEEEE" ForeColor="Black" /> <Columns> <asp:CommandField ButtonType="Button" ShowSelectButton="True" /> <asp:BoundField DataField="ShoppingID" HeaderText="ShoppingID" InsertVisible="False" ReadOnly="True" SortExpression="ShoppingID" /> <asp:BoundField DataField="ProductIDNo" HeaderText="ProductIDNo" SortExpression="ProductIDNo" /> <asp:BoundField DataField="UserID" HeaderText="UserID" SortExpression="UserID" /> <asp:BoundField DataField="SalesStatus" HeaderText="SalesStatus" SortExpression="SalesStatus" /> <asp:BoundField DataField="qty" HeaderText="qty" SortExpression="qty" /> </Columns>
  • 76. <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#008A8C" Font- Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#000084" Font- Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="#DCDCDC" /> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [ShoppingCart] WHERE (([SalesStatus] = @SalesStatus) OR ([SalesStatus] = @SalesStatus2)) AND ShoppingCart.ShoppingID in (Select ShoppingID from FinalizedOrders)"> <SelectParameters> <asp:Parameter DefaultValue="Open" Name="SalesStatus" Type="String" /> <asp:Parameter DefaultValue="Pending" Name="SalesStatus2" Type="String" /> </SelectParameters> </asp:SqlDataSource>
  • 77. <br /> <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [ShoppingCart] WHERE [ShoppingID] = @ShoppingID" InsertCommand="INSERT INTO [ShoppingCart] ([ProductIDNo], [UserID], [SalesStatus], [qty]) VALUES (@ProductIDNo, @UserID, @SalesStatus, @qty)" SelectCommand="SELECT ShoppingCart.ShoppingID, ShoppingCart.ProductIDNo, ShoppingCart.UserID, ShoppingCart.SalesStatus, ShoppingCart.qty, ProductTable.Price, ProductTable.ProductName, UserTable.Email, UserTable.Address, UserTable.Name FROM ShoppingCart INNER JOIN UserTable ON ShoppingCart.UserID = UserTable.Username INNER JOIN ProductTable ON ShoppingCart.ProductIDNo = ProductTable.ProductID WHERE (ShoppingCart.ShoppingID = @ShoppingID)" UpdateCommand="UPDATE [ShoppingCart] SET [ProductIDNo] = @ProductIDNo, [UserID] = @UserID, [SalesStatus] = @SalesStatus, [qty] = @qty WHERE [ShoppingID] = @ShoppingID"> <SelectParameters> <asp:ControlParameter ControlID="GridView3" Name="ShoppingID"
  • 78. PropertyName="SelectedValue" /> </SelectParameters> <DeleteParameters> <asp:Parameter Name="ShoppingID" Type="Int32" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="ProductIDNo" Type="String" /> <asp:Parameter Name="UserID" Type="String" /> <asp:Parameter Name="SalesStatus" Type="String" /> <asp:Parameter Name="qty" Type="Int32" /> <asp:Parameter Name="ShoppingID" Type="Int32" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="ProductIDNo" Type="String" /> <asp:Parameter Name="UserID" Type="String"
  • 79. /> <asp:Parameter Name="SalesStatus" Type="String" /> <asp:Parameter Name="qty" Type="Int32" /> </InsertParameters> </asp:SqlDataSource> <br /> <asp:FormView ID="FormView2" runat="server" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="ShoppingID" DataSourceID="SqlDataSource4" GridLines="Both" onitemupdated="FormView2_ItemUpdated" Width="205px"> <FooterStyle BackColor="White" ForeColor="#000066" /> <RowStyle ForeColor="#000066" /> <EditItemTemplate> <table class="style9" style="border-bottom-style: solid; border- bottom-color: #000080;">
  • 80. <tr> <td> ShoppingID:</td> <td> <asp:Label ID="ShoppingIDLabel" runat="server" Text='<%# Eval("ShoppingID") %>' /> </td> </tr> <tr> <td> ProductIDNo:</td> <td> <asp:Label ID="ProductIDNoLabel0" runat="server" Text='<%# Bind("ProductIDNo") %>' /> </td> </tr>
  • 81. <tr> <td> UserID:</td> <td> <asp:Label ID="UserIDLabel0" runat="server" Text='<%# Bind("UserID") %>' /> </td> </tr> <tr> <td> SalesStatus:</td> <td> <asp:DropDownList ID="DropDownList1" runat="server" SelectedValue='<%# Bind("SalesStatus") %>'> <asp:ListItem>Open</asp:ListItem> <asp:ListItem>Pending</asp:ListItem>
  • 82. <asp:ListItem>Completed</asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td> qty:</td> <td> <asp:Label ID="qtyLabel0" runat="server" Text='<%# Bind("qty") %>' /> </td> </tr> <tr> <td> Price:</td> <td> <asp:Label ID="PriceLabel0" runat="server" Text='<%# Bind("Price") %>' /> </td>
  • 83. </tr> <tr> <td> ProductName:</td> <td> <asp:Label ID="ProductNameLabel0" runat="server" Text='<%# Bind("ProductName") %>' /> </td> </tr> <tr> <td> Email:</td> <td> <asp:Label ID="EmailLabel0" runat="server" Text='<%# Bind("Email") %>' /> </td> </tr> <tr>
  • 84. <td> Address:</td> <td> <asp:Label ID="AddressLabel0" runat="server" Text='<%# Bind("Address") %>' /> </td> </tr> <tr> <td> Name:</td> <td> <asp:Label ID="NameLabel0" runat="server" Text='<%# Bind("Name") %>' /> </td> </tr> </table> <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" />
  • 85. &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" /> &nbsp;<br /> <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" /> &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> </EditItemTemplate> <InsertItemTemplate> ProductIDNo: <asp:TextBox ID="ProductIDNoTextBox" runat="server" Text='<%# Bind("ProductIDNo") %>' /> <br /> UserID: <asp:TextBox ID="UserIDTextBox" runat="server" Text='<%# Bind("UserID") %>' />
  • 86. <br /> SalesStatus: <asp:TextBox ID="SalesStatusTextBox" runat="server" Text='<%# Bind("SalesStatus") %>' /> <br /> qty: <asp:TextBox ID="qtyTextBox" runat="server" Text='<%# Bind("qty") %>' /> <br /> Price: <asp:TextBox ID="PriceTextBox" runat="server" Text='<%# Bind("Price") %>' /> <br /> ProductName: <asp:TextBox ID="ProductNameTextBox" runat="server" Text='<%# Bind("ProductName") %>' /> <br /> Email:
  • 87. <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' /> <br /> Address: <asp:TextBox ID="AddressTextBox" runat="server" Text='<%# Bind("Address") %>' /> <br /> Name: <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' /> <br /> <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" /> &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> </InsertItemTemplate> <ItemTemplate> <table class="style9" style="border-bottom- style: solid; border-color: #000080">
  • 88. <tr> <td> ShoppingID:</td> <td> <asp:Label ID="ShoppingIDLabel" runat="server" Text='<%# Eval("ShoppingID") %>' /> </td> </tr> <tr> <td> ProductIDNo:</td> <td> <asp:Label ID="ProductIDNoLabel" runat="server" Text='<%# Bind("ProductIDNo") %>' /> </td> </tr>
  • 89. <tr> <td> UserID:</td> <td> <asp:Label ID="UserIDLabel" runat="server" Text='<%# Bind("UserID") %>' /> </td> </tr> <tr> <td> SalesStatus:</td> <td> <asp:Label ID="SalesStatusLabel" runat="server" Text='<%# Bind("SalesStatus") %>' /> </td> </tr> <tr>
  • 90. <td> qty:</td> <td> <asp:Label ID="qtyLabel" runat="server" Text='<%# Bind("qty") %>' /> </td> </tr> <tr> <td> Price:</td> <td> <asp:Label ID="PriceLabel" runat="server" Text='<%# Bind("Price") %>' /> </td> </tr> <tr> <td> ProductName:</td> <td>
  • 91. <asp:Label ID="ProductNameLabel" runat="server" Text='<%# Bind("ProductName") %>' /> </td> </tr> <tr> <td> Email:</td> <td> <asp:Label ID="EmailLabel" runat="server" Text='<%# Bind("Email") %>' /> </td> </tr> <tr> <td> Address:</td> <td> <asp:Label ID="AddressLabel" runat="server" Text='<%# Bind("Address") %>' />
  • 92. </td> </tr> <tr> <td> Name:</td> <td> <asp:Label ID="NameLabel" runat="server" Text='<%# Bind("Name") %>' /> </td> </tr> </table> &nbsp;<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" /> &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" /> &nbsp; </ItemTemplate> <PagerStyle BackColor="White"
  • 93. ForeColor="#000066" HorizontalAlign="Left" /> <HeaderStyle BackColor="#006699" Font- Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#669999" Font- Bold="True" ForeColor="White" /> </asp:FormView> <br /> </asp:View> <br /> <br /> <asp:View ID="View2" runat="server"> <hr /> All Closed Orders:<br /> <br /> <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataKeyNames="ShoppingID" DataSourceID="SqlDataSource2" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical">
  • 94. <FooterStyle BackColor="#CCCCCC" ForeColor="Black" /> <RowStyle BackColor="#EEEEEE" ForeColor="Black" /> <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField DataField="ShoppingID" HeaderText="ShoppingID" InsertVisible="False" ReadOnly="True" SortExpression="ShoppingID" /> <asp:BoundField DataField="ProductIDNo" HeaderText="ProductIDNo" SortExpression="ProductIDNo" /> <asp:BoundField DataField="UserID" HeaderText="UserID" SortExpression="UserID" /> <asp:BoundField DataField="SalesStatus" HeaderText="SalesStatus" SortExpression="SalesStatus" /> <asp:BoundField DataField="qty" HeaderText="qty"
  • 95. SortExpression="qty" /> </Columns> <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /> <EmptyDataTemplate> <span class="style10"><b>No Closed orders</b></span> </EmptyDataTemplate> <SelectedRowStyle BackColor="#008A8C" Font- Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#000084" Font- Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="#DCDCDC" /> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [ShoppingCart] WHERE ([SalesStatus] = @SalesStatus)"> <SelectParameters>
  • 96. <asp:Parameter DefaultValue="Completed" Name="SalesStatus" Type="String" /> </SelectParameters> </asp:SqlDataSource> <br /> <br /> <asp:FormView ID="FormView3" runat="server" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="ShoppingID" DataSourceID="SqlDataSource5" GridLines="Both" onitemupdated="FormView2_ItemUpdated" Width="205px"> <FooterStyle BackColor="White" ForeColor="#000066" /> <RowStyle ForeColor="#000066" /> <EditItemTemplate> <table class="style9" style="border-bottom-style: solid; border- bottom-color: #000080;">
  • 97. <tr> <td> ShoppingID:</td> <td> <asp:Label ID="ShoppingIDLabel0" runat="server" Text='<%# Eval("ShoppingID") %>' /> </td> </tr> <tr> <td> ProductIDNo:</td> <td> <asp:Label ID="ProductIDNoLabel1" runat="server" Text='<%# Bind("ProductIDNo") %>' /> </td> </tr>
  • 98. <tr> <td> UserID:</td> <td> <asp:Label ID="UserIDLabel1" runat="server" Text='<%# Bind("UserID") %>' /> </td> </tr> <tr> <td> SalesStatus:</td> <td> <asp:DropDownList ID="DropDownList2" runat="server" SelectedValue='<%# Bind("SalesStatus") %>'> <asp:ListItem>Open</asp:ListItem> <asp:ListItem>Pending</asp:ListItem> <asp:ListItem>Completed</asp:ListItem>
  • 99. </asp:DropDownList> </td> </tr> <tr> <td> qty:</td> <td> <asp:Label ID="qtyLabel1" runat="server" Text='<%# Bind("qty") %>' /> </td> </tr> <tr> <td> Price:</td> <td> <asp:Label ID="PriceLabel1" runat="server" Text='<%# Bind("Price") %>' /> </td> </tr>
  • 100. <tr> <td> ProductName:</td> <td> <asp:Label ID="ProductNameLabel1" runat="server" Text='<%# Bind("ProductName") %>' /> </td> </tr> <tr> <td> Email:</td> <td> <asp:Label ID="EmailLabel1" runat="server" Text='<%# Bind("Email") %>' /> </td> </tr> <tr>
  • 101. <td> Address:</td> <td> <asp:Label ID="AddressLabel1" runat="server" Text='<%# Bind("Address") %>' /> </td> </tr> <tr> <td> Name:</td> <td> <asp:Label ID="NameLabel1" runat="server" Text='<%# Bind("Name") %>' /> </td> </tr> </table> <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> &nbsp;<asp:LinkButton ID="UpdateButton0"
  • 102. runat="server" CausesValidation="True" CommandName="Update" Text="Update" /> &nbsp; </EditItemTemplate> <InsertItemTemplate> ProductIDNo: <asp:TextBox ID="ProductIDNoTextBox" runat="server" Text='<%# Bind("ProductIDNo") %>' /> <br /> UserID: <asp:TextBox ID="UserIDTextBox" runat="server" Text='<%# Bind("UserID") %>' /> <br /> SalesStatus: <asp:TextBox ID="SalesStatusTextBox" runat="server" Text='<%# Bind("SalesStatus") %>' /> <br /> qty:
  • 103. <asp:TextBox ID="qtyTextBox" runat="server" Text='<%# Bind("qty") %>' /> <br /> Price: <asp:TextBox ID="PriceTextBox" runat="server" Text='<%# Bind("Price") %>' /> <br /> ProductName: <asp:TextBox ID="ProductNameTextBox" runat="server" Text='<%# Bind("ProductName") %>' /> <br /> Email: <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' /> <br /> Address: <asp:TextBox ID="AddressTextBox" runat="server" Text='<%# Bind("Address") %>' /> <br />
  • 104. Name: <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' /> <br /> <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" /> &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> </InsertItemTemplate> <ItemTemplate> <table class="style9" style="border-bottom- style: solid; border-color: #000080"> <tr> <td> ShoppingID:</td> <td> <asp:Label ID="ShoppingIDLabel1" runat="server"
  • 105. Text='<%# Eval("ShoppingID") %>' /> </td> </tr> <tr> <td> ProductIDNo:</td> <td> <asp:Label ID="ProductIDNoLabel2" runat="server" Text='<%# Bind("ProductIDNo") %>' /> </td> </tr> <tr> <td> UserID:</td> <td> <asp:Label ID="UserIDLabel2" runat="server" Text='<%# Bind("UserID") %>' />
  • 106. </td> </tr> <tr> <td> SalesStatus:</td> <td> <asp:Label ID="SalesStatusLabel0" runat="server" Text='<%# Bind("SalesStatus") %>' /> </td> </tr> <tr> <td> qty:</td> <td> <asp:Label ID="qtyLabel2" runat="server" Text='<%# Bind("qty") %>' /> </td> </tr>
  • 107. <tr> <td> Price:</td> <td> <asp:Label ID="PriceLabel2" runat="server" Text='<%# Bind("Price") %>' /> </td> </tr> <tr> <td> ProductName:</td> <td> <asp:Label ID="ProductNameLabel2" runat="server" Text='<%# Bind("ProductName") %>' /> </td> </tr> <tr>
  • 108. <td> Email:</td> <td> <asp:Label ID="EmailLabel2" runat="server" Text='<%# Bind("Email") %>' /> </td> </tr> <tr> <td> Address:</td> <td> <asp:Label ID="AddressLabel2" runat="server" Text='<%# Bind("Address") %>' /> </td> </tr> <tr> <td> Name:</td> <td>
  • 109. <asp:Label ID="NameLabel2" runat="server" Text='<%# Bind("Name") %>' /> </td> </tr> </table> <asp:LinkButton ID="EditButton0" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" /> &nbsp;<asp:LinkButton ID="DeleteButton1" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" /> &nbsp; </ItemTemplate> <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" /> <HeaderStyle BackColor="#006699" Font- Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#669999" Font- Bold="True" ForeColor="White" /> </asp:FormView> <asp:SqlDataSource ID="SqlDataSource5" runat="server"
  • 110. ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [ShoppingCart] WHERE [ShoppingID] = @ShoppingID" InsertCommand="INSERT INTO [ShoppingCart] ([ProductIDNo], [UserID], [SalesStatus], [qty]) VALUES (@ProductIDNo, @UserID, @SalesStatus, @qty)" SelectCommand="SELECT ShoppingCart.ShoppingID, ShoppingCart.ProductIDNo, ShoppingCart.UserID, ShoppingCart.SalesStatus, ShoppingCart.qty, ProductTable.Price, ProductTable.ProductName, UserTable.Email, UserTable.Address, UserTable.Name FROM ShoppingCart INNER JOIN UserTable ON ShoppingCart.UserID = UserTable.Username INNER JOIN ProductTable ON ShoppingCart.ProductIDNo = ProductTable.ProductID where ShoppingID = @ShoppingID" UpdateCommand="UPDATE [ShoppingCart] SET [ProductIDNo] = @ProductIDNo, [UserID] = @UserID, [SalesStatus] = @SalesStatus, [qty] = @qty WHERE [ShoppingID] = @ShoppingID"> <SelectParameters> <asp:ControlParameter ControlID="GridView2" Name="ShoppingID" PropertyName="SelectedValue" /> </SelectParameters>
  • 111. <DeleteParameters> <asp:Parameter Name="ShoppingID" Type="Int32" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="ProductIDNo" Type="String" /> <asp:Parameter Name="UserID" Type="String" /> <asp:Parameter Name="SalesStatus" Type="String" /> <asp:Parameter Name="qty" Type="Int32" /> <asp:Parameter Name="ShoppingID" Type="Int32" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="ProductIDNo" Type="String" /> <asp:Parameter Name="UserID" Type="String" /> <asp:Parameter Name="SalesStatus" Type="String" />
  • 112. <asp:Parameter Name="qty" Type="Int32" /> </InsertParameters> </asp:SqlDataSource> </asp:View> <br /> <asp:View ID="View3" runat="server"> <hr /> Enter Order Number: <asp:TextBox ID="txtSearchSerial" runat="server"></asp:TextBox> <br /> <br /> <asp:FormView ID="FormView4" runat="server" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="ShoppingID" DataSourceID="SqlDataSource3" GridLines="Both" onitemupdated="FormView2_ItemUpdated" Width="205px"> <FooterStyle BackColor="White"
  • 113. ForeColor="#000066" /> <RowStyle ForeColor="#000066" /> <EditItemTemplate> <table class="style9" style="border-bottom-style: solid; border- bottom-color: #000080;"> <tr> <td> ShoppingID:</td> <td> <asp:Label ID="ShoppingIDLabel2" runat="server" Text='<%# Eval("ShoppingID") %>' /> </td> </tr> <tr> <td> ProductIDNo:</td> <td>
  • 114. <asp:Label ID="ProductIDNoLabel3" runat="server" Text='<%# Bind("ProductIDNo") %>' /> </td> </tr> <tr> <td> UserID:</td> <td> <asp:Label ID="UserIDLabel3" runat="server" Text='<%# Bind("UserID") %>' /> </td> </tr> <tr> <td> SalesStatus:</td> <td> <asp:DropDownList ID="DropDownList3" runat="server"
  • 116. Price:</td> <td> <asp:Label ID="PriceLabel3" runat="server" Text='<%# Bind("Price") %>' /> </td> </tr> <tr> <td> ProductName:</td> <td> <asp:Label ID="ProductNameLabel3" runat="server" Text='<%# Bind("ProductName") %>' /> </td> </tr> <tr> <td> Email:</td>
  • 117. <td> <asp:Label ID="EmailLabel3" runat="server" Text='<%# Bind("Email") %>' /> </td> </tr> <tr> <td> Address:</td> <td> <asp:Label ID="AddressLabel3" runat="server" Text='<%# Bind("Address") %>' /> </td> </tr> <tr> <td> Name:</td> <td> <asp:Label ID="NameLabel3" runat="server" Text='<%# Bind("Name") %>' /> </td>
  • 118. </tr> </table> <asp:LinkButton ID="UpdateCancelButton0" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> &nbsp;<asp:LinkButton ID="UpdateButton1" runat="server" CausesValidation="True" CommandName="Update" Text="Update" /> &nbsp; </EditItemTemplate> <InsertItemTemplate> ProductIDNo: <asp:TextBox ID="ProductIDNoTextBox0" runat="server" Text='<%# Bind("ProductIDNo") %>' /> <br /> UserID: <asp:TextBox ID="UserIDTextBox0" runat="server" Text='<%# Bind("UserID") %>' />
  • 119. <br /> SalesStatus: <asp:TextBox ID="SalesStatusTextBox0" runat="server" Text='<%# Bind("SalesStatus") %>' /> <br /> qty: <asp:TextBox ID="qtyTextBox0" runat="server" Text='<%# Bind("qty") %>' /> <br /> Price: <asp:TextBox ID="PriceTextBox0" runat="server" Text='<%# Bind("Price") %>' /> <br /> ProductName: <asp:TextBox ID="ProductNameTextBox0" runat="server" Text='<%# Bind("ProductName") %>' /> <br /> Email:
  • 120. <asp:TextBox ID="EmailTextBox0" runat="server" Text='<%# Bind("Email") %>' /> <br /> Address: <asp:TextBox ID="AddressTextBox0" runat="server" Text='<%# Bind("Address") %>' /> <br /> Name: <asp:TextBox ID="NameTextBox0" runat="server" Text='<%# Bind("Name") %>' /> <br /> <asp:LinkButton ID="InsertButton0" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" /> &nbsp;<asp:LinkButton ID="InsertCancelButton0" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> </InsertItemTemplate> <ItemTemplate>
  • 121. <table class="style9" style="border-bottom- style: solid; border-color: #000080"> <tr> <td> ShoppingID:</td> <td> <asp:Label ID="ShoppingIDLabel3" runat="server" Text='<%# Eval("ShoppingID") %>' /> </td> </tr> <tr> <td> ProductIDNo:</td> <td> <asp:Label ID="ProductIDNoLabel4" runat="server" Text='<%# Bind("ProductIDNo") %>' /> </td>
  • 122. </tr> <tr> <td> UserID:</td> <td> <asp:Label ID="UserIDLabel4" runat="server" Text='<%# Bind("UserID") %>' /> </td> </tr> <tr> <td> SalesStatus:</td> <td> <asp:Label ID="SalesStatusLabel1" runat="server" Text='<%# Bind("SalesStatus") %>' /> </td> </tr>
  • 123. <tr> <td> qty:</td> <td> <asp:Label ID="qtyLabel4" runat="server" Text='<%# Bind("qty") %>' /> </td> </tr> <tr> <td> Price:</td> <td> <asp:Label ID="PriceLabel4" runat="server" Text='<%# Bind("Price") %>' /> </td> </tr> <tr> <td> ProductName:</td>
  • 124. <td> <asp:Label ID="ProductNameLabel4" runat="server" Text='<%# Bind("ProductName") %>' /> </td> </tr> <tr> <td> Email:</td> <td> <asp:Label ID="EmailLabel4" runat="server" Text='<%# Bind("Email") %>' /> </td> </tr> <tr> <td> Address:</td> <td> <asp:Label ID="AddressLabel4"
  • 125. runat="server" Text='<%# Bind("Address") %>' /> </td> </tr> <tr> <td> Name:</td> <td> <asp:Label ID="NameLabel4" runat="server" Text='<%# Bind("Name") %>' /> </td> </tr> </table> <asp:LinkButton ID="EditButton1" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" /> &nbsp;<asp:LinkButton ID="DeleteButton2" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" /> &nbsp; </ItemTemplate>
  • 126. <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" /> <HeaderStyle BackColor="#006699" Font- Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#669999" Font- Bold="True" ForeColor="White" /> </asp:FormView> <br /> <br /> <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT ShoppingCart.ShoppingID, ShoppingCart.ProductIDNo, ShoppingCart.UserID, ShoppingCart.SalesStatus, ShoppingCart.qty, ProductTable.Price, ProductTable.ProductName, UserTable.Email, UserTable.Address, UserTable.Name FROM ShoppingCart INNER JOIN UserTable ON ShoppingCart.UserID = UserTable.Username INNER JOIN ProductTable ON ShoppingCart.ProductIDNo = ProductTable.ProductID WHERE ([ShoppingID] = @ShoppingID)"
  • 127. UpdateCommand="UPDATE [ShoppingCart] SET [ProductIDNo] = @ProductIDNo, [UserID] = @UserID, [SalesStatus] = @SalesStatus, [qty] = @qty WHERE [ShoppingID] = @ShoppingID"> <SelectParameters> <asp:ControlParameter ControlID="txtSearchSerial" Name="ShoppingID" PropertyName="Text" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> </asp:View> <br /> <br /> </asp:MultiView> </p> <p> &nbsp;</p> </asp:Content>
  • 128. Online Car Sales/EWAPP/AdminSalesMaintenance.aspx.cs using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.IO; using System.Net.Mail; public partial class AdminSalesMaintenance : System.Web.UI.Page {
  • 129. protected void Page_Load(object sender, EventArgs e) { } protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) { MultiView1.ActiveViewIndex = RadioButtonList1.SelectedIndex; } protected void FormView2_ItemUpdated(object sender, FormViewUpdatedEventArgs e) { this.GridView3.DataBind(); String ToEMail = (FormView2.Row.FindControl("EmailLabel0") as Label).Text;
  • 130. using (StringWriter sw = new StringWriter()) { using (HtmlTextWriter hw = new HtmlTextWriter(sw)) { FormView2.RenderControl(hw); StringReader sr = new StringReader(sw.ToString()); MailMessage mm = new MailMessage("[email protected]", ToEMail); mm.Subject = "Your Order Status has been modified"; mm.Body = "Order Status: " + sw.ToString() + "<br><br> You will be Notified Once Your Order is processed"; mm.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.EnableSsl = true; System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential(); NetworkCred.UserName = "[email protected]";
  • 131. NetworkCred.Password = "aminroop"; smtp.UseDefaultCredentials = true; smtp.Credentials = NetworkCred; smtp.Port = 587; smtp.Send(mm); } } } public override void VerifyRenderingInServerForm(Control control) { /* Verifies that the control is rendered */ } protected void FormView3_ItemUpdated(object sender, FormViewUpdatedEventArgs e) {
  • 132. this.GridView2.DataBind(); } protected void GridView3_RowUpdated(object sender, GridViewUpdatedEventArgs e) { } } Online Car Sales/EWAPP/AdminUserMaintenance.aspx <%@ Page Language="C#" MasterPageFile="~/AdminMasterPage.master" MaintainScrollPositionOnPostback="true" AutoEventWireup="true" CodeFile="AdminUserMaintenance.aspx.cs" Inherits="AdminUserMaintenance" Title="OurShopping - Online Shopping Store" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <style type="text/css">
  • 133. .style17 { width: 100%; } .style19 { text-align: center; font-weight: bold; font-size: medium; } .style18 { width: 156px; } .style20 { width: 132px; }
  • 134. </style> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" onselectedindexchanged="RadioButtonList1_SelectedIndexChan ged"> <asp:ListItem Value="0">Add New Account</asp:ListItem> <asp:ListItem Value="1">View / modify My account</asp:ListItem> <asp:ListItem Value="2">View / Modify All User Accounts</asp:ListItem> </asp:RadioButtonList> <asp:MultiView ID="MultiView1" runat="server"> <asp:View ID="View1" runat="server"> <table class="style17"> <tr> <td class="style19" colspan="2"
  • 135. style="border-color: #000080; background- color: #AABFEA; border-bottom-style: solid;"> Add New Administrator Account</td> </tr> <tr> <td class="style18"> Name</td> <td> <asp:TextBox ID="txtName" runat="server" Width="139px"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName" ErrorMessage="Name Is requierd">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td class="style18"> Passport Number</td>
  • 136. <td> <asp:TextBox ID="txtpassportNumber" runat="server" Width="139px"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtpassportNumber" ErrorMessage="Please Enter your Passport Number">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td class="style18"> UserName</td> <td> <asp:TextBox ID="txtUserName" runat="server" Width="139px"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtUserName" ErrorMessage="Please Enter your username">*</asp:RequiredFieldValidator> </td>
  • 137. </tr> <tr> <td class="style18"> Password</td> <td> <asp:TextBox ID="txtPassword1" runat="server" Width="139px"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtPassword1" ErrorMessage="please enter your password">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td class="style18"> Re-Type Password</td> <td> <asp:TextBox ID="txtpassword2" runat="server" Width="137px"></asp:TextBox>
  • 138. <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtpassword2" ErrorMessage="please enter The password again">*</asp:RequiredFieldValidator> <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="txtPassword1" ControlToValidate="txtpassword2" ErrorMessage="Password is not matched">*</asp:CompareValidator> </td> </tr> <tr> <td class="style18"> Email</td> <td> <asp:TextBox ID="txtEmail1" runat="server" Width="136px"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtEmail1" ErrorMessage="Please Enter your
  • 139. Email">*</asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtEmail1" ErrorMessage="RegularExpressionValidator" ValidationExpression="w+([- +.']w+)*@w+([-.]w+)*.w+([- .]w+)*">*</asp:RegularExpressionValidator> </td> </tr> <tr> <td class="style18"> Confirm your Email</td> <td> <asp:TextBox ID="txtEmail2" runat="server" Width="138px"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtEmail2" ErrorMessage="Please Enter your Email">*</asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
  • 140. ControlToValidate="txtEmail2" ErrorMessage="accepted format is [email protected]" ValidationExpression="w+([- +.']w+)*@w+([-.]w+)*.w+([- .]w+)*">*</asp:RegularExpressionValidator> <asp:CompareValidator ID="CompareValidator2" runat="server" ControlToCompare="txtEmail1" ControlToValidate="txtEmail2" ErrorMessage="The Email address does not matched">*</asp:CompareValidator> </td> </tr> <tr> <td class="style18"> Address:</td> <td> <asp:TextBox ID="txtAddress" runat="server" TextMode="MultiLine" Width="141px"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="txtAddress"
  • 141. ErrorMessage="accepted format is [email protected]">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td class="style18"> Choose the user Role</td> <td> <asp:ListBox ID="ListBox1" runat="server" AutoPostBack="True"> <asp:ListItem>admin</asp:ListItem> <asp:ListItem>user</asp:ListItem> </asp:ListBox> </td> </tr> <tr> <td class="style18"> &nbsp;</td> <td>
  • 142. <asp:Label ID="Label1" runat="server" ForeColor="#000066"></asp:Label> <asp:ValidationSummary ID="ValidationSummary1" runat="server" /> </td> </tr> <tr> <td class="style18"> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [UserTable] WHERE [ID] = @ID" InsertCommand="INSERT INTO [UserTable] ([Username], [Password], [Email], [Address], [Name], [IDnumber], [UserType]) VALUES (@Username, @Password, @Email, @Address, @Name, @IDnumber, @UserType)" SelectCommand="SELECT * FROM [UserTable]" UpdateCommand="UPDATE [UserTable] SET [Username] = @Username, [Password] = @Password, [Email] = @Email, [Address] = @Address, [Name] = @Name, [IDnumber] = @IDnumber, [UserType] = @UserType WHERE
  • 143. [ID] = @ID"> <DeleteParameters> <asp:Parameter Name="ID" Type="Int32" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="Username" Type="String" /> <asp:Parameter Name="Password" Type="String" /> <asp:Parameter Name="Email" Type="String" /> <asp:Parameter Name="Address" Type="String" /> <asp:Parameter Name="Name" Type="String" /> <asp:Parameter Name="IDnumber" Type="String" /> <asp:Parameter Name="UserType" Type="String" /> <asp:Parameter Name="ID" Type="Int32" /> </UpdateParameters>
  • 144. <InsertParameters> <asp:ControlParameter ControlID="txtUserName" Name="Username" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="txtPassword1" Name="Password" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="txtEmail1" Name="Email" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="txtAddress" Name="Address" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="txtName" Name="Name" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="txtpassportNumber" Name="IDnumber" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="ListBox1" Name="UserType"
  • 145. PropertyName="SelectedValue" Type="String" /> </InsertParameters> </asp:SqlDataSource> </td> <td> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Register" /> </td> </tr> </table> </asp:View> <br /> <br /> <asp:View ID="View2" runat="server"> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="3" DataKeyNames="ID" DataSourceID="SqlDataSource3"
  • 146. GridLines="Vertical" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px"> <FooterStyle BackColor="#CCCCCC" ForeColor="Black" /> <RowStyle BackColor="#EEEEEE" ForeColor="Black" /> <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" /> <asp:BoundField DataField="Username" HeaderText="Username" SortExpression="Username" /> <asp:BoundField DataField="Password" HeaderText="Password" SortExpression="Password" /> <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" /> <asp:BoundField DataField="Address" HeaderText="Address"
  • 147. SortExpression="Address" /> <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" /> <asp:BoundField DataField="IDnumber" HeaderText="IDnumber" SortExpression="IDnumber" /> </Columns> <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#008A8C" Font- Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#000084" Font- Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="#DCDCDC" /> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [UserTable] WHERE ([UserType] = @UserType) AND ([Username] =