<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" Trace="false" debug="true"%>
<%@ import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.IO" %>
<script runat="server">
Sub Add_Info(s As Object, e as EventArgs)
lblMsg.Text = drpManufacturer.SelectedValue
End Sub
Sub Page_Load
Dim conPubs as SqlConnection
Dim cmdSQL as SqlCommand
Dim dtrAllProducts as SqlDataReader
'Retrieve records from database
conPubs = New SqlConnection("Server=xx.xx.xx.xx;uid=name;pwd=pwd;database=db")
cmdSQL = New SqlCommand("SELECT * FROM why3s_products", conPubs)
conPubs.Open()
dtrAllProducts = cmdSQL.ExecuteReader()
'Bind to Repeater
rptPrdList.DataSource = dtrAllProducts
rptPrdList.DataBind()
dtrAllProducts.Close()
conPubs.Close()
'Retrieve records from database
conPubs = New SqlConnection("Server=xx.xx.xx.xx;uid=name;pwd=pwd;database=db")
cmdSQL = New SqlCommand("SELECT manufacturers_name FROM why3s_manufacturers", conPubs)
conPubs.Open()
dtrAllProducts = cmdSQL.ExecuteReader()
'Bind to DropDownList
drpManufacturer.DataSource = dtrAllProducts
drpManufacturer.DataTextField = "manufacturers_name"
drpManufacturer.DataBind()
dtrAllProducts.Close()
conPubs.Close()
End Sub
</script>
<html>
<head>
<title>Add New Manufacturer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<form id="frmAdd" name="frmAdd" action="addproduct.aspx" method="post" enctype="multipart/form-data" runat="server">
<!--#include file="inc_top_menu.aspx" --><br>
<table cellspacing="0" cellpadding="0" width="750" border="0">
<tbody>
<tr>
<td width="125" valign="top"> <asp:validationsummary ID="ValidationSummary1" runat="server" ShowMessageBox="True" HeaderText="Missing:" DisplayMode="List"></asp:validationsummary>
</td>
<td width="625">
<table cellspacing="2" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>Manufacturer:</td>
<td><asp:dropdownlist ID="drpManufacturer" runat="server"></asp:dropdownlist>
- <em><font size="2" face="Verdana, Arial, Helvetica, sans-serif">If
not in list please create before you continue.</font></em></td>
</tr>
<tr>
<td width="26%"> Product Model Name:</td>
<td width="74%"> <asp:textbox id="txtModel" runat="server" TextMode="SingleLine" MaxLength="15"></asp:textbox> <asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" Text="Required" ErrorMessage="Model Name" ControlToValidate="txtModel"></asp:requiredfieldvalidator> </td>
</tr>
<tr>
<td>Product Fullmodel Name:</td>
<td><asp:textbox AutoPostBack="false" ID="txtFullModel" MaxLength="60" runat="server" /> <asp:requiredfieldvalidator ControlToValidate="txtFullModel" ErrorMessage="Fullmodel Name" Text="Required" runat="server" /> </td>
</tr>
<tr>
<td> Product Image:</td>
<td><input name="inpFileUpload" type="file" id="inpFileUpload" size="40" maxlength="60" Runat="Server">
<font size="1" face="Verdana, Arial, Helvetica, sans-serif"><em>300kb
max file size.</em></font></td>
</tr>
<tr>
<td> Product Description</td>
<td> <asp:textbox id="txtDescription" runat="server" TextMode="SingleLine" MaxLength="255" Columns="50"></asp:textbox> <asp:requiredfieldvalidator id="RequiredFieldValidator2" runat="server" Text="Required" ErrorMessage="Description" ControlToValidate="txtDescription"></asp:requiredfieldvalidator> </td>
</tr>
<tr>
<td>Product Price:</td>
<td><asp:textbox ID="txtPrice" MaxLength="10" runat="server" /> <asp:requiredfieldvalidator ControlToValidate="txtPrice" ErrorMessage="Price" InitialValue="Required" runat="server" Text="Required" /> </td>
</tr>
<tr>
<td>Product Retail Price:</td>
<td><asp:textbox ID="txtRetail" MaxLength="10" runat="server" /></td>
</tr>
<tr>
<td>Product Cost:</td>
<td><asp:textbox ID="txtCost" MaxLength="10" runat="server" /></td>
</tr>
<tr>
<td>Product Wholesale Price:</td>
<td><asp:textbox ID="txtWholesale" MaxLength="10" runat="server" /></td>
</tr>
<tr>
<td>Product Weight:</td>
<td><asp:textbox ID="txtWeight" MaxLength="7" runat="server" /></td>
</tr>
<tr>
<td>Product Status:</td>
<td><div align="left">
<asp:dropdownlist ID="drpStatus" runat="server">
<asp:listitem Text="Show" runat="server"></asp:listitem>
<asp:listitem Text="Hide" runat="server"></asp:listitem>
</asp:dropdownlist>
<em><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Display
vacuum on page.</font></em></div></td>
</tr>
<tr>
<td>Product Sold-To-Dt:</td>
<td><asp:textbox ID="txtSTD" MaxLength="4" runat="server" Text="0" /> <asp:requiredfieldvalidator ControlToValidate="txtSTD" ErrorMessage="Sold-To-Date" InitialValue="Required" Text="Required" runat="server" /> </td>
</tr>
<tr>
<td>Product Show Button:</td>
<td><asp:dropdownlist ID="drpShowBuy" runat="server">
<asp:listitem Text="Show" runat="server"></asp:listitem>
<asp:listitem Text="Hide" runat="server"></asp:listitem>
</asp:dropdownlist> <em><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Do
not display the buy button.</font></em></td>
</tr>
<tr>
<td>Product Special Notify:</td>
<td><asp:textbox ID="txtSpecialNotify" MaxLength="55" runat="server" /></td>
</tr>
<tr>
<td>Product Quantity:</td>
<td><asp:textbox ID="txtQuantity" MaxLength="4" runat="server" Text="0" /></td>
</tr>
<tr>
<td> </td>
<td><asp:button ID="butAdd" OnClick="Add_Info" runat="server" Text="Add" BackColor="Yellow" BorderColor="Blue" BorderStyle="Groove"></asp:button> <asp:label ID="lblError" runat="server"></asp:label></td>
</tr>
<tr>
<td> </td>
<td><asp:label ID="lblMsg" runat="server"></asp:label></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</form>
<br />
<center>
<asp:repeater EnableViewState="false" ID="rptPrdList" runat="server">
<headertemplate>
<table border="1">
<tr>
<th>ID</th>
<th>Name</th>
<th>Image</th>
<th>Entry_Dt</th>
<th>Description</th>
</tr>
</headertemplate>
<itemtemplate>
<tr bgcolor="#CCFFFF">
<td><a href="updatemanufacturer.aspx?ID=<%# Container.DataItem("manufacturers_id") %>"><%# Container.DataItem("manufacturers_id") %></a></td>
<td><%# Container.DataItem("manufacturers_name") %></td>
<td><%# Container.DataItem("manufacturers_image") %></td>
<td><%# Container.DataItem("manufacturers_entry_dt") %></td>
<td><%# Container.DataItem("manufacturers_description") %></td>
</tr>
</itemtemplate>
<AlternatingItemTemplate>
<tr bgcolor="#99FF66">
<td><%# Container.DataItem("manufacturers_id") %></td>
<td><%# Container.DataItem("manufacturers_name") %></td>
<td><%# Container.DataItem("manufacturers_image") %></td>
<td><%# Container.DataItem("manufacturers_entry_dt") %></td>
<td><%# Container.DataItem("manufacturers_description") %></td>
</tr>
</AlternatingItemTemplate>
<footertemplate>
</table>
</footertemplate>
</asp:repeater>
</center>
</body>
</html>