Publicidad

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

10 de Nov de 2022
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
Publicidad
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
Publicidad
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
Publicidad
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
Publicidad
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
Publicidad
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
Publicidad
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
Publicidad
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
Publicidad
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
Publicidad
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
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
Próximo SlideShare
HTML SERVER CONTROL  - ASP.NET WITH C#HTML SERVER CONTROL - ASP.NET WITH C#
Cargando en ... 3
1 de 256
Publicidad

Más contenido relacionado

Más de rosemarybdodson23141(20)

Publicidad

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="Pr