Académique Documents
Professionnel Documents
Culture Documents
150100000698
Project Documentation
ADIT IT404.NET
Visual Basic.NET
Name: Wu Jian Min Student ID: 150100000698 Class: IT404.NET Visual Basic.NET Country: Brunei Darussalam Lecturer Name: Ms. Grace N. Balayan
150100000698
Contents
1. Proposal
Page
1.1 Introduction ...................................................................................................................3 1.2 Problem background.....................................................................................................4 1.3 Proposed system and Objective.....................................................................................5 1.4 Hardware and Software Requirement............................................................................6 2. Interface Design and Input screen................................................................................7 3. Data Design.................................................................................................................. 18 4. Procedural Design........................................................................................................23 5. Development (Program Listing HTML + VB code).................................................30 6. Testing 6.1 Test Plan........................................................................................................................113 6.2 Test Case.......................................................................................................................114 6.3 Test Log........................................................................................................................135 7. Implementation.............................................................................................................136 8. Conclusion.....................................................................................................................138 9. Reference.......................................................................................................................139
150100000698
Your Baby Is Our Concern Shop is selling variety of baby item products, such as strollers, car seats and seating. It was set up in 1990 by Mr. Goh. It is located in Bandar Seri Begawan, Brunei Darussalam. The shop carries many famous brands of baby item products. Those products have high quality control and are approved by the government. The baby item products will let your baby comfortable and safety. The shops layout of Your Baby Is Our Concern Shop is very organized. Different baby item products are categorized in different department. Every baby item product has provided display and instruction for a customer to understand what it used for and how to use properly. Many customers are willing to buy baby item products from Your Baby Is Our Concern Shop because of its guarantee. Mr. Goh is planning to open a second shop in Time Square Mall. He hopes he is able to make a new breakthrough in his new shop. He wants to let more customers to know about his products, so that he is trying to broaden his market. Therefore, Mr. Goh has contacted me to help him to improve his current shop.
150100000698
I began to get more information from the shop by asking some customers about their requirements. Besides, I began to collect some information for each product about their usages.
There are 5 employees running the shop. Due to the increasing of customers, it is difficult for employees to serve them all. After a survey, the Your Baby Is Our Concern Shop has a few problems currently such as:
Customers may have difficulties with transportation. Do not provide any suggestion box for customers. Some customers do not have enough free time to go to buy baby item during office hours. It does not open 24 hours to sever customers
150100000698
I am planning to make an attractive website to improve the shop. The website is convenient for customers and the employees of Your Baby Is Our Concern Shop. Customers can know more about baby item information and function through the website. Customers can gain more knowledge about new baby item or other baby item products. Customers can trust to use those products for their little baby. This website is able to operate 24 hours and 7 days a week. Customers can send feedbacks or comments about the products. Customers can place any order in any time through website. This website can update easily The main benefit of the website is to find the information of the baby item products easily and quickly to order the baby item products. The website is user friendly. Customers can surf the website any time. Customers also can quickly know about new arrival of baby item products.
150100000698
Hardware requirement:
Screen Resolution 1024 by 768 pixels, 16 bit or 32 bit color quality or higher resolution Monitor Window XP or higher operating system
Software requirement
Internet Explorer 8 / Google Chrome / Mozilla Firefox Microsoft visual web developer 2008 Express Edition
150100000698
Calendar
Title Introduction
150100000698
Img Btn4
Img Btn5
Calendar
Label 1
150100000698
Img Btn4
Img Btn5
Calendar
Log In Form
150100000698
Banner
Img Btn1 Img Btn2 Img Btn3 Img Btn4 Img Btn5
Calendar
Log In Form
150100000698
Banner
Img Btn1 Img Btn2 Img Btn3 Img Btn4 Img Btn5
Calendar
Log In Form
150100000698
Banner
Img Btn1 Img Btn2 Img Btn3 Img Btn4 Img Btn5
Calendar
Log In Form
150100000698
Img Btn4
Img Btn5
Calendar
Log In Form
150100000698
Img Btn4
Img Btn5
150100000698
Img Btn5
Calendar
Title GridView
Log In Form
Form
150100000698
Banner
Img Btn1 Img Btn2 Img Btn3 Img Btn4 Img Btn5
Calendar
Title GridView
Log In Form
Form
150100000698
Img Btn5
Calendar
Title GridView
Log In Form
Form
150100000698
3. Data Design
Member Table
Foreign key No
FirstName
varchar(MAX)
No
No
LastName
varchar(MAX)
No
No
Gender
varchar(MAX)
No
No
DateOfBirth
varchar(MAX)
No
No
Nationality
varchar(MAX)
No
No
HP
varchar(MAX)
No
No
CurrentAddress
varchar(MAX)
No
No
CarSeat Table
150100000698
Foreign key No
ProductName
varchar(MAX)
No
No
Brand
varchar(MAX)
No
No
Color
varchar(MAX)
No
No
Specifications
Text
No
No
OriginalPrice
varchar(MAX)
No
No
Offer
varchar(MAX)
No
No
FinialPrice
varchar(MAX)
No
No
Image
varchar(MAX)
No
No
150100000698
Foreign key No
ProductName
varchar(MAX)
No
No
Brand
varchar(MAX)
No
No
Color
varchar(MAX)
No
No
Specifications
Text
No
No
OriginalPrice
varchar(MAX)
No
No
Offer
varchar(MAX)
No
No
FinialPrice
varchar(MAX)
No
No
Image
varchar(MAX)
No
No
150100000698
Foreign key No
ProductName
varchar(MAX)
No
No
Brand
varchar(MAX)
No
No
Color
varchar(MAX)
No
No
Specifications
Text
No
No
OriginalPrice
varchar(MAX)
No
No
Offer
varchar(MAX)
No
No
FinialPrice
varchar(MAX)
No
No
Image
varchar(MAX)
No
No
150100000698
Columns name ID
Primary key No
Foreign key No
Checkout_ID
varchar(MAX)
No
No
Quantity
varchar(MAX)
No
No
Price
varchar(MAX)
No
No
UserId
varchar(MAX)
No
No
150100000698
4. Procedural Design
Pseudo code Main Do CALL menu Selection End Do Module Menu Selection Do CALL menu screen Do while choice not equal 0 Get choice DO CASE Choice 1 Do CALL HOME End Do Choice 2 Do CALL BABY ITEM End Do Choice 3 Do CALL ORDER End Do Choice 4 Do
Wu Jian Min Page 23
IT404.NET Wu Jian Min CALL FEEDBACK End Do Choice 5 Do CALL CONTACT US End Do End Case End Do End Do Module Menu Home Do Display information End Do Module Menu Baby Item Do CALL show screen Do while choice not equal 0 Get choice Do Case Choice 1 Do call car seat page End Do Choice 2 Do call stroller page End Do Choice 3
Wu Jian Min Page 24
150100000698
IT404.NET Wu Jian Min Do call seating page End Do End Case End Do End Do Module Log In Do Call show log in screen Do while choice not equal 0 Get choice Do Case Choice 1 Do Call Username and Password End Do Choice 2 Do Call Sign Up End Do Choice 3 Do Call Log in End Do Module Add Cart Do Call Show Screen Do while choice not equal 0 Get choice Do Case Choice 1
Wu Jian Min Page 25
150100000698
IT404.NET Wu Jian Min Do call yes End Do Choice 2 Do call no End do End Case End Do End Do Module Order Do Call show screen Call Input String for Product Name Call Input Number for Quantity Call Input Currency for Price Call Proceed To Check End Do Module Proceed To Check Do Call show screen Call Input String for Credit Card Type Call Input String for Card Holder Name Call Input String for Valid From Call Input String for Expiry Date Call Input String for Issue Number Call Input String for Security Code Call Input String for Address
Wu Jian Min Page 26
150100000698
IT404.NET Wu Jian Min Call Input String for Postcode Call Input String for Country Call Input String for Telephone Do while choice not equal 0 Get choice Do case 1 Choice 1 Do call yes End Do Do call no End Do End Do Module Feedback Do Call show screen Call Input String for First Name Call Input String for Last Name Call Input String for Gender Call Input String for Email Address Call Input String for Telephone Call Input String for Hand phone Call Input String for Comment Do while choice not equal 0 Get choice Do case 1 Choice 1
Wu Jian Min Page 27
150100000698
IT404.NET Wu Jian Min Do call Send End Do Do call Cancel End Do End Do Module contact us Do Call show screen End Do
150100000698
150100000698
Star t Log In
Home page
BabyItem page
CarSeat page
Stroller page
Seating page
Order page
150100000698
</head> <body background="../images/bg%20img.jpg" style="background-position: center top; background-attachment: scroll; background-repeat: repeat-y; text-align: center; height: 1000px; "> <form id="form1" runat="server"> <div> <table class="style2" align="center"> <tr>
150100000698
<asp:ImageButton ID="ImageButton1" runat="server" Height="129px" ImageUrl="~/images/baby banner.jpg" Width="903px" /> </td> </tr> </table> <table class="style4" align="center"> <tr> <td align="left"> <asp:ImageButton ID="btnHomeImg" runat="server" Height="40px" ImageUrl="~/images/Home button.jpg" PostBackUrl="~/Webpages/Home.aspx" Width="175px" /> <asp:ImageButton ID="btnBabyItemImg" runat="server" Height="40px" ImageUrl="~/images/Baby Item button.jpg" Width="175px" PostBackUrl="~/Webpages/BabyItem.aspx" /> <asp:ImageButton ID="btnOrderImg" runat="server" Height="40px" ImageUrl="~/images/Order button.jpg" Width="175px" PostBackUrl="~/Webpages/Order.aspx" Enabled="False" /> <asp:ImageButton ID="btnFeedbackImg" runat="server" Height="40px" ImageUrl="~/images/Feedback button.jpg" Width="175px" PostBackUrl="~/Webpages/FeedbackPage.aspx" /> <asp:ImageButton ID="btnContactUsImg" runat="server" Height="40px" ImageUrl="~/images/Contact us button.jpg" Width="175px" PostBackUrl="~/Webpages/ContactUs.aspx" /> </td> </tr> </table> <table class="style1" align="center"> <tr> <td class= "style5" valign="top"> <br/><br/> <asp:Calendar ID="Calendar1" runat="server" BackColor="#FFFFCC" BorderColor="#FFCC66" BorderWidth="1px" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="#663399" Height="200px" ShowGridLines="True" Width="220px"> <SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" /> <SelectorStyle BackColor="#FFCC66" /> <TodayDayStyle BackColor="#FFCC66" ForeColor="White" /> <OtherMonthDayStyle ForeColor="#CC9966" /> <NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC" /> <DayHeaderStyle BackColor="#FFCC66" Font-Bold="True" Height="1px" /> <TitleStyle BackColor="#990000" Font-Bold="True" FontSize="9pt" ForeColor="#FFFFCC" /> </asp:Calendar>
150100000698
<br /><br /> <asp:Label ID="lblwelcome" runat="server" Text="Welcome:" Visible="False"></asp:Label> <asp:LoginName ID="LoginName1" runat="server" /> <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutPageUrl="~/Webpages/Home.aspx" Visible="False" /> <br /> <asp:Login ID="Login1" runat="server" BackColor="#FFFBD6" BorderColor="#FFDFAD" BorderPadding="4" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#333333" Height="172px" TextLayout="TextOnTop" Width="213px" style="margin-bottom: 0px"> <TextBoxStyle Font-Size="0.8em" /> <LoginButtonStyle BackColor="White" BorderColor="#CC9966" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" FontSize="0.8em" ForeColor="#990000" /> <LayoutTemplate> <table border="0" cellpadding="4" cellspacing="0" style="border-collapse:collapse;"> <tr> <td> <table border="0" cellpadding="0" style="height:172px;width:213px;"> <tr> <td align="center" style="color:White;backgroundcolor:#990000;font-size:0.9em;font-weight:bold;"> Log In</td> </tr> <tr> <td> <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label> </td> </tr> <tr> <td> <asp:TextBox ID="UserName" runat="server" Font-Size="0.8em"></asp:TextBox> <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="ctl00$Login1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td> <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label> </td> </tr>
150100000698
<asp:TextBox ID="Password" runat="server" Font-Size="0.8em" TextMode="Password"></asp:TextBox> <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="ctl00$Login1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td> <asp:CheckBox ID="RememberMe" runat="server" Text="Remember me next time." /> </td> </tr> <tr> <td align="center" style="color:Red;"> <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal> </td> </tr> <tr> <td align="left"> <asp:Button ID="Button1" runat="server" BackColor="White" BorderColor="#CC9966" BorderStyle="Solid" BorderWidth="1px" CommandName="SignUp" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#990000" onclick="Button1_Click" Text="Sign Up" ValidationGroup="ct100$SignUp" PostBackUrl="~/Webpages/Registration.aspx" /> &nb sp; <asp:Button ID="LoginButton" runat="server" BackColor="White" BorderColor="#CC9966" BorderStyle="Solid" BorderWidth="1px" CommandName="Login" Font-Names="Verdana" FontSize="0.8em" ForeColor="#990000" Text="Log In" ValidationGroup="ctl00$Login1" /> </td> </tr> </table> </td> </tr> </table>
</LayoutTemplate>
150100000698
ForeColor="White" /> </asp:Login> <br /> <br /> <asp:HyperLink ID="HyperLinkDB" runat="server" NavigateUrl="~/Webpages/Database Form.aspx" Visible="False">Manage Database</asp:HyperLink> <br /> <br /> <asp:ImageButton ID="ImageButton2" runat="server" Height="92px" ImageUrl="~/images/Facebook.gif" Width="93px" /> <br /> <asp:Label ID="Label1" runat="server" ForeColor="#CC6600" Text="Join Us On Facebook"></asp:Label> </td> <td class= "style6" valign="top"> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </td> </tr> </table> <table class="style7" align="center"> <tr> <td class= "style7" valign="top"> <p><font color="#CC6600">(c) 2006-2009 Your Baby Is Our Concern Inc.</font></p> </td> </tr> </table> </div> </form> </body> </html>
150100000698
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim membershipUser As MembershipUser = Membership.GetUser() If Context.User.Identity.IsAuthenticated Then If Context.User.IsInRole("admin") Then lblwelcome.Visible = True LoginStatus1.Visible = True HyperLinkDB.Visible = True btnOrderImg.Enabled = True ElseIf Context.User.IsInRole("members") Then lblwelcome.Visible = True LoginStatus1.Visible = True HyperLinkDB.Visible = False btnOrderImg.Enabled = True Else lblwelcome.Visible = False LoginStatus1.Visible = False HyperLinkDB.Visible = False btnOrderImg.Enabled = False End If End If If membershipUser IsNot Nothing Then Dim loggedinuser As String = Membership.GetUser().ToString() LoginName1.ID = loggedinuser Else LoginName1.ID = "" End If End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) End Sub End Class
150100000698
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Webpages/MasterDesign.Master" CodeBehind="Home.aspx.vb" Inherits="BabyAge.Home" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <table style = "width: 600px"><tr><td></td></tr> <tr><td><p style = "text-align:justify"><font size="5" color="#CC6600"><b><i> Welcome To Your Baby Is Our Concern Shop </b></i></font></p></td></tr><tr><td> <p style = "text-align:justify"><font size="5" color="#CC6600"> Your Baby Is Our Concern Shop is selling variety of baby item products, such as strollers, car seats and seating. It was set up in 1990 by Mr. Goh. It is located in Bandar Seri Begawan, Brunei Darussalam. The shop carries many famous brands of baby item products. Those products have high quality control and are approved by the government. The baby item products will let your baby comfortable and safety. </font></p> </td></tr> <tr><td> <asp:Image ID="Image1" runat="server" ImageUrl="~/images/your baby is our concern.jpg" /> </td></tr> </table> </asp:Content>
150100000698
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Webpages/MasterDesign.Master" CodeBehind="BabyItem.aspx.vb" Inherits="BabyAge.BabyItem" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <table style="width: 600px"> <tr><td></td></tr> <tr><td></td></tr> <tr><td> <asp:Label ID="lblSelectCatergory" runat="server" Text="Selet A Catergory:" ForeColor="#CC6600"></asp:Label> <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" ForeColor="#CC6600"> <asp:ListItem Selected="True">Please Select A Catergory</asp:ListItem> <asp:ListItem>CarSeatPage</asp:ListItem> <asp:ListItem>StrollerPage</asp:ListItem> <asp:ListItem>SeatingPage</asp:ListItem> </asp:DropDownList> </td></tr> <tr><td align="left"> <asp:Label ID="Label2" runat="server" Font-Italic="True" FontSize="X-Large" ForeColor="#CC6600" Text="Brand"></asp:Label> </td></tr> <tr><td> <img src="../images/brand.jpg" style="width: 660px; height: 60px" /></td></tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td align="left"> <asp:Image ID="Image1" runat="server" Height="239px" ImageUrl="~/images/CarSeatPic/Chicco Vector Car Seat.jpg" Width="221px" /> <asp:Image ID="Image2" runat="server" Height="239px" ImageUrl="~/images/SeatingPic/Combi High Chair Rashule Width="204px" /> <asp:Image ID="Image3" runat="server" Height="239px" ImageUrl="~/images/StrollerPic/Capella Improve Version S705style="margin-top: 0px" Width="199px" /> </td></tr> </table> </asp:Content>
DX.jpg"
12.jpg"
vb code
Wu Jian Min Page 37
150100000698
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DropDownList1.SelectedIndexChanged 'Place this in the main menu Dim Link As String = DropDownList1.SelectedValue.ToString() + ".aspx" Response.Redirect(Link) End Sub End Class
150100000698
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Webpages/MasterDesign.Master" CodeBehind="CarSeatPage.aspx.vb" Inherits="BabyAge.CarSeatPage" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <table style="width: 614px"> <tr><td class="style8"> </td> </tr> <tr><td class="style8"> Size="Larger" <asp:Label ID="lblCarSeat" runat="server" FontForeColor="#CC6600" Text="Car Seat"></asp:Label> </td> </tr> <tr><td class="style8"> <asp:DataList ID="DataList1" runat="server" CellPadding="4" DataKeyField="ProductID" DataSourceID="SqlDataSource1" ForeColor="#333333" RepeatColumns="2"> <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <AlternatingItemStyle BackColor="White" /> <ItemStyle BackColor="#FFFBD6" ForeColor="#333333" /> <SeparatorStyle Font-Bold="False" Font-Italic="False" FontOverline="False" Font-Strikeout="False" Font-Underline="False" /> <SelectedItemStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /> <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <ItemTemplate> <table><tr><td style = "width : 248px"> <asp:Label ID="ProductNameLabel" runat="server" Text='<%# Eval("ProductName") %>' ForeColor="#CC6600" /> </td></tr> <caption> <br /> <tr> <td style = "width : 248px"> Height="157px" Eval("Image") + ".jpg"%>' </td> </tr> <caption> <asp:Image ID="Image1" runat="server" ImageUrl='<%#"~/images/CarSeatPic/" + Width="168px" />
150100000698
ProductID: <asp:Label ID="ProductIDLabel" runat="server" ForeColor="#CC6600" Text='<%# Eval("ProductID") %>' /> <br /> Brand: <asp:Label ID="BrandLabel" runat="server" ForeColor="#CC6600" Text='<%# Eval("Brand") %>' /> <br /> Color: <asp:Label ID="ColorLabel" runat="server" ForeColor="#CC6600" Text='<%# Eval("Color") %>' /> <br /> OriginalPrice: <asp:Label ID="lbldollar" runat="server" ForeColor="Red" Text="$"></asp:Label> <asp:Label ID="OriginalPriceLabel" runat="server" ForeColor="#CC6600" Text='<%# Eval("OriginalPrice") %>' Font-Strikeout="True" /> <br /> Percent Offer: <asp:Label ID="OfferLabel" runat="server" ForeColor="#CC6600" Text='<%# Eval("Offer") %>' /> <asp:Label ID="lblpercent" runat="server" ForeColor="Red" Text="%"></asp:Label> <br /> Offer Price: <asp:Label ID="lbldollar0" runat="server" ForeColor="Red" Text="$"></asp:Label> <asp:Label ID="FinialPriceLabel" runat="server" ForeColor="#CC6600" Text='<%# Eval("FinialPrice") %>' /> <br /> Specifications:<br /> <asp:Label ID="SpecificationsLabel" runat="server" ForeColor="#CC6600" Text='<%# Eval("Specifications") %>' /> <br /> </td> </tr> <tr><td> <asp:ImageButton ID="btnAddCart" runat="server" ImageUrl="~/images/add cart.jpg" style="height: 23px" /> </td></tr> </caption>
CommandName="AddToCart"
150100000698
</caption> </table> </ItemTemplate> </asp:DataList> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [ProductID], [ProductName], [Brand], [Color], [Specifications], [OriginalPrice], [Offer], [FinialPrice], [Image] FROM [CarSeatTable]"> </asp:SqlDataSource> </td> </tr> </table> </asp:Content>
vb code
Imports System.Data.SqlClient Partial Public Class CarSeatPage Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Private Sub DataList1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList1.ItemCommand Dim currentUser As MembershipUser = Membership.GetUser() Dim currentUserId As Guid = CType(currentUser.ProviderUserKey, Guid) Dim Order As String = DataList1.SelectedIndex Order = e.Item.ItemIndex Dim Item_ID As String = DirectCast(DataList1.Items(Order).FindControl("ProductNameLabel"), Label).Text Dim Item_Price As String = DirectCast(DataList1.Items(Order).FindControl("FinialPriceLabel"), Label).Text If MsgBox("Would you like to add this to cart?", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Add To Cart?") = MsgBoxResult.No Then Exit Sub End If If e.CommandName = "AddToCart" Then Dim connectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim insertSql As String = "INSERT INTO Checkout(Checkout_ID, Quantity, Price, UserId) VALUES (@Checkout_ID, @Quantity, @Price, @UserId)" Using myConnection As New SqlConnection(connectionString)
150100000698
myConnection.Open() Dim myCommand As New SqlCommand(insertSql, myConnection) myCommand.Parameters.AddWithValue("@Checkout_ID", Item_ID.ToString) myCommand.Parameters.AddWithValue("@Quantity", "1") myCommand.Parameters.AddWithValue("@Price", Item_Price.ToString) myCommand.Parameters.AddWithValue("@UserId", currentUserId.ToString) myCommand.ExecuteNonQuery() myConnection.Close() End Using End If End Sub Private Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DataList1.ItemDataBound Dim membershipUser As MembershipUser = Membership.GetUser() Dim BT As ImageButton = TryCast(e.Item.FindControl("btnAddCart"), ImageButton) If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
150100000698
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Webpages/MasterDesign.Master" CodeBehind="StrollerPage.aspx.vb" Inherits="BabyAge.StrollerPage" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <table style="width: 614px"> <tr> <td class="style8"> </td> </tr> <tr> <td class="style8"> <asp:Label ID="lblStroller" runat="server" FontSize="Larger" ForeColor="#CC6600" Text="Stroller"></asp:Label> </td> </tr> <tr> <td class="style8"> <asp:DataList ID="DataList1" runat="server" CellPadding="4" DataKeyField="ProductID" DataSourceID="SqlDataSource1" ForeColor="#333333" RepeatColumns="2"> <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <AlternatingItemStyle BackColor="White" /> <ItemStyle BackColor="#FFFBD6" ForeColor="#333333" /> <SeparatorStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" /> <SelectedItemStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /> <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <ItemTemplate> <table><tr><td style = "width : 248px"> <asp:Label ID="ProductNameLabel" runat="server" Text='<%# Eval("ProductName") %>' /> <br /> </td></tr> <tr><td> Height="157px" Eval("Image") + ".jpg"%>' <asp:Image ID="Image1" runat="server" ImageUrl='<%#"~/images/StrollerPic/" +
Width="168px" /> <br /> ProductID: <asp:Label ID="ProductIDLabel" runat="server" Text='<%# Eval("ProductID") %>' /> <br /> Brand:
150100000698
<asp:Label ID="BrandLabel" runat="server" Text='<%# Eval("Brand") %>' /> <br /> Color: <asp:Label ID="ColorLabel" runat="server" Text='<%#
<br /> OriginalPrice: <asp:Label ID="lbldollar" runat="server" ForeColor="Red" Text="$"></asp:Label> <asp:Label ID="OriginalPriceLabel" runat="server" Text='<%# Eval("OriginalPrice") %>' FontStrikeout="True" /> <br /> Offer: <asp:Label ID="OfferLabel" runat="server" Text='<%# Eval("Offer") %>' /> <asp:Label ID="lblpercent" runat="server" ForeColor="Red" Text="%"></asp:Label> <br /> FinialPrice: <asp:Label ID="lbldollar0" runat="server" ForeColor="Red" Text="$"></asp:Label> <asp:Label ID="FinialPriceLabel" runat="server" Text='<%# Eval("FinialPrice") %>' /> <br /> Specifications:<br /> <asp:Label ID="SpecificationsLabel" runat="server" Text='<%# Eval("Specifications") %>' /> <br /> <br /> </td></tr> <tr><td> <asp:ImageButton ID="btnAddCart" runat="server" ImageUrl="~/images/add cart.jpg" CommandName="AddToCart" /> </td></tr></table> </ItemTemplate> </asp:DataList> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [ProductID], [ProductName], [Brand], [Color], [Specifications], [OriginalPrice], [Offer], [FinialPrice], [Image] FROM [Stroller]"> </asp:SqlDataSource> </td> </tr> </table> </asp:Content>
150100000698
Imports System.Data.SqlClient Partial Public Class StrollerPage Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Private Sub DataList1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList1.ItemCommand Dim currentUser As MembershipUser = Membership.GetUser() Dim currentUserId As Guid = CType(currentUser.ProviderUserKey, Guid) Dim Order As String = DataList1.SelectedIndex Order = e.Item.ItemIndex Dim Item_ID As String = DirectCast(DataList1.Items(Order).FindControl("ProductNameLabel"), Label).Text Dim Item_Price As String = DirectCast(DataList1.Items(Order).FindControl("FinialPriceLabel"), Label).Text If MsgBox("Would you like to add this to cart?", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Add To Cart?") = MsgBoxResult.No Then Exit Sub End If If e.CommandName = "AddToCart" Then Dim connectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim insertSql As String = "INSERT INTO Checkout(Checkout_ID, Quantity, Price, UserId) VALUES (@Checkout_ID, @Quantity, @Price, @UserId)" Using myConnection As New SqlConnection(connectionString) myConnection.Open() Dim myCommand As New SqlCommand(insertSql, myConnection) ' myCommand.Parameters.AddWithValue("@ID", "@ID+1") myCommand.Parameters.AddWithValue("@Checkout_ID", Item_ID.ToString) myCommand.Parameters.AddWithValue("@Quantity", "1") myCommand.Parameters.AddWithValue("@Price", Item_Price.ToString) myCommand.Parameters.AddWithValue("@UserId", currentUserId.ToString) myCommand.ExecuteNonQuery() myConnection.Close() End Using End If End Sub
150100000698
Private Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DataList1.ItemDataBound Dim membershipUser As MembershipUser = Membership.GetUser() Dim BT As ImageButton = TryCast(e.Item.FindControl("btnAddCart"), ImageButton) If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
150100000698
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Webpages/MasterDesign.Master" CodeBehind="SeatingPage.aspx.vb" Inherits="BabyAge.SeatingPage" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <table style="width: 614px"> <tr> <td class="style8"> </td> </tr> <tr> <td class="style8" align="center"> <asp:Label ID="lblSeating" runat="server" FontSize="Larger" ForeColor="#CC6600" Text="Seating"></asp:Label> </td> </tr> <tr> <td class="style8"> <asp:DataList ID="DataList1" runat="server" CellPadding="4" DataKeyField="ProductID" DataSourceID="SqlDataSource1" ForeColor="#333333" RepeatColumns="2"> <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <AlternatingItemStyle BackColor="White" /> <ItemStyle BackColor="#FFFBD6" ForeColor="#333333" /> <SeparatorStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" /> <SelectedItemStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /> <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <ItemTemplate> <table><tr><td style = "width : 248px"> <asp:Label ID="ProductNameLabel" runat="server" Text='<%# Eval("ProductName") %>' /> <br /> </td></tr> <tr><td> <asp:Image ID="Image1" runat="server" Height="157px" ImageUrl='<%#"~/images/SeatingPic/" + Eval("Image") + ".jpg"%>' Width="168px" /> <br /> ProductID: <asp:Label ID="ProductIDLabel" runat="server" Text='<%# Eval("ProductID") %>' /> <br /> Brand:
150100000698
<asp:Label ID="BrandLabel" runat="server" Text='<%# Eval("Brand") %>' /> <br /> Color: <asp:Label ID="ColorLabel" runat="server" Text='<%#
<br /> OriginalPrice: <asp:Label ID="lbldollar" runat="server" ForeColor="Red" Text="$"></asp:Label> <asp:Label ID="OriginalPriceLabel" runat="server" Text='<%# Eval("OriginalPrice") %>' /> <br /> Offer: <asp:Label ID="OfferLabel" runat="server" Text='<%# Eval("Offer") %>' /> <asp:Label ID="lblpercent" runat="server" ForeColor="Red" Text="%"></asp:Label> <br /> FinialPrice: <asp:Label ID="lbldollar0" runat="server" ForeColor="Red" Text="$"></asp:Label> <asp:Label ID="FinialPriceLabel" runat="server" Text='<%# Eval("FinialPrice") %>' /> <br /> Specifications: <br /> <asp:Label ID="SpecificationsLabel" runat="server" Text='<%# Eval("Specifications") %>' /> <br /> <br /> </td></tr> <tr><td> <asp:ImageButton ID="btnAddCart" runat="server" ImageUrl="~/images/add cart.jpg"
CommandName="AddToCart" />
</td></tr> </table> </ItemTemplate> </asp:DataList> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [ProductName], [ProductID], [Brand], [Color], [OriginalPrice], [Offer], [FinialPrice], [Specifications], [Image] FROM [SeatingTable]"> </asp:SqlDataSource> </td> </tr> </table> </asp:Content>
vb code
Imports System.Data.SqlClient
150100000698
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Private Sub DataList1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList1.ItemCommand Dim currentUser As MembershipUser = Membership.GetUser() Dim currentUserId As Guid = CType(currentUser.ProviderUserKey, Guid) Dim Order As String = DataList1.SelectedIndex Order = e.Item.ItemIndex Dim Item_ID As String = DirectCast(DataList1.Items(Order).FindControl("ProductNameLabel"), Label).Text Dim Item_Price As String = DirectCast(DataList1.Items(Order).FindControl("FinialPriceLabel"), Label).Text If MsgBox("Would you like to add this to cart?", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Add To Cart?") = MsgBoxResult.No Then Exit Sub End If If e.CommandName = "AddToCart" Then Dim connectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim insertSql As String = "INSERT INTO Checkout(Checkout_ID, Quantity, Price, UserId) VALUES (@Checkout_ID, @Quantity, @Price, @UserId)" Using myConnection As New SqlConnection(connectionString) myConnection.Open() Dim myCommand As New SqlCommand(insertSql, myConnection) ' myCommand.Parameters.AddWithValue("@ID", "@ID+1") myCommand.Parameters.AddWithValue("@Checkout_ID", Item_ID.ToString) myCommand.Parameters.AddWithValue("@Quantity", "1") myCommand.Parameters.AddWithValue("@Price", Item_Price.ToString) myCommand.Parameters.AddWithValue("@UserId", currentUserId.ToString) myCommand.ExecuteNonQuery() myConnection.Close() End Using End If End Sub Private Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DataList1.ItemDataBound
150100000698
Dim membershipUser As MembershipUser = Membership.GetUser() Dim BT As ImageButton = TryCast(e.Item.FindControl("btnAddCart"), ImageButton) If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
150100000698
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Webpages/MasterDesign.Master" CodeBehind="CarSeat_Database.aspx.vb" Inherits="BabyAge.CarSeat_Database" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> <style type="text/css"> .style8 { width: 478px; } </style> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <table style="width: 614px"> <tr><td class="style8"> <asp:Label ID="lblCarSeatInformation" runat="server" Font-Names="Arial" Font-Size="X-Large" ForeColor="#CC6600" Text="Car Seat Information"></asp:Label> </td></tr> <tr><td class="style8"> </td></tr> <tr><td class="style8"> </td></tr> <tr><td class="style8"> <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" CellPadding="2" DataKeyNames="ProductID" DataSourceID="SqlDataSource1" EmptyDataText="There are no data records to display." ForeColor="#333333" Height="186px" style="margin-right: 0px" Width="603px" FontSize="Smaller" PageSize="2"> <RowStyle BackColor="#FFFBD6" ForeColor="#333333" /> <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField DataField="ProductID" HeaderText="ProductID" ReadOnly="True" SortExpression="ProductID" /> <asp:BoundField DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" /> <asp:BoundField DataField="Brand" HeaderText="Brand" SortExpression="Brand" /> <asp:BoundField DataField="OriginalPrice" HeaderText="OriginalPrice" SortExpression="OriginalPrice" /> <asp:BoundField DataField="Offer" HeaderText="Offer" SortExpression="Offer" />
150100000698
<asp:BoundField DataField="FinialPrice" HeaderText="FinialPrice" SortExpression="FinialPrice" /> <asp:BoundField DataField="Color" HeaderText="Color" SortExpression="Color" /> <asp:BoundField DataField="Specifications" HeaderText="Specifications" SortExpression="Specifications" /> <asp:BoundField DataField="Image" HeaderText="Image" SortExpression="Image" /> </Columns> <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /> <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="White" /> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [CarSeatTable] WHERE [ProductID] = @ProductID" InsertCommand="INSERT INTO [CarSeatTable] ([ProductID], [ProductName], [Brand], [Color], [Specifications], [OriginalPrice], [Offer], [FinialPrice], [Image]) VALUES (@ProductID, @ProductName, @Brand, @Color, @Specifications, @OriginalPrice, @Offer, @FinialPrice, @Image)" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT [ProductID], [ProductName], [Brand], [Color], [Specifications], [OriginalPrice], [Offer], [FinialPrice], [Image] FROM [CarSeatTable]" UpdateCommand="UPDATE [CarSeatTable] SET [ProductName] = @ProductName, [Brand] = @Brand, [Color] = @Color, [Specifications] = @Specifications, [OriginalPrice] = @OriginalPrice, [Offer] = @Offer, [FinialPrice] = @FinialPrice, [Image] = @Image WHERE [ProductID] = @ProductID"> <DeleteParameters> <asp:Parameter Name="ProductID" Type="String" /> </DeleteParameters> <InsertParameters> <asp:Parameter Name="ProductID" Type="String" /> <asp:Parameter Name="ProductName" Type="String" /> <asp:Parameter Name="Brand" Type="String" /> <asp:Parameter Name="Color" Type="String" /> <asp:Parameter Name="Specifications" Type="String" /> <asp:Parameter Name="OriginalPrice" Type="String" /> <asp:Parameter Name="Offer" Type="String" /> <asp:Parameter Name="FinialPrice" Type="String" /> <asp:Parameter Name="Image" Type="String" /> </InsertParameters> <UpdateParameters> <asp:Parameter Name="ProductName" Type="String" /> <asp:Parameter Name="Brand" Type="String" /> <asp:Parameter Name="Color" Type="String" /> <asp:Parameter Name="Specifications" Type="String" />
150100000698
<asp:Parameter Name="OriginalPrice" Type="String" /> <asp:Parameter Name="Offer" Type="String" /> <asp:Parameter Name="FinialPrice" Type="String" /> <asp:Parameter Name="Image" Type="String" /> <asp:Parameter Name="ProductID" Type="String" /> </UpdateParameters> </asp:SqlDataSource> </td></tr> <tr><td align = "left" class="style8" > <asp:Label ID="lblProductID" runat="server" Text="Product ID: "></asp:Label> <asp:TextBox ID="txtProductID" runat="server"></asp:TextBox> </td></tr> <tr align = "left"><td class="style8"> <asp:Label ID="lblProductName" runat="server" Text="Product Name: "></asp:Label> <asp:TextBox ID="txtProductName" runat="server" Width="208px"></asp:TextBox> </td></tr> <tr align = "left"><td class="style8"> <asp:Label ID="lblBrand" runat="server" Text="Brand: "></asp:Label> <asp:TextBox ID="txtBrand" runat="server"></asp:TextBox> </td></tr> <tr align = "left"><td class="style8"> <asp:Label ID="lblOriginalPrice" runat="server" Text="Original Price: "></asp:Label> <asp:TextBox ID="txtOriginalPrice" runat="server"></asp:TextBox> </td></tr> <tr align = "left"><td class="style8"> <asp:Label ID="lblOffer" runat="server" Text="Percent Offer: "></asp:Label> <asp:TextBox ID="txtOffer" runat="server" Width="102px"></asp:TextBox> <asp:Label ID="Label2" runat="server" Font-Size="Larger" ForeColor="Red" Text="%"></asp:Label> </td></tr> <tr align = "left"><td class="style8"> <asp:Label ID="lblFinialPrice" runat="server" Text="Offer Price: "></asp:Label> <asp:TextBox ID="txtFinialPrice" runat="server" Width="132px"></asp:TextBox> <asp:Button ID="Button3" runat="server" Text="Calculate" Width="68px" /> </td></tr> <tr align = "left"><td class="style8">
150100000698
<asp:Label ID="lblColor" runat="server" Text="Color: "></asp:Label> <asp:TextBox ID="txtColor" runat="server" Width="208px"></asp:TextBox> </td></tr> <tr align = "left"><td class="style8" valign="middle"> <asp:Label ID="lblSpecifications" runat="server" Text="Specifications: "></asp:Label> <asp:TextBox ID="txtSpecifications" runat="server" TextMode="MultiLine" Width="213px" Height="83px"></asp:TextBox> </td></tr> <tr align = "left"><td class="style8"> <asp:Label ID="lblImage" runat="server" Text="Image: "></asp:Label> <asp:FileUpload ID="FileUpload1" runat="server" /> </td></tr> <tr align = "left"><td class="style8"> Record" <asp:Label ID="lblInsertNewRecord" runat="server" Text="Insert New ForeColor="#CC6600"></asp:Label> </td></tr> <tr align = "left"><td class="style8"> <asp:Button ID="btnAdd" runat="server" Text="Add" Width="94px" /> <asp:Button ID="btnSave" runat="server" Text="Save" Width="94px" /> <asp:Button ID="btnClear" runat="server" Text="Cancel" Width="94px" /> </td></tr> <tr align = "left"><td class="style8"> <asp:Label ID="lblUpdateExistingRecord" runat="server" ForeColor="#CC6600" Text="Update Existing Record"></asp:Label> </td></tr> <tr align = "left"><td class="style8" > <asp:Button ID="btnEdit" runat="server" Text="Edit" Width="94px"/> <asp:Button ID="btnUpdate" runat="server" Text="Save" Width="94px"/> <asp:Button ID="btnCancel" runat="server" Text="Cancel" Width="94px"/> </td></tr> <tr align = "left"><td class="style8"> <asp:Label ID="lblDeleteExistingRecord" runat="server" ForeColor="#CC6600" Text="Delete Existing Record"></asp:Label> </td></tr> <tr align = "left"><td class="style8"> <asp:Button ID="btnDelete" runat="server" Text="Delete" Width="94px" />
150100000698
<asp:Button ID="btnCancelDelete" runat="server" Text="Cancel" Width="94px"/> </td></tr> <tr><td class="style8" align="right"> <asp:Button ID="Button4" runat="server" Text="Back to main menu" PostBackUrl="~/Webpages/Database Form.aspx" Width="160px" />
vb code
Imports System Imports System.Data Imports System.Configuration Imports System.Web Imports System.Web.Security Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.WebParts Imports System.Web.UI.HtmlControls Imports System.Data.SqlClient Partial Public Class CarSeat_Database Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'Disable the textbox txtProductID.Enabled = False txtBrand.Enabled = False txtColor.Enabled = False txtFinialPrice.Enabled = False txtOffer.Enabled = False txtOriginalPrice.Enabled = False txtProductName.Enabled = False txtSpecifications.Enabled = False FileUpload1.Enabled = False 'Disable the button btnEdit.Enabled = False btnUpdate.Enabled = False btnClear.Enabled = False btnCancel.Enabled = False btnDelete.Enabled = False btnCancelDelete.Enabled = False 'btnClearSearch.Enabled = False End Sub Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSave.Click Dim strMessage As String = ""
150100000698
Dim imgup As FileUpload = FileUpload1 Dim fileNameWithoutExtension As String = System.IO.Path.GetFileNameWithoutExtension(imgup.FileName) If MsgBox("Do You Want To Save This Record?", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Save") = MsgBoxResult.No Then btnSave.Enabled = False btnClear.Enabled = False btnAdd.Enabled = True GridView1.DataBind() Exit Sub End If 'This will show error message if a user does not key in a character If txtProductID.Text = String.Empty Then strMessage = "Product No is blank. Please fill in." End If If txtProductName.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Product Name is blank. Please fill in." Else strMessage += "Product Name is blank. Please fill in." End If End If If txtBrand.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Brand is blank. Please fill in." Else strMessage += "Brand is blank. Please fill in." End If End If If txtOriginalPrice.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Original Price is blank. Please fill in." Else strMessage += "Original Price is blank. Please fill in." End If End If If txtColor.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Color is blank. Please fill in." Else strMessage += "Color is blank. Please fill in." End If End If If txtSpecifications.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Specifications is blank. Please fill in."
150100000698
strMessage += "Specifications is blank. Please fill in." End If End If If strMessage <> "" Then MsgBox(strMessage) Exit Sub End If If imgup.HasFile = False Then fileNameWithoutExtension = "Not Available!" End If Dim connectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim insertSql As String = "INSERT INTO CarSeatTable(ProductID, ProductName, Brand, Color, Specifications, OriginalPrice, Offer, FinialPrice, Image) VALUES (@ProductID, @ProductName, @Brand, @Color, @Specifications, @OriginalPrice, @Offer, @FinialPrice, @Image)" Using myConnection As New SqlConnection(connectionString) myConnection.Open() Dim myCommand As New SqlCommand(insertSql, myConnection) myCommand.Parameters.AddWithValue("@ProductID", txtProductID.Text) myCommand.Parameters.AddWithValue("@ProductName", txtProductName.Text) myCommand.Parameters.AddWithValue("@Brand", txtBrand.Text) myCommand.Parameters.AddWithValue("@Color", txtColor.Text) myCommand.Parameters.AddWithValue("@Specifications", txtSpecifications.Text) myCommand.Parameters.AddWithValue("@OriginalPrice", txtOriginalPrice.Text) myCommand.Parameters.AddWithValue("@Offer", txtOffer.Text) myCommand.Parameters.AddWithValue("@FinialPrice", txtFinialPrice.Text) myCommand.Parameters.AddWithValue("@Image", fileNameWithoutExtension.ToString()) myCommand.ExecuteNonQuery() myConnection.Close() End Using 'Inform the user that a record has been save MsgBox("A New Record Has Successfully Been Inserted", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation, "Success!") 'Clear the textbox txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty
150100000698
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click 'Clear the textbox txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty 'Enable the textbox txtProductID.Enabled = True txtProductName.Enabled = True txtBrand.Enabled = True txtColor.Enabled = True txtFinialPrice.Enabled = True txtOffer.Enabled = True txtOriginalPrice.Enabled = True txtSpecifications.Enabled = True FileUpload1.Enabled = True btnSave.Enabled = True btnClear.Enabled = True btnAdd.Enabled = False End Sub Protected Sub Gridview1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles GridView1.SelectedIndexChanged txtProductID.Text = GridView1.SelectedRow.Cells(1).Text txtProductName.Text = GridView1.SelectedRow.Cells(2).Text txtBrand.Text = GridView1.SelectedRow.Cells(3).Text txtColor.Text = GridView1.SelectedRow.Cells(7).Text txtOriginalPrice.Text = GridView1.SelectedRow.Cells(4).Text txtOffer.Text = GridView1.SelectedRow.Cells(5).Text txtFinialPrice.Text = GridView1.SelectedRow.Cells(6).Text txtSpecifications.Text = GridView1.SelectedRow.Cells(8).Text 'lblOldValue.Text = GridView1.SelectedRow.Cells(11).Text 'Enable the Edit button and Delete button but Disable the btnUpdate btnEdit.Enabled = True btnUpdate.Enabled = False btnDelete.Enabled = True btnCancelDelete.Enabled = True
150100000698
Protected Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdate.Click If MsgBox("Do You Want To Save This Record?", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Update!") = MsgBoxResult.No Then btnEdit.Enabled = True btnUpdate.Enabled = False btnDelete.Enabled = True Exit Sub End If Dim imgup As FileUpload = FileUpload1 Dim fileNameWithoutExtension As String = System.IO.Path.GetFileNameWithoutExtension(imgup.FileName) 'If imgup.HasFile = False Then 'fileNameWithoutExtension = lblOldValue.Text 'End If Dim connectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim UpdateSql As String = "UPDATE CarSeatTable SET ProductName = @ProductName, Brand = @Brand, Color = @Color, Specifications = @Specifications, OriginalPrice = @OriginalPrice, Offer = @Offer, FinialPrice = @FinialPrice, Image = @Image WHERE ProductID = @ProductID" Using myConnection As New SqlConnection(connectionString) myConnection.Open() Dim myCommand As New SqlCommand(UpdateSql, myConnection) myCommand.Parameters.AddWithValue("@ProductID", txtProductID.Text) myCommand.Parameters.AddWithValue("@ProductName", txtProductName.Text) myCommand.Parameters.AddWithValue("@Brand", txtBrand.Text) myCommand.Parameters.AddWithValue("@Color", txtColor.Text) myCommand.Parameters.AddWithValue("@Specifications", txtSpecifications.Text) myCommand.Parameters.AddWithValue("@OriginalPrice", txtOriginalPrice.Text) myCommand.Parameters.AddWithValue("@Offer", txtOffer.Text)
150100000698
myCommand.Parameters.AddWithValue("@FinialPrice", txtFinialPrice.Text) myCommand.Parameters.AddWithValue("@Image", fileNameWithoutExtension.ToString()) myCommand.ExecuteNonQuery() myConnection.Close() End Using 'Informs the user that the a record has been save MsgBox("Record Has Successfully Been Updated", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation, "Success!") GridView1.DataBind() 'Clear the textbox txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty 'Enable and Disable the Add button btnAdd.Enabled = True btnSave.Enabled = False btnClear.Enabled = False End Sub Protected Sub btnClear_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnClear.Click 'Clear the textboxes txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty 'Disable the textboxes txtProductID.Enabled = False txtProductName.Enabled = False txtBrand.Enabled = False txtColor.Enabled = False txtFinialPrice.Enabled = False txtOffer.Enabled = False txtOriginalPrice.Enabled = False txtSpecifications.Enabled = False FileUpload1.Enabled = False 'Disable Edit button btnEdit.Enabled = False btnUpdate.Enabled = False btnCancel.Enabled = False
150100000698
Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click 'Clear the textboxes txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty 'Disable the textboxes txtProductID.Enabled = False txtProductName.Enabled = False txtBrand.Enabled = False txtColor.Enabled = False txtFinialPrice.Enabled = False txtOffer.Enabled = False txtOriginalPrice.Enabled = False txtSpecifications.Enabled = False FileUpload1.Enabled = False 'Disable Edit button btnEdit.Enabled = False btnUpdate.Enabled = False btnCancel.Enabled = False 'Disable Delete button btnDelete.Enabled = False 'Enable and Disable the Add button btnAdd.Enabled = True btnSave.Enabled = False btnClear.Enabled = False End Sub Protected Sub btnDelete_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnDelete.Click Dim imgup As FileUpload = FileUpload1 Dim fileNameWithoutExtension As String = System.IO.Path.GetFileNameWithoutExtension(imgup.FileName) If MsgBox("Do You Want To Delete This Record?", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Delete?") = MsgBoxResult.No Then btnDelete.Enabled = True btnEdit.Enabled = True Exit Sub End If
150100000698
If imgup.HasFile = False Then fileNameWithoutExtension = "Not Available!" End If Dim connectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim deleteSql As String = "DELETE FROM CarSeatTable WHERE ProductID = @ProductID" Using myConnection As New SqlConnection(connectionString) myConnection.Open() Dim myCommand As New SqlCommand(deleteSql, myConnection) myCommand.Parameters.AddWithValue("@ProductID", txtProductID.Text) myCommand.ExecuteNonQuery() myConnection.Close() End Using 'Informs the user that the a record has been save MsgBox("Record Has Been Deleted.", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation, "Success!") GridView1.DataBind() 'Clear the textboxes txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty 'Disable the textboxes txtProductID.Enabled = False txtProductName.Enabled = False txtBrand.Enabled = False txtColor.Enabled = False txtFinialPrice.Enabled = False txtOffer.Enabled = False txtOriginalPrice.Enabled = False txtSpecifications.Enabled = False FileUpload1.Enabled = False 'Disable Edit button btnEdit.Enabled = False btnUpdate.Enabled = False btnCancel.Enabled = False 'Disable Delete button btnDelete.Enabled = False 'Enable and Disable the Add button btnAdd.Enabled = True btnSave.Enabled = False btnClear.Enabled = False
150100000698
End Sub Protected Sub btnEdit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnEdit.Click 'Enable the textbox txtProductID.Enabled = True txtProductName.Enabled = True txtBrand.Enabled = True txtColor.Enabled = True txtFinialPrice.Enabled = True txtOffer.Enabled = True txtOriginalPrice.Enabled = True txtSpecifications.Enabled = True FileUpload1.Enabled = True 'Enable and Disable the Save button btnEdit.Enabled = False btnUpdate.Enabled = True btnCancel.Enabled = True 'Disable the Add button btnAdd.Enabled = False btnSave.Enabled = False btnClear.Enabled = False End Sub Protected Sub btnCancelDelete_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancelDelete.Click btnAdd.Enabled = True btnDelete.Enabled = False btnEdit.Enabled = False 'Clear the textboxes txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty 'Disable the textboxes txtProductID.Enabled = False txtProductName.Enabled = False txtBrand.Enabled = False txtColor.Enabled = False txtFinialPrice.Enabled = False txtOffer.Enabled = False txtOriginalPrice.Enabled = False txtSpecifications.Enabled = False FileUpload1.Enabled = False 'Disable Edit button btnEdit.Enabled = False btnUpdate.Enabled = False btnCancel.Enabled = False 'Disable Delete button
150100000698
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button3.Click txtFinialPrice.Text = txtOriginalPrice.Text * (1 - txtOffer.Text / 100) 'Enable the textbox txtProductID.Enabled = True txtProductName.Enabled = True txtBrand.Enabled = True txtColor.Enabled = True txtFinialPrice.Enabled = True txtOffer.Enabled = True txtOriginalPrice.Enabled = True txtSpecifications.Enabled = True FileUpload1.Enabled = True 'Enable the Add button btnAdd.Enabled = False btnSave.Enabled = True btnClear.Enabled = True 'Disable and enable Edit button btnEdit.Enabled = False btnUpdate.Enabled = True btnCancel.Enabled = True End Sub End Class
150100000698
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Webpages/MasterDesign.Master" CodeBehind="Stroller_Database.aspx.vb" Inherits="BabyAge.Stroller_Database" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> <style type="text/css"> .style8 { width: 478px; } </style> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <table style="width: 614px"> <tr> <td class="style8"> <asp:Label ID="lblStrollerInformation" runat="server" Font-Names="Arial" Font-Size="X-Large" ForeColor="#CC6600" Text="Stroller Information"></asp:Label> </td> </tr> <tr> <td class="style8"> </td> </tr> <tr> <td class="style8"> </td> </tr> <tr> <td class="style8"> <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" CellPadding="2" DataKeyNames="ProductID" DataSourceID="SqlDataSource1" EmptyDataText="There are no data records to display." ForeColor="#333333" Height="186px" style="margin-right: 0px" Width="603px" FontSize="Smaller" PageSize="2"> <RowStyle BackColor="#FFFBD6" ForeColor="#333333" /> <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField DataField="ProductID" HeaderText="ProductID" ReadOnly="True" SortExpression="ProductID" /> <asp:BoundField DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" />
150100000698
<asp:BoundField DataField="Brand" HeaderText="Brand" SortExpression="Brand" /> <asp:BoundField DataField="OriginalPrice" HeaderText="OriginalPrice" SortExpression="OriginalPrice" /> <asp:BoundField DataField="Offer" HeaderText="Offer" SortExpression="Offer" /> <asp:BoundField DataField="FinialPrice" HeaderText="FinialPrice" SortExpression="FinialPrice" /> <asp:BoundField DataField="Color" HeaderText="Color" SortExpression="Color" /> <asp:BoundField DataField="Specifications" HeaderText="Specifications" SortExpression="Specifications" /> <asp:BoundField DataField="Image" HeaderText="Image" SortExpression="Image" /> </Columns> <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /> <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="White" /> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT [ProductID], [ProductName], [Brand], [OriginalPrice], [Offer], [FinialPrice], [Color], [Specifications], [Image] FROM [Stroller]"> </asp:SqlDataSource> </td> </tr> <tr> <td align = "left" class="style8" > <asp:Label ID="lblProductID" runat="server" Text="Product ID: "></asp:Label> <asp:TextBox ID="txtProductID" runat="server"></asp:TextBox> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblProductName" runat="server" Text="Product Name: "></asp:Label> <asp:TextBox ID="txtProductName" runat="server" Width="208px"></asp:TextBox> </td> </tr> <tr align = "left"> <td class="style8">
150100000698
<asp:Label ID="lblBrand" runat="server" Text="Brand: "></asp:Label> <asp:TextBox ID="txtBrand" runat="server"></asp:TextBox> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblOriginalPrice" runat="server" Text="Original Price: "></asp:Label> <asp:TextBox ID="txtOriginalPrice" runat="server"></asp:TextBox> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblOffer" runat="server" Text="Percent Offer: "></asp:Label> <asp:TextBox ID="txtOffer" runat="server" Width="102px"></asp:TextBox> <asp:Label ID="Label2" runat="server" Font-Size="Larger" ForeColor="Red" Text="%"></asp:Label> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblFinialPrice" runat="server" Text="Offer Price: "></asp:Label> <asp:TextBox ID="txtFinialPrice" runat="server" Width="132px"></asp:TextBox> <asp:Button ID="Button3" runat="server" Text="Calculate" Width="68px" /> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblColor" runat="server" Text="Color: "></asp:Label> <asp:TextBox ID="txtColor" runat="server" Width="208px"></asp:TextBox> </td> </tr> <tr align = "left"> <td class="style8" valign="middle"> <asp:Label ID="lblSpecifications" runat="server" Text="Specifications: "></asp:Label> <asp:TextBox ID="txtSpecifications" runat="server" TextMode="MultiLine" Width="213px" Height="83px"></asp:TextBox> </td>
150100000698
</tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblImage" runat="server" Text="Image: "></asp:Label> <asp:FileUpload ID="FileUpload1" runat="server" /> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblInsertNewRecord" runat="server" Text="Insert New Record" ForeColor="#CC6600"></asp:Label> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Button ID="btnAdd" runat="server" Text="Add" Width="94px" /> <asp:Button ID="btnSave" runat="server" Text="Save" Width="94px" /> <asp:Button ID="btnClear" runat="server" Text="Cancel" Width="94px" /> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblUpdateExistingRecord" runat="server" ForeColor="#CC6600" Text="Update Existing Record"></asp:Label> </td> </tr> <tr align = "left"> <td class="style8" > <asp:Button ID="btnEdit" runat="server" Text="Edit" Width="94px"/> <asp:Button ID="btnUpdate" runat="server" Text="Save" Width="94px"/> <asp:Button ID="btnCancel" runat="server" Text="Cancel" Width="94px"/> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblDeleteExistingRecord" runat="server" ForeColor="#CC6600" Text="Delete Existing Record"></asp:Label> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Button ID="btnDelete" runat="server" Text="Delete" Width="94px" />
150100000698
<asp:Button ID="btnCancelDelete" runat="server" Text="Cancel" Width="94px"/> </td> </tr> <tr><td class="style8" align="right"> <asp:Button ID="Button4" runat="server" Text="Back to main menu" PostBackUrl="~/Webpages/Database Form.aspx" Width="160px" />
vb code
Imports System Imports System.Data Imports System.Configuration Imports System.Web Imports System.Web.Security Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.WebParts Imports System.Web.UI.HtmlControls Imports System.Data.SqlClient Partial Public Class Stroller_Database Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'Disable the textbox txtProductID.Enabled = False txtBrand.Enabled = False txtColor.Enabled = False txtFinialPrice.Enabled = False txtOffer.Enabled = False txtOriginalPrice.Enabled = False txtProductName.Enabled = False txtSpecifications.Enabled = False FileUpload1.Enabled = False 'Disable the button btnEdit.Enabled = False btnUpdate.Enabled = False btnClear.Enabled = False btnCancel.Enabled = False btnDelete.Enabled = False btnCancelDelete.Enabled = False 'btnClearSearch.Enabled = False End Sub Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSave.Click Dim strMessage As String = "" Dim imgup As FileUpload = FileUpload1
150100000698
Dim fileNameWithoutExtension As String = System.IO.Path.GetFileNameWithoutExtension(imgup.FileName) If MsgBox("Do You Want To Save This Record?", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Save") = MsgBoxResult.No Then btnSave.Enabled = False btnClear.Enabled = False btnAdd.Enabled = True GridView1.DataBind() Exit Sub End If 'This will show error message if a user does not key in a character If txtProductID.Text = String.Empty Then strMessage = "Product No is blank. Please fill in." End If If txtProductName.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Product Name is blank. Please fill strMessage += "Product Name is blank. Please fill in." End If End If If txtBrand.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Brand is blank. Please fill in." Else strMessage += "Brand is blank. Please fill in." End If End If If txtOriginalPrice.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Original Price is blank. Please fill in." Else strMessage += "Original Price is blank. Please fill in." End If End If If txtColor.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Color is blank. Please fill in." Else strMessage += "Color is blank. Please fill in." End If End If If txtSpecifications.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Specifications is blank. Please fill in." Else Else
in."
150100000698
strMessage += "Specifications is blank. Please fill in." End If End If If strMessage <> "" Then MsgBox(strMessage) Exit Sub End If If imgup.HasFile = False Then fileNameWithoutExtension = "Not Available!" End If Dim connectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim insertSql As String = "INSERT INTO Stroller(ProductID, ProductName, Brand, Color, Specifications, OriginalPrice, Offer, FinialPrice, Image) VALUES (@ProductID, @ProductName, @Brand, @Color, @Specifications, @OriginalPrice, @Offer, @FinialPrice, @Image)" Using myConnection As New SqlConnection(connectionString) myConnection.Open() Dim myCommand As New SqlCommand(insertSql, myConnection) myCommand.Parameters.AddWithValue("@ProductID", txtProductID.Text) myCommand.Parameters.AddWithValue("@ProductName", txtProductName.Text) myCommand.Parameters.AddWithValue("@Brand", txtBrand.Text) myCommand.Parameters.AddWithValue("@Color", txtColor.Text) myCommand.Parameters.AddWithValue("@Specifications", txtSpecifications.Text) myCommand.Parameters.AddWithValue("@OriginalPrice", txtOriginalPrice.Text) myCommand.Parameters.AddWithValue("@Offer", txtOffer.Text) myCommand.Parameters.AddWithValue("@FinialPrice", txtFinialPrice.Text) myCommand.Parameters.AddWithValue("@Image", fileNameWithoutExtension.ToString()) myCommand.ExecuteNonQuery() myConnection.Close() End Using 'Inform the user that a record has been save MsgBox("A New Record Has Successfully Been Inserted", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation, "Success!") 'Clear the textbox txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty
150100000698
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click 'Clear the textbox txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty 'Enable the textbox txtProductID.Enabled = True txtProductName.Enabled = True txtBrand.Enabled = True txtColor.Enabled = True txtFinialPrice.Enabled = True txtOffer.Enabled = True txtOriginalPrice.Enabled = True txtSpecifications.Enabled = True FileUpload1.Enabled = True btnSave.Enabled = True btnClear.Enabled = True btnAdd.Enabled = False End Sub Protected Sub Gridview1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles GridView1.SelectedIndexChanged txtProductID.Text = GridView1.SelectedRow.Cells(1).Text txtProductName.Text = GridView1.SelectedRow.Cells(2).Text txtBrand.Text = GridView1.SelectedRow.Cells(3).Text txtColor.Text = GridView1.SelectedRow.Cells(7).Text txtOriginalPrice.Text = GridView1.SelectedRow.Cells(4).Text txtOffer.Text = GridView1.SelectedRow.Cells(5).Text txtFinialPrice.Text = GridView1.SelectedRow.Cells(6).Text txtSpecifications.Text = GridView1.SelectedRow.Cells(8).Text 'lblOldValue.Text = GridView1.SelectedRow.Cells(11).Text 'Enable the Edit button and Delete button but Disable the btnUpdate btnEdit.Enabled = True btnUpdate.Enabled = False btnDelete.Enabled = True btnCancelDelete.Enabled = True 'Disable the Add button
150100000698
Protected Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdate.Click If MsgBox("Do You Want To Save This Record?", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Update!") = MsgBoxResult.No Then btnEdit.Enabled = True btnUpdate.Enabled = False btnDelete.Enabled = True Exit Sub End If Dim imgup As FileUpload = FileUpload1 Dim fileNameWithoutExtension As String = System.IO.Path.GetFileNameWithoutExtension(imgup.FileName) 'If imgup.HasFile = False Then 'fileNameWithoutExtension = lblOldValue.Text 'End If Dim connectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim UpdateSql As String = "UPDATE Stroller SET ProductName = @ProductName, Brand = @Brand, Color = @Color, Specifications = @Specifications, OriginalPrice = @OriginalPrice, Offer = @Offer, FinialPrice = @FinialPrice, Image = @Image WHERE ProductID = @ProductID" Using myConnection As New SqlConnection(connectionString) myConnection.Open() Dim myCommand As New SqlCommand(UpdateSql, myConnection) myCommand.Parameters.AddWithValue("@ProductID", txtProductID.Text) myCommand.Parameters.AddWithValue("@ProductName", txtProductName.Text) myCommand.Parameters.AddWithValue("@Brand", txtBrand.Text) myCommand.Parameters.AddWithValue("@Color", txtColor.Text) myCommand.Parameters.AddWithValue("@Specifications", txtSpecifications.Text) myCommand.Parameters.AddWithValue("@OriginalPrice", txtOriginalPrice.Text) myCommand.Parameters.AddWithValue("@Offer", txtOffer.Text) myCommand.Parameters.AddWithValue("@FinialPrice", txtFinialPrice.Text)
150100000698
myCommand.Parameters.AddWithValue("@Image", fileNameWithoutExtension.ToString()) myCommand.ExecuteNonQuery() myConnection.Close() End Using 'Informs the user that the a record has been save MsgBox("Record Has Successfully Been Updated", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation, "Success!") GridView1.DataBind() 'Clear the textbox txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty End Sub Protected Sub btnClear_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnClear.Click 'Clear the textboxes txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty 'Disable the textboxes txtProductID.Enabled = False txtProductName.Enabled = False txtBrand.Enabled = False txtColor.Enabled = False txtFinialPrice.Enabled = False txtOffer.Enabled = False txtOriginalPrice.Enabled = False txtSpecifications.Enabled = False FileUpload1.Enabled = False 'Disable Edit button btnEdit.Enabled = False btnUpdate.Enabled = False btnCancel.Enabled = False 'Disable Delete button btnDelete.Enabled = False 'Enable and Disable the Add button btnAdd.Enabled = True btnSave.Enabled = False
150100000698
Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click 'Clear the textboxes txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty 'Disable the textboxes txtProductID.Enabled = False txtProductName.Enabled = False txtBrand.Enabled = False txtColor.Enabled = False txtFinialPrice.Enabled = False txtOffer.Enabled = False txtOriginalPrice.Enabled = False txtSpecifications.Enabled = False FileUpload1.Enabled = False 'Disable Edit button btnEdit.Enabled = False btnUpdate.Enabled = False btnCancel.Enabled = False 'Disable Delete button btnDelete.Enabled = False 'Enable and Disable the Add button btnAdd.Enabled = True btnSave.Enabled = False btnClear.Enabled = False End Sub Protected Sub btnDelete_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnDelete.Click Dim imgup As FileUpload = FileUpload1 Dim fileNameWithoutExtension As String = System.IO.Path.GetFileNameWithoutExtension(imgup.FileName) If MsgBox("Do You Want To Delete This Record?", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Delete?") = MsgBoxResult.No Then btnDelete.Enabled = True btnEdit.Enabled = True Exit Sub End If If imgup.HasFile = False Then fileNameWithoutExtension = "Not Available!" End If
150100000698
Dim connectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim deleteSql As String = "DELETE FROM Stroller WHERE ProductID = @ProductID" Using myConnection As New SqlConnection(connectionString) myConnection.Open() Dim myCommand As New SqlCommand(deleteSql, myConnection) myCommand.Parameters.AddWithValue("@ProductID", txtProductID.Text) myCommand.ExecuteNonQuery() myConnection.Close() End Using 'Informs the user that the a record has been save MsgBox("Record Has Been Deleted.", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation, "Success!") GridView1.DataBind() 'Clear the textboxes txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty 'Disable the textboxes txtProductID.Enabled = False txtProductName.Enabled = False txtBrand.Enabled = False txtColor.Enabled = False txtFinialPrice.Enabled = False txtOffer.Enabled = False txtOriginalPrice.Enabled = False txtSpecifications.Enabled = False FileUpload1.Enabled = False 'Disable Edit button btnEdit.Enabled = False btnUpdate.Enabled = False btnCancel.Enabled = False 'Disable Delete button btnDelete.Enabled = False 'Enable and Disable the Add button btnAdd.Enabled = True btnSave.Enabled = False btnClear.Enabled = False End Sub Protected Sub btnEdit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnEdit.Click 'Enable the textbox
150100000698
'Disable the Add button btnAdd.Enabled = False btnSave.Enabled = False btnClear.Enabled = False End Sub Protected Sub btnCancelDelete_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancelDelete.Click btnAdd.Enabled = True btnDelete.Enabled = False btnEdit.Enabled = False 'Clear the textboxes txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty 'Disable the textboxes txtProductID.Enabled = False txtProductName.Enabled = False txtBrand.Enabled = False txtColor.Enabled = False txtFinialPrice.Enabled = False txtOffer.Enabled = False txtOriginalPrice.Enabled = False txtSpecifications.Enabled = False FileUpload1.Enabled = False 'Disable Edit button btnEdit.Enabled = False btnUpdate.Enabled = False btnCancel.Enabled = False 'Disable Delete button btnDelete.Enabled = False 'Enable and Disable the Add button btnAdd.Enabled = True btnSave.Enabled = False
150100000698
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button3.Click txtFinialPrice.Text = txtOriginalPrice.Text * (1 - txtOffer.Text / 100) 'Enable the textbox txtProductID.Enabled = True txtProductName.Enabled = True txtBrand.Enabled = True txtColor.Enabled = True txtFinialPrice.Enabled = True txtOffer.Enabled = True txtOriginalPrice.Enabled = True txtSpecifications.Enabled = True FileUpload1.Enabled = True 'Enable the Add button btnAdd.Enabled = False btnSave.Enabled = True btnClear.Enabled = True End Sub End Class
150100000698
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Webpages/MasterDesign.Master" CodeBehind="Seating_Database.aspx.vb" Inherits="BabyAge.Seating_Database" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> <style type="text/css"> .style8 { width: 478px; } </style> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <table style="width: 614px"> <tr> <td class="style8"> <asp:Label ID="lblSeatingInformation" runat="server" FontNames="Arial" Font-Size="X-Large" ForeColor="#CC6600" Text="Seating Information"></asp:Label> </td> </tr> <tr> <td class="style8"> </td> </tr> <tr> <td class="style8"> </td> </tr> <tr> <td class="style8"> <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" CellPadding="2" DataKeyNames="ProductID" DataSourceID="SqlDataSource1" EmptyDataText="There are no data records to display." ForeColor="#333333" Height="186px" style="margin-right: 0px" Width="603px" FontSize="Smaller" PageSize="2"> <RowStyle BackColor="#FFFBD6" ForeColor="#333333" /> <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField DataField="ProductID" HeaderText="ProductID" ReadOnly="True" SortExpression="ProductID" /> <asp:BoundField DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" />
150100000698
<asp:BoundField DataField="Brand" HeaderText="Brand" SortExpression="Brand" /> <asp:BoundField DataField="OriginalPrice" HeaderText="OriginalPrice" SortExpression="OriginalPrice" /> <asp:BoundField DataField="Offer" HeaderText="Offer" SortExpression="Offer" /> <asp:BoundField DataField="FinialPrice" HeaderText="FinialPrice" SortExpression="FinialPrice" /> <asp:BoundField DataField="Color" HeaderText="Color" SortExpression="Color" /> <asp:BoundField DataField="Specifications" HeaderText="Specifications" SortExpression="Specifications" /> <asp:BoundField DataField="Image" HeaderText="Image" SortExpression="Image" /> </Columns> <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /> <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="White" /> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT [ProductID], [ProductName], [Brand], [OriginalPrice], [Offer], [FinialPrice], [Color], [Specifications], [Image] FROM [SeatingTable]"> </asp:SqlDataSource> </td> </tr> <tr> <td align = "left" class="style8" > <asp:Label ID="lblProductID" runat="server" Text="Product ID: "></asp:Label> <asp:TextBox ID="txtProductID" runat="server"></asp:TextBox> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblProductName" runat="server" Text="Product Name: "></asp:Label> <asp:TextBox ID="txtProductName" runat="server" Width="208px"></asp:TextBox> </td> </tr> <tr align = "left"> <td class="style8">
150100000698
<asp:Label ID="lblBrand" runat="server" Text="Brand: "></asp:Label> <asp:TextBox ID="txtBrand" runat="server"></asp:TextBox> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblOriginalPrice" runat="server" Text="Original Price: "></asp:Label> <asp:TextBox ID="txtOriginalPrice" runat="server"></asp:TextBox> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblOffer" runat="server" Text="Percent Offer: "></asp:Label> <asp:TextBox ID="txtOffer" runat="server" Width="102px"></asp:TextBox> <asp:Label ID="Label2" runat="server" Font-Size="Larger" ForeColor="Red" Text="%"></asp:Label> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblFinialPrice" runat="server" Text="Offer Price: "></asp:Label> <asp:TextBox ID="txtFinialPrice" runat="server" Width="132px"></asp:TextBox> <asp:Button ID="Button3" runat="server" Text="Calculate" Width="68px" /> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblColor" runat="server" Text="Color: "></asp:Label> <asp:TextBox ID="txtColor" runat="server" Width="208px"></asp:TextBox> </td> </tr> <tr align = "left"> <td class="style8" valign="middle"> <asp:Label ID="lblSpecifications" runat="server" Text="Specifications: "></asp:Label> <asp:TextBox ID="txtSpecifications" runat="server" TextMode="MultiLine" Width="213px" Height="83px"></asp:TextBox> </td>
150100000698
</tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblImage" runat="server" Text="Image: "></asp:Label> <asp:FileUpload ID="FileUpload1" runat="server" /> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblInsertNewRecord" runat="server" Text="Insert New Record" ForeColor="#CC6600"></asp:Label> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Button ID="btnAdd" runat="server" Text="Add" Width="94px" /> <asp:Button ID="btnSave" runat="server" Text="Save" Width="94px" /> <asp:Button ID="btnClear" runat="server" Text="Cancel" Width="94px" /> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblUpdateExistingRecord" runat="server" ForeColor="#CC6600" Text="Update Existing Record"></asp:Label> </td> </tr> <tr align = "left"> <td class="style8" > <asp:Button ID="btnEdit" runat="server" Text="Edit" Width="94px"/> <asp:Button ID="btnUpdate" runat="server" Text="Save" Width="94px"/> <asp:Button ID="btnCancel" runat="server" Text="Cancel" Width="94px"/> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Label ID="lblDeleteExistingRecord" runat="server" ForeColor="#CC6600" Text="Delete Existing Record"></asp:Label> </td> </tr> <tr align = "left"> <td class="style8"> <asp:Button ID="btnDelete" runat="server" Text="Delete" Width="94px" />
150100000698
<asp:Button ID="btnCancelDelete" runat="server" Text="Cancel" Width="94px"/> </td> </tr> <tr> <td class="style8" align = "right"> menu" Width="160px" /> </td> </tr> </table> </asp:Content> <asp:Button ID="Button4" runat="server" Text="Back to main PostBackUrl="~/Webpages/Database Form.aspx"
vb code
Imports System Imports System.Data Imports System.Configuration Imports System.Web Imports System.Web.Security Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.WebParts Imports System.Web.UI.HtmlControls Imports System.Data.SqlClient Partial Public Class Seating_Database Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'Disable the textbox txtProductID.Enabled = False txtBrand.Enabled = False txtColor.Enabled = False txtFinialPrice.Enabled = False txtOffer.Enabled = False txtOriginalPrice.Enabled = False txtProductName.Enabled = False txtSpecifications.Enabled = False FileUpload1.Enabled = False 'Disable the button btnEdit.Enabled = False btnUpdate.Enabled = False btnClear.Enabled = False btnCancel.Enabled = False btnDelete.Enabled = False btnCancelDelete.Enabled = False 'btnClearSearch.Enabled = False End Sub
150100000698
Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSave.Click Dim strMessage As String = "" Dim imgup As FileUpload = FileUpload1 Dim fileNameWithoutExtension As String = System.IO.Path.GetFileNameWithoutExtension(imgup.FileName) If MsgBox("Do You Want To Save This Record?", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Save") = MsgBoxResult.No Then btnSave.Enabled = False btnClear.Enabled = False btnAdd.Enabled = True GridView1.DataBind() Exit Sub End If 'This will show error message if a user does not key in a character If txtProductID.Text = String.Empty Then strMessage = "Product No is blank. Please fill in." End If If txtProductName.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Product Name is blank. Please fill strMessage += "Product Name is blank. Please fill in." End If End If If txtBrand.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Brand is blank. Please fill in." Else strMessage += "Brand is blank. Please fill in." End If End If If txtOriginalPrice.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Original Price is blank. Please fill in." Else strMessage += "Original Price is blank. Please fill in." End If End If If txtColor.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Color is blank. Please fill in." Else strMessage += "Color is blank. Please fill in." End If End If If txtSpecifications.Text = String.Empty Then Else
in."
150100000698
fill in."
If strMessage <> String.Empty Then strMessage += vbCrLf & "Specifications is blank. Please Else
strMessage += "Specifications is blank. Please fill in." End If End If If strMessage <> "" Then MsgBox(strMessage) Exit Sub End If If imgup.HasFile = False Then fileNameWithoutExtension = "Not Available!" End If Dim connectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim insertSql As String = "INSERT INTO SeatingTable(ProductID, ProductName, Brand, Color, Specifications, OriginalPrice, Offer, FinialPrice, Image) VALUES (@ProductID, @ProductName, @Brand, @Color, @Specifications, @OriginalPrice, @Offer, @FinialPrice, @Image)" Using myConnection As New SqlConnection(connectionString) myConnection.Open() Dim myCommand As New SqlCommand(insertSql, myConnection) myCommand.Parameters.AddWithValue("@ProductID", txtProductID.Text) myCommand.Parameters.AddWithValue("@ProductName", txtProductName.Text) myCommand.Parameters.AddWithValue("@Brand", txtBrand.Text) myCommand.Parameters.AddWithValue("@Color", txtColor.Text) myCommand.Parameters.AddWithValue("@Specifications", txtSpecifications.Text) myCommand.Parameters.AddWithValue("@OriginalPrice", txtOriginalPrice.Text) myCommand.Parameters.AddWithValue("@Offer", txtOffer.Text) myCommand.Parameters.AddWithValue("@FinialPrice", txtFinialPrice.Text) myCommand.Parameters.AddWithValue("@Image", fileNameWithoutExtension.ToString()) myCommand.ExecuteNonQuery() myConnection.Close() End Using 'Inform the user that a record has been save MsgBox("A New Record Has Successfully Been Inserted", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation, "Success!") 'Clear the textbox txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty
150100000698
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click 'Clear the textbox txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty 'Enable the textbox txtProductID.Enabled = True txtProductName.Enabled = True txtBrand.Enabled = True txtColor.Enabled = True txtFinialPrice.Enabled = True txtOffer.Enabled = True txtOriginalPrice.Enabled = True txtSpecifications.Enabled = True FileUpload1.Enabled = True btnSave.Enabled = True btnClear.Enabled = True btnAdd.Enabled = False End Sub Protected Sub Gridview1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles GridView1.SelectedIndexChanged txtProductID.Text = GridView1.SelectedRow.Cells(1).Text txtProductName.Text = GridView1.SelectedRow.Cells(2).Text txtBrand.Text = GridView1.SelectedRow.Cells(3).Text txtColor.Text = GridView1.SelectedRow.Cells(7).Text txtOriginalPrice.Text = GridView1.SelectedRow.Cells(4).Text txtOffer.Text = GridView1.SelectedRow.Cells(5).Text txtFinialPrice.Text = GridView1.SelectedRow.Cells(6).Text txtSpecifications.Text = GridView1.SelectedRow.Cells(8).Text 'lblOldValue.Text = GridView1.SelectedRow.Cells(11).Text 'Enable the Edit button and Delete button but Disable the btnUpdate btnEdit.Enabled = True btnUpdate.Enabled = False
150100000698
Protected Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdate.Click If MsgBox("Do You Want To Save This Record?", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Update!") = MsgBoxResult.No Then btnEdit.Enabled = True btnUpdate.Enabled = False btnDelete.Enabled = True Exit Sub End If Dim imgup As FileUpload = FileUpload1 Dim fileNameWithoutExtension As String = System.IO.Path.GetFileNameWithoutExtension(imgup.FileName) 'If imgup.HasFile = False Then 'fileNameWithoutExtension = lblOldValue.Text 'End If Dim connectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim UpdateSql As String = "UPDATE SeatingTable SET ProductName = @ProductName, Brand = @Brand, Color = @Color, Specifications = @Specifications, OriginalPrice = @OriginalPrice, Offer = @Offer, FinialPrice = @FinialPrice, Image = @Image WHERE ProductID = @ProductID" Using myConnection As New SqlConnection(connectionString) myConnection.Open() Dim myCommand As New SqlCommand(UpdateSql, myConnection) myCommand.Parameters.AddWithValue("@ProductID", txtProductID.Text) myCommand.Parameters.AddWithValue("@ProductName", txtProductName.Text) myCommand.Parameters.AddWithValue("@Brand", txtBrand.Text) myCommand.Parameters.AddWithValue("@Color", txtColor.Text) myCommand.Parameters.AddWithValue("@Specifications", txtSpecifications.Text)
150100000698
myCommand.Parameters.AddWithValue("@OriginalPrice", txtOriginalPrice.Text) myCommand.Parameters.AddWithValue("@Offer", txtOffer.Text) myCommand.Parameters.AddWithValue("@FinialPrice", txtFinialPrice.Text) myCommand.Parameters.AddWithValue("@Image", fileNameWithoutExtension.ToString()) myCommand.ExecuteNonQuery() myConnection.Close() End Using 'Informs the user that the a record has been save MsgBox("Record Has Successfully Been Updated", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation, "Success!") GridView1.DataBind() 'Clear the textbox txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty End Sub Protected Sub btnClear_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnClear.Click 'Clear the textboxes txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty 'Disable the textboxes txtProductID.Enabled = False txtProductName.Enabled = False txtBrand.Enabled = False txtColor.Enabled = False txtFinialPrice.Enabled = False txtOffer.Enabled = False txtOriginalPrice.Enabled = False txtSpecifications.Enabled = False FileUpload1.Enabled = False 'Disable Edit button btnEdit.Enabled = False btnUpdate.Enabled = False btnCancel.Enabled = False 'Disable Delete button
150100000698
Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click 'Clear the textboxes txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty 'Disable the textboxes txtProductID.Enabled = False txtProductName.Enabled = False txtBrand.Enabled = False txtColor.Enabled = False txtFinialPrice.Enabled = False txtOffer.Enabled = False txtOriginalPrice.Enabled = False txtSpecifications.Enabled = False FileUpload1.Enabled = False 'Disable Edit button btnEdit.Enabled = False btnUpdate.Enabled = False btnCancel.Enabled = False 'Disable Delete button btnDelete.Enabled = False 'Enable and Disable the Add button btnAdd.Enabled = True btnSave.Enabled = False btnClear.Enabled = False End Sub Protected Sub btnDelete_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnDelete.Click Dim imgup As FileUpload = FileUpload1 Dim fileNameWithoutExtension As String = System.IO.Path.GetFileNameWithoutExtension(imgup.FileName) If MsgBox("Do You Want To Delete This Record?", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Delete?") = MsgBoxResult.No Then btnDelete.Enabled = True btnEdit.Enabled = True Exit Sub End If
150100000698
If imgup.HasFile = False Then fileNameWithoutExtension = "Not Available!" End If Dim connectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim deleteSql As String = "DELETE FROM SeatingTable WHERE ProductID = @ProductID" Using myConnection As New SqlConnection(connectionString) myConnection.Open() Dim myCommand As New SqlCommand(deleteSql, myConnection) myCommand.Parameters.AddWithValue("@ProductID", txtProductID.Text) myCommand.ExecuteNonQuery() myConnection.Close() End Using 'Informs the user that the a record has been save MsgBox("Record Has Been Deleted.", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation, "Success!") GridView1.DataBind() 'Clear the textboxes txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty 'Disable the textboxes txtProductID.Enabled = False txtProductName.Enabled = False txtBrand.Enabled = False txtColor.Enabled = False txtFinialPrice.Enabled = False txtOffer.Enabled = False txtOriginalPrice.Enabled = False txtSpecifications.Enabled = False FileUpload1.Enabled = False 'Disable Edit button btnEdit.Enabled = False btnUpdate.Enabled = False btnCancel.Enabled = False 'Disable Delete button btnDelete.Enabled = False 'Enable and Disable the Add button btnAdd.Enabled = True btnSave.Enabled = False btnClear.Enabled = False End Sub
150100000698
Protected Sub btnEdit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnEdit.Click 'Enable the textbox txtProductID.Enabled = True txtProductName.Enabled = True txtBrand.Enabled = True txtColor.Enabled = True txtFinialPrice.Enabled = True txtOffer.Enabled = True txtOriginalPrice.Enabled = True txtSpecifications.Enabled = True FileUpload1.Enabled = True 'Enable and Disable the Save button btnEdit.Enabled = False btnUpdate.Enabled = True btnCancel.Enabled = True 'Disable the Add button btnAdd.Enabled = False btnSave.Enabled = False btnClear.Enabled = False End Sub Protected Sub btnCancelDelete_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancelDelete.Click btnAdd.Enabled = True btnDelete.Enabled = False btnEdit.Enabled = False 'Clear the textboxes txtProductID.Text = String.Empty txtProductName.Text = String.Empty txtBrand.Text = String.Empty txtColor.Text = String.Empty txtFinialPrice.Text = String.Empty txtOffer.Text = String.Empty txtOriginalPrice.Text = String.Empty txtSpecifications.Text = String.Empty 'Disable the textboxes txtProductID.Enabled = False txtProductName.Enabled = False txtBrand.Enabled = False txtColor.Enabled = False txtFinialPrice.Enabled = False txtOffer.Enabled = False txtOriginalPrice.Enabled = False txtSpecifications.Enabled = False FileUpload1.Enabled = False 'Disable Edit button btnEdit.Enabled = False btnUpdate.Enabled = False btnCancel.Enabled = False 'Disable Delete button btnDelete.Enabled = False
150100000698
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button3.Click txtFinialPrice.Text = txtOriginalPrice.Text * (1 - txtOffer.Text / 100) 'Enable the textbox txtProductID.Enabled = True txtProductName.Enabled = True txtBrand.Enabled = True txtColor.Enabled = True txtFinialPrice.Enabled = True txtOffer.Enabled = True txtOriginalPrice.Enabled = True txtSpecifications.Enabled = True FileUpload1.Enabled = True 'Enable the Add button btnAdd.Enabled = False btnSave.Enabled = True btnClear.Enabled = True End Sub End Class
150100000698
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Webpages/MasterDesign.Master" CodeBehind="Registration.aspx.vb" Inherits="BabyAge.Registration" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <asp:CreateUserWizard ID="CreateUserWizard1" runat="server"> <WizardSteps> <asp:CreateUserWizardStep runat="server"> <ContentTemplate> <table border="0"> <tr> <td align="center" colspan="2"> Sign Up for Your New Account</td> </tr> <tr> <td align="right"> <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label> </td> <td> <asp:TextBox ID="UserName" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label> </td> <td> <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox> <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label> </td>
150100000698
<asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox> <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword" ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label> </td> <td> <asp:TextBox ID="Email" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email" ErrorMessage="Email is required." ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security Question:</asp:Label> </td> <td> <asp:TextBox ID="Question" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question" ErrorMessage="Security question is required." ToolTip="Security question is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security Answer:</asp:Label> </td> <td> <asp:TextBox ID="Answer" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer" ErrorMessage="Security answer is required." ToolTip="Security answer is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td>
150100000698
runat="server"
ControlToCompare="Password" ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match." ValidationGroup="CreateUserWizard1"></asp:CompareValidator> </td> </tr> <tr> <td align="center" colspan="2" style="color: Red;"> <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal> </td> </tr> </table> </ContentTemplate> </asp:CreateUserWizardStep> <asp:WizardStep runat="server" AllowReturn="False" StepType="Step" Title="AddDetails" ID="AddDetails"> <asp:Label ID="lblFN" runat="server" Text="First Name: "></asp:Label> <asp:TextBox ID="txtFN" runat="server" AutoCompleteType="FirstName"></asp:TextBox> <br /> <asp:Label ID="lblLN" runat="server" Text="Last Name:"></asp:Label> <asp:TextBox ID="txtLN" runat="server" AutoCompleteType="LastName"></asp:TextBox> <br /> <asp:Label ID="lblGender" runat="server" Text="Gender: "></asp:Label> <asp:RadioButtonList ID="rblGender" runat="server" RepeatDirection="Horizontal"> <asp:ListItem>Male</asp:ListItem> <asp:ListItem>Female</asp:ListItem> </asp:RadioButtonList> <asp:Label ID="lblDOB" runat="server" Text="Date Of Birth: "></asp:Label> <asp:TextBox ID="txtDOB" runat="server"></asp:TextBox> <br /> <br /> <asp:Label ID="lblNationality" runat="server" Text="Nationality: "></asp:Label> <asp:TextBox ID="txtNationality" runat="server"></asp:TextBox> <br /> <asp:Label ID="lblHP" runat="server" Text="HandPhone No: "></asp:Label> <asp:TextBox ID="txtHP" runat="server" Wrap="False" AutoCompleteType="HomePhone"></asp:TextBox> <br /> <asp:Label ID="lblCA" runat="server" Text="Current Address: "></asp:Label>
150100000698
<asp:TextBox ID="txtCA" runat="server" TextMode="MultiLine"></asp:TextBox> </asp:WizardStep> <asp:CompleteWizardStep runat="server"> <ContentTemplate> <table border="0"> <tr> <td align="center" colspan="2"> Complete</td> </tr> <tr> <td> Your account has been successfully created.</td> </tr> <tr> <td align="right" colspan="2"> <asp:Button ID="ContinueButton" runat="server" CausesValidation="False" CommandName="Continue" Text="Continue" ValidationGroup="CreateUserWizard1" PostBackUrl="~/Webpages/Home.aspx" /> </td> </tr> </table> </ContentTemplate> </asp:CompleteWizardStep> </WizardSteps> </asp:CreateUserWizard>
</asp:Content>
vb code
Imports System.Data.SqlClient Partial Public Class Registration Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Private Sub CreateUserWizard1_ActiveStepChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.ActiveStepChanged If CreateUserWizard1.ActiveStep.Title = "Complete" Then Dim Settings As WizardStep = CType(CreateUserWizard1.FindControl("AddDetails"), WizardStep) TextBox) TextBox) Dim FirstName As TextBox = CType(Settings.FindControl("txtFN"), Dim LastName As TextBox = CType(Settings.FindControl("txtLN"),
150100000698
Dim DateOfBirth As TextBox = CType(Settings.FindControl("txtDOB"), TextBox) Dim Nationality As TextBox = CType(Settings.FindControl("txtNationality"), TextBox) Dim HP As TextBox = CType(Settings.FindControl("txtHP"), TextBox) Dim CurrentAddress As TextBox = CType(Settings.FindControl("txtCA"), TextBox) Dim newUser As MembershipUser = Membership.GetUser(CreateUserWizard1.UserName) Dim newUserId As Guid = CType(newUser.ProviderUserKey, Guid) Dim connectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim insertSql As String = "INSERT INTO Member(UserId, FirstName, LastName, Gender, DateOfBirth, Nationality, HP, CurrentAddress) VALUES (@UserId, @FirstName, @LastName, @Gender, @DateOfBirth, @Nationality, @HP, @CurrentAddress)" Using myConnection As New SqlConnection(connectionString) myConnection.Open() Dim myCommand As New SqlCommand(insertSql, myConnection) myCommand.Parameters.AddWithValue("@UserId", newUserId) myCommand.Parameters.AddWithValue("@FirstName", FirstName.Text.Trim()) myCommand.Parameters.AddWithValue("@LastName", LastName.Text.Trim()) myCommand.Parameters.AddWithValue("@Gender", Gender.SelectedValue.Trim()) myCommand.Parameters.AddWithValue("@DateOfBirth", DateOfBirth.Text.Trim()) myCommand.Parameters.AddWithValue("@Nationality", Nationality.Text.Trim()) myCommand.Parameters.AddWithValue("@HP", HP.Text.Trim()) myCommand.Parameters.AddWithValue("@CurrentAddress", CurrentAddress.Text.Trim()) myCommand.ExecuteNonQuery() myConnection.Close() End Using Roles.AddUserToRole(CreateUserWizard1.UserName, "members") End If End Sub End Class
150100000698
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Webpages/MasterDesign.Master" CodeBehind="Database Form.aspx.vb" Inherits="BabyAge.Database_Form" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <table style="width: 614px"> <tr> <td class="style8"> <asp:Label ID="lblSelectdatabase" runat="server" Text="Selet database: "></asp:Label> <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"> <asp:ListItem Selected="True">Please Select A Catergory</asp:ListItem> <asp:ListItem>CarSeat_Database</asp:ListItem> <asp:ListItem>Stroller_Database</asp:ListItem> <asp:ListItem>Seating_Database</asp:ListItem> </asp:DropDownList> </td></tr> <tr> <td class="style8"> </td></tr> <tr> <td class="style8"> Size="Large" <asp:Label ID="lblMemberInformation" runat="server" FontForeColor="#CC6600" Text="Member List"></asp:Label> </td></tr> <tr> <td class="style8"> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" AllowPaging="True" PageSize="5"> <Columns> <asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName"></asp:BoundField> <asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" /> <asp:BoundField DataField="Gender" HeaderText="Gender" SortExpression="Gender" /> <asp:BoundField DataField="DateOfBirth" HeaderText="DateOfBirth" SortExpression="DateOfBirth" /> <asp:BoundField DataField="Nationality" HeaderText="Nationality" SortExpression="Nationality" /> <asp:BoundField DataField="HP" HeaderText="HP" SortExpression="HP"
/>
150100000698
</asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [FirstName], [LastName], [Gender], [DateOfBirth], [Nationality], [HP], [CurrentAddress] FROM [Member]"> </asp:SqlDataSource> </td></tr></table> </asp:Content>
vb code
Imports System.Data Imports System.Configuration Imports System.Web Imports System.Web.Security Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.WebParts Imports System.Web.UI.HtmlControls Imports System.Data.SqlClient Partial Public Class Database_Form Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DropDownList1.SelectedIndexChanged 'Place this in the main menu Dim Link As String = DropDownList1.SelectedValue.ToString() + ".aspx" Response.Redirect(Link) End Sub End Class
150100000698
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Webpages/MasterDesign.Master" CodeBehind="Order.aspx.vb" Inherits="BabyAge.Order" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <table><tr><td> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="SqlDataSource1" Width="550px" DataKeyNames="ID"> <RowStyle BackColor="White" ForeColor="#330099" /> <Columns> <asp:BoundField DataField="Checkout_ID" HeaderText="Product Name" SortExpression="Checkout_ID" /> <asp:TemplateField HeaderText="Quantity" SortExpression="Quantity"> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Quantity") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("Quantity") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Price" SortExpression="Price"> <EditItemTemplate> <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Price") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label2" runat="server" Text='<%# Bind("Price") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="Total_Price" HeaderText="Total_Price" SortExpression="Total_Price" Visible="False" /> <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" Visible="False" /> <asp:BoundField DataField="UserId" HeaderText="UserId" SortExpression="UserId" Visible="False" /> </Columns> <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" /> <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" /> <EmptyDataTemplate> There is nothing is your cart. </EmptyDataTemplate>
150100000698
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" /> <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" /> </asp:GridView> </td></tr> <tr><td> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Checkout_ID], [Quantity], [Price], [Total_Price], [ID], [UserId] FROM [Checkout] WHERE ([UserId] = @UserId)" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"> <SelectParameters> <asp:ControlParameter ControlID="GridView1" Name="UserId" PropertyName="SelectedValue" Type="Object" /> </SelectParameters> </asp:SqlDataSource> </td></tr> <tr><td align=right> <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="0" DataSourceID="SqlDataSource1" GridLines="None" Height="16px" ShowFooter="True" style="marginbottom: 0px" Width="92px" PageSize="1" DataKeyNames="ID"> <RowStyle BackColor="White" ForeColor="#330099" /> <Columns> <asp:BoundField DataField="Checkout_ID" HeaderText="Checkout_ID" SortExpression="Checkout_ID" Visible="False" /> <asp:BoundField DataField="Quantity" HeaderText="Quantity" SortExpression="Quantity" Visible="False" /> <asp:TemplateField HeaderText="Total Price" SortExpression="Price"> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Total_Price") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("Total_Price") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" Visible="False" /> <asp:BoundField DataField="UserId" HeaderText="UserId" SortExpression="UserId" Visible="False" /> </Columns> <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="right" Wrap="True" /> <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
150100000698
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" /> <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" /> </asp:GridView> </td></tr> <tr><td align=right> <asp:Button ID="btnCheckout" runat="server" Text="Proceed To Check" /> </td></tr></table> </asp:Content>
vb code
Imports System.Data.SqlClient Partial Public Class Order Inherits System.Web.UI.Page ' Declare variable used to store value of Total Private TotalPrice As Decimal = CDec(0.0) Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Protected Sub SqlDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) Handles SqlDataSource1.Selecting Dim currentUser As MembershipUser = Membership.GetUser() Dim currentUserId As Guid = CType(currentUser.ProviderUserKey, Guid) e.Command.Parameters("@UserId").Value = currentUserId End Sub Private Sub GridView3_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView3.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then TotalPrice += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Price")) ElseIf e.Row.RowType = DataControlRowType.Footer Then e.Row.Cells(2).Text = String.Format("{0:c}", TotalPrice) End If End Sub Protected Sub btnCheckout_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCheckout.Click If GridView1.Rows.Count = 0 Then 'Informs the user that the a record has been save MsgBox("There is nothing in your shopping cart.", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "RangerAmouries") Else Response.Redirect("Proceed_Order.aspx") End If End Sub End Class
150100000698
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Webpages/MasterDesign.Master" CodeBehind="Proceed_Order.aspx.vb" Inherits="BabyAge.Proceed_Order" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> <style type="text/css"> .style71 { width: 587px; } .style72 { height: 4px; } </style> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <table class="style71" style="margin-left: 25px"> <tr> <td colspan="2"> <asp:Label ID="Label17" runat="server" Font-Bold="True" Font-Names="Arial" Font-Size="X-Large" Text="Credit/debit card"></asp:Label> </td> </tr> <tr> <td> <asp:Label ID="Label6" runat="server" Text="Credit Card Type:"></asp:Label> </td> <td> <asp:DropDownList ID="DropDownList1" runat="server"> <asp:ListItem>Visa</asp:ListItem> <asp:ListItem>Master Card</asp:ListItem> <asp:ListItem>American Express</asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td class="style72"> <asp:Label ID="Label7" runat="server" Text="CardHolder Name:"></asp:Label> </td> <td class="style72"> <asp:TextBox ID="txtName" runat="server" Width="297px"></asp:TextBox> </td> </tr> <tr> <td> <asp:Label ID="Label8" runat="server" Text="Valid From:"></asp:Label> </td>
150100000698
<asp:DropDownList ID="DropDownList3" runat="server"> <asp:ListItem>- -</asp:ListItem> <asp:ListItem>1</asp:ListItem> <asp:ListItem>2</asp:ListItem> <asp:ListItem>3</asp:ListItem> <asp:ListItem>4</asp:ListItem> <asp:ListItem>5</asp:ListItem> <asp:ListItem>6</asp:ListItem> <asp:ListItem>7</asp:ListItem> <asp:ListItem>8</asp:ListItem> <asp:ListItem>9</asp:ListItem> <asp:ListItem>10</asp:ListItem> <asp:ListItem>11</asp:ListItem> <asp:ListItem>12</asp:ListItem> <asp:ListItem>13</asp:ListItem> <asp:ListItem>14</asp:ListItem> <asp:ListItem>15</asp:ListItem> <asp:ListItem>16</asp:ListItem> <asp:ListItem>17</asp:ListItem> <asp:ListItem>18</asp:ListItem> <asp:ListItem>19</asp:ListItem> <asp:ListItem>20</asp:ListItem> <asp:ListItem>21</asp:ListItem> <asp:ListItem>22</asp:ListItem> <asp:ListItem>23</asp:ListItem> <asp:ListItem>24</asp:ListItem> <asp:ListItem>25</asp:ListItem> <asp:ListItem>26</asp:ListItem> <asp:ListItem>27</asp:ListItem> <asp:ListItem>28</asp:ListItem> <asp:ListItem>29</asp:ListItem> <asp:ListItem>30</asp:ListItem> <asp:ListItem>31</asp:ListItem> </asp:DropDownList> <asp:DropDownList ID="DropDownList4" runat="server"> <asp:ListItem>- -</asp:ListItem> <asp:ListItem>01</asp:ListItem> <asp:ListItem>02</asp:ListItem> <asp:ListItem>03</asp:ListItem> <asp:ListItem>04</asp:ListItem> <asp:ListItem>05</asp:ListItem> <asp:ListItem>06</asp:ListItem> <asp:ListItem>07</asp:ListItem> <asp:ListItem>08</asp:ListItem> <asp:ListItem>09</asp:ListItem> <asp:ListItem>10</asp:ListItem> <asp:ListItem>11</asp:ListItem> <asp:ListItem>12</asp:ListItem> </asp:DropDownList> <asp:DropDownList ID="DropDownList5" runat="server"> <asp:ListItem>- - - -</asp:ListItem> <asp:ListItem>2001</asp:ListItem> <asp:ListItem>2002</asp:ListItem> <asp:ListItem>2003</asp:ListItem> <asp:ListItem>2004</asp:ListItem> <asp:ListItem>2005</asp:ListItem> <asp:ListItem>2006</asp:ListItem> <asp:ListItem>2007</asp:ListItem>
150100000698
<asp:ListItem>2008</asp:ListItem> <asp:ListItem>2009</asp:ListItem> <asp:ListItem>2010</asp:ListItem> <asp:ListItem>2011</asp:ListItem> <asp:ListItem>2012</asp:ListItem> <asp:ListItem>2013</asp:ListItem> <asp:ListItem>2014</asp:ListItem> <asp:ListItem>2015</asp:ListItem> <asp:ListItem>2016</asp:ListItem> <asp:ListItem>2017</asp:ListItem> <asp:ListItem>2018</asp:ListItem> <asp:ListItem>2019</asp:ListItem> <asp:ListItem>2020</asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td> <asp:Label ID="Label9" runat="server" Text="Expiry Date:"></asp:Label> </td> <td> <asp:DropDownList ID="DropDownList9" runat="server"> <asp:ListItem>- -</asp:ListItem> <asp:ListItem>1</asp:ListItem> <asp:ListItem>2</asp:ListItem> <asp:ListItem>3</asp:ListItem> <asp:ListItem>4</asp:ListItem> <asp:ListItem>5</asp:ListItem> <asp:ListItem>6</asp:ListItem> <asp:ListItem>7</asp:ListItem> <asp:ListItem>8</asp:ListItem> <asp:ListItem>9</asp:ListItem> <asp:ListItem>10</asp:ListItem> <asp:ListItem>11</asp:ListItem> <asp:ListItem>12</asp:ListItem> <asp:ListItem>13</asp:ListItem> <asp:ListItem>14</asp:ListItem> <asp:ListItem>15</asp:ListItem> <asp:ListItem>16</asp:ListItem> <asp:ListItem>17</asp:ListItem> <asp:ListItem>18</asp:ListItem> <asp:ListItem>19</asp:ListItem> <asp:ListItem>20</asp:ListItem> <asp:ListItem>21</asp:ListItem> <asp:ListItem>22</asp:ListItem> <asp:ListItem>23</asp:ListItem> <asp:ListItem>24</asp:ListItem> <asp:ListItem>25</asp:ListItem> <asp:ListItem>26</asp:ListItem> <asp:ListItem>27</asp:ListItem> <asp:ListItem>28</asp:ListItem> <asp:ListItem>29</asp:ListItem> <asp:ListItem>30</asp:ListItem> <asp:ListItem>31</asp:ListItem> </asp:DropDownList> <asp:DropDownList ID="DropDownList10" runat="server"> <asp:ListItem>- -</asp:ListItem> <asp:ListItem>1</asp:ListItem>
150100000698
<asp:ListItem>2</asp:ListItem> <asp:ListItem>3</asp:ListItem> <asp:ListItem>4</asp:ListItem> <asp:ListItem>5</asp:ListItem> <asp:ListItem>6</asp:ListItem> <asp:ListItem>7</asp:ListItem> <asp:ListItem>8</asp:ListItem> <asp:ListItem>9</asp:ListItem> <asp:ListItem>10</asp:ListItem> <asp:ListItem>11</asp:ListItem> <asp:ListItem>12</asp:ListItem> <asp:ListItem>13</asp:ListItem> <asp:ListItem>14</asp:ListItem> <asp:ListItem>15</asp:ListItem> <asp:ListItem>16</asp:ListItem> <asp:ListItem>17</asp:ListItem> <asp:ListItem>18</asp:ListItem> <asp:ListItem>19</asp:ListItem> <asp:ListItem>20</asp:ListItem> <asp:ListItem>21</asp:ListItem> <asp:ListItem>22</asp:ListItem> <asp:ListItem>23</asp:ListItem> <asp:ListItem>24</asp:ListItem> <asp:ListItem>25</asp:ListItem> <asp:ListItem>26</asp:ListItem> <asp:ListItem>27</asp:ListItem> <asp:ListItem>28</asp:ListItem> <asp:ListItem>29</asp:ListItem> <asp:ListItem>30</asp:ListItem> <asp:ListItem>31</asp:ListItem> </asp:DropDownList> <asp:DropDownList ID="DropDownList11" runat="server"> <asp:ListItem>- - - -</asp:ListItem> <asp:ListItem>2001</asp:ListItem> <asp:ListItem>2002</asp:ListItem> <asp:ListItem>2003</asp:ListItem> <asp:ListItem>2004</asp:ListItem> <asp:ListItem>2005</asp:ListItem> <asp:ListItem>2006</asp:ListItem> <asp:ListItem>2007</asp:ListItem> <asp:ListItem>2008</asp:ListItem> <asp:ListItem>2009</asp:ListItem> <asp:ListItem>2010</asp:ListItem> <asp:ListItem>2011</asp:ListItem> <asp:ListItem>2012</asp:ListItem> <asp:ListItem>2013</asp:ListItem> <asp:ListItem>2014</asp:ListItem> <asp:ListItem>2015</asp:ListItem> <asp:ListItem>2016</asp:ListItem> <asp:ListItem>2017</asp:ListItem> <asp:ListItem>2018</asp:ListItem> <asp:ListItem>2019</asp:ListItem> <asp:ListItem>2020</asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td>
150100000698
<asp:Label ID="Label10" runat="server" Text="Issue Number:"></asp:Label> </td> <td> <asp:TextBox ID="txtIssueNo" runat="server" Width="37px"></asp:TextBox> <asp:Label ID="Label20" runat="server" Font-Size="Smaller" Text="*(Only American Express. Just Put '0' For Other Credit Type)"></asp:Label> </td> </tr> <tr> <td> <asp:Label ID="Label11" runat="server" Text="Security Code:"></asp:Label> </td> <td> <asp:TextBox ID="txtCV2" runat="server" Width="50px"></asp:TextBox> <asp:Label ID="Label12" runat="server" Font-Size="Smaller" Text="* The Rightmost Three Digits Printed On The Signature sSrip"></asp:Label> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td colspan="2"> <asp:Label ID="Label18" runat="server" Font-Bold="True" Font-Names="Arial" Font-Size="X-Large" Text="Billing Address"></asp:Label> </td> </tr> <tr> <td> <asp:Label ID="Label13" runat="server" Text="Address:"></asp:Label> </td> <td> <asp:TextBox ID="txtAddress1" runat="server" Height="53px" TextMode="MultiLine" Width="313px"></asp:TextBox> </td> </tr> <tr> <td> <asp:Label ID="Label14" runat="server" Text="PostCode:"></asp:Label> </td> <td> <asp:TextBox ID="txtPostcode" runat="server" Width="89px"></asp:TextBox> </td> </tr> <tr>
150100000698
<asp:Label ID="Label15" runat="server" Text="Country:"></asp:Label> </td> <td> <asp:DropDownList ID="DropDownList2" runat="server"> <asp:ListItem>Brunei Darussalam</asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td> <asp:Label ID="Label16" runat="server" Text="Telephone:"></asp:Label> </td> <td> <asp:TextBox ID="txtTelephone" runat="server" Width="182px"></asp:TextBox> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td align="center"> <asp:Button ID="btnConfirm" runat="server" Text="Confirm Order" /> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td colspan="2"> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="SqlDataSource1" Width="550px" DataKeyNames="ID"> <RowStyle BackColor="White" ForeColor="#330099" /> <Columns> <asp:BoundField DataField="Checkout_ID" HeaderText="Product Name" SortExpression="Checkout_ID" /> <asp:TemplateField HeaderText="Quantity" SortExpression="Quantity"> <EditItemTemplate> <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Quantity") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate>
150100000698
<asp:Label ID="Label2" runat="server" Text='<%# Bind("Quantity") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Price" SortExpression="Price"> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Price") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("Price") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="UserId" HeaderText="UserId" SortExpression="UserId" Visible="False" /> <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" Visible="False" /> </Columns> <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" /> <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" /> <EmptyDataTemplate> There is nothing is your cart. </EmptyDataTemplate> <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" /> <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" /> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [Checkout_ID], [Quantity], [Price], [UserId], [ID] FROM [Checkout] WHERE ([UserId] = @UserId)" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"> <SelectParameters> <asp:ControlParameter ControlID="GridView1" Name="UserId" PropertyName="SelectedValue" Type="Object" /> </SelectParameters> </asp:SqlDataSource> </td> </tr> </table> </asp:Content>
vb code
Imports System.Data.SqlClient Partial Public Class Proceed_Order Inherits System.Web.UI.Page
150100000698
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Protected Sub SqlDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) Handles SqlDataSource1.Selecting Dim currentUser As MembershipUser = Membership.GetUser() Dim currentUserId As Guid = CType(currentUser.ProviderUserKey, Guid) e.Command.Parameters("@UserId").Value = currentUserId End Sub Protected Sub btnConfirm_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnConfirm.Click Dim currentUser As MembershipUser = Membership.GetUser() Dim currentUserId As Guid = CType(currentUser.ProviderUserKey, Guid) Dim strMessage As String = ""
If txtName.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Please fill in your full name as stated in your card." Else strMessage += "Please fill in your full name as stated in your card." End If End If If txtIssueNo.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Your Issue Number is blank. Please fill in." Else strMessage += "Your Issue Number is blank. Please fill in." End If End If If txtCV2.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "You have not key in your security code. Please fill in." Else strMessage += "You have not key in your security code. Please fill in." End If End If If txtAddress1.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Please fill in your billing address." Else strMessage += "Please fill in your billing address." End If End If
150100000698
If txtPostcode.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Please fill in your Postcode." Else strMessage += "Please fill in your Postcode." End If End If If txtTelephone.Text = String.Empty Then If strMessage <> String.Empty Then strMessage += vbCrLf & "Your telephone number is blank. Please fill in." Else strMessage += "Your telephone number is blank. Please fill in." End If End If If strMessage <> "" Then MsgBox(strMessage) Exit Sub End If Dim connectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim deleteSql As String = "DELETE FROM Checkout WHERE UserId = @UserId" Using myConnection As New SqlConnection(connectionString) myConnection.Open() Dim myCommand As New SqlCommand(deleteSql, myConnection) myCommand.Parameters.AddWithValue("@UserId", currentUserId) myCommand.ExecuteNonQuery() myConnection.Close() End Using 'Informs the user that the a record has been save MsgBox("Thank you for shopping at Your Baby Is Our Concern. We will email you your invoice.", MsgBoxStyle.MsgBoxSetForeground + MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation, "Your Baby Is Our Concern") GridView1.DataBind() Response.Redirect("Home.aspx") End Sub End Class
150100000698
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Webpages/MasterDesign.Master" CodeBehind="FeedbackPage.aspx.vb" Inherits="BabyAge.FeedbackPage" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> <script language="javascript" type="text/javascript"> // <!CDATA[ function Submit1_onclick() { window.alert("Thank you! We will take note your comments!") } function Reset1_onclick() { window.alert("Are you sure you want to cancel?") } // ]]> </script> <style type="text/css"> #Submit1 { width: 56px; } </style> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <p style="text-align:center;"> <asp:Label ID="Label2" runat="server" Font-Italic="True" Font-Size="XXLarge" ForeColor="#CC6600" Text="Feedback"></asp:Label> <hr /></p> <form name="Feedback" action="mailto:phyllismin@hotmail.com" method="post"> <table> <tr> <td><b>First Name:</b></td> <td> <input type="text" size="30" name="FN" onfocus="ClearFirstName()"/><font color="red">*</font></td> </tr> <tr> <td><b>Last Name:</b></td> <td> <input type="text" size="30" name="LN" onfocus="ClearLastName()" /><font color="red">*</font></td> </tr> <tr> <td><b>Gender:</b></td> <td> <input type="radio" name="sex" value="male" />Male <input type="radio" name="sex" value="male" />Female</td> </tr>
150100000698
<tr> <td><b>Email Address:</b></td> <td> <input type="text" size="30" name="email" onfocus="ClearEmail()" /><font color="red">*</font></td> </tr> <tr> <td><b>Telephone:</b></td> <td> <input type="text" size="30" name="TEL" onfocus="ClearTelephone()" /></td> </tr> <tr> <td><b>HandPhone:</b></td> <td> <input type="text" size="30" name="HP" onfocus="ClearHandPhone()" /></td> </tr> <tr> <td><b>Comment:</b></td> <td> <textarea rows=5 cols=25 onfocus="ClearID()">Write your comments here</textarea><font color="red">*</font></td> <br /><br /> </tr> <tr><td> </td> <td align="center"> <input id="Submit1" type="submit" value="send" name="button" onclick="return Submit1_onclick()" /> <input id="Reset1" type="reset" value="cancel" onclick="return Reset1_onclick()" /> </td></tr> </table> </form>
</asp:Content>
150100000698
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Webpages/MasterDesign.Master" CodeBehind="ContactUs.aspx.vb" Inherits="BabyAge.ContactUs" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <table><tr><td style= "width : 590px" align="left"> <asp:Label ID="lblContactUs" runat="server" Font-Size="Larger" ForeColor="#CC6600" Text="Contact Us"></asp:Label> </td></tr> <tr><td align="left"> <asp:Label ID="lblAddress" runat="server" Text="Address: No 15, simpang 11-22-33, Time Square, Brunei"></asp:Label> </td></tr> <tr><td align="left"> <asp:Label ID="lblTelnFax" runat="server" Text="TEL: 2888888 2555555"></asp:Label> </td></tr> <tr><td align="left"> <asp:Label ID="lblEmail" runat="server" Text="E-mail: BeautyFE@hotmail.com"></asp:Label> </td></tr> <tr><td align="left"> <asp:Label ID="lblMap" runat="server" Text="Check Map below:" ForeColor="#CC6600"></asp:Label> </td></tr> <tr><td align="left"> <img src="../images/map.jpg" style="width: 620px; height: 369px" /></td></tr> </table> </asp:Content> Fax:
150100000698
6. Testing
Test Plan Test Case 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Objective
To log in as an admin account, Manage database will be appeared. To log in as a member account, Manage database wont be appeared. To register a new account To add a new car seat product To save a new car seat product To confirm to save a new car seat product To edit a car seat product To save that record has been edited. To confirm to save that record has been edited. To delete a record To confirm to delete a record To return to main menu of database To test Order menu is disabled before login To test Order menu is enabled after login as a member To test Order menu is enabled after login as a member To check the product that you have added in your shopping cart To go to order process To fill in all the information and confirm order To go to feedback page To fill in the information in feedback page and send it Cancel to send the information about feedback.
150100000698
To log in as an admin account, Manage database will be appeared. Username: admin, Password: admin@@ A link Manage database should be appeared. Refer to screen capture Actual result matched expected result
Before
After
150100000698
Test Case Objectives Test Data Expected Result Actual Result Conclusion
2 To log in as a member account, Manage database wont be appeared. E.g. Username: donut, Password: donut@@ A link Manage database shouldnt be appeared. Refer to screen capture Actual result matched expected result
After
Before
150100000698
Test Case Objectives Test Data Expected Result Actual Result Conclusion
3 To register a new account Click Sign Up button Registration Page should be appeared. Refer to screen capture Actual result matched expected result
After
Before
150100000698
Test Case Objectives Test Data Expected Result Actual Result Conclusion
4 To add a new car seat product Click Add button All textboxes are enabled. Refer to screen capture Actual result matched expected result
Before
After
150100000698
A message Do You Want to Save This Record? will be prompted. Refer to screen capture Actual result matched expected result
Before
After
150100000698
A message A New Record has successfully been inserted? will be prompted. Refer to screen capture Actual result matched expected result
Before
After
150100000698
Before
After
150100000698
A message Do You Want to Save This Record? will be prompted. Refer to screen capture Actual result matched expected result
Before
After
150100000698
To confirm to save that record has been edited. Click Yes button A message A New Record has successfully been updated? will be prompted. Refer to screen capture Actual result matched expected result
Before
After
150100000698
A message Do You Want To Delete This Record? will be prompted. Refer to screen capture Actual result matched expected result
Before
After
150100000698
A message Record Has Been Deleted. will be prompted. Refer to screen capture Actual result matched expected result
Before
After
150100000698
Before
After
150100000698
To test Order menu is disabled before login Click Order button Nothing change Refer to screen capture Actual result matched expected result
Before
After
150100000698
To test Order menu is enabled after login as a member Click Order button Order Page will be appeared. Refer to screen capture Actual result matched expected result
Before
After
150100000698
To add product that you want to shopping cart Click Add button below each product A message Would you like to add this to cart? will be prompted. Refer to screen capture Actual result matched expected result
Before
After
150100000698
To check the product that you have added in your shopping cart Click Order button to go to order page A list of products that you have added are in your shopping cart Refer to screen capture Actual result matched expected result
Before
After
150100000698
Before
After
150100000698
To fill in all the information and confirm order Click Confirm Order button A message will be prompted. Refer to screen capture Actual result matched expected result
Before
After
150100000698
Before
After
150100000698
To fill in the information in feedback page and send it Click Send button A message Thank you ! We will take note your comments. will be prompted. Refer to screen capture Actual result matched expected result
Before
After
150100000698
Cancel to send the information about feedback. Click Cancel button A message Are you sure you want to cancel? will be prompted. Refer to screen capture Actual result matched expected result
Before
After
IT404.NET Wu Jian Min Test Log Test Case 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Result Successful Successful Successful Successful Successful Successful Successful Successful Successful Successful Successful Successful Successful Successful Successful Successful Successful Successful Successful Successful Successful
150100000698
150100000698
7. Implementation
User Guide
1. Insert CD into CD-ROM. Open the CD and look for [BabyAge] folder. Run the [BabyAge] SLN File.
2. Double click
3. Now you can see it is running by the web browser. 4. To register a new account. Click Sign Up button on log in form.
150100000698
5. To add some products to shopping cart. For example: add car seat product to shopping cart. Go to Car Seat Product Page and click Add button.
Go Order Page to check the products that you added in the shopping cart.
To confirm that you want to order these products. Click Process to Check button.
Password: admin@@
150100000698
150100000698
8. Conclusion
Strengthen 1. This program is user friendly. It is easy to add, edit and delete database. 2. This program is easy for customer to order online any time. 3. This program is secure to protect database. 4. The design of this program is pure and simple. Weakness 1. Customers can not view larger picture for every product. 2. Customers cannot be acknowledged any events. Enhancement 1. Making picture become larger that customers can view easily. 2. Add music as background.
150100000698
9. Reference
1. http://www.youtube.com/watch?v=HRjZ_0JpO2M 2. http://www.youtube.com/watch?v=x8D7HqB-glQ 3. http://www.youtube.com/watch?v=mtl0T8Nvuac 4. http://www.youtube.com/watch?v=SFQ-H6uhthI