Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Application with Dataase

Similar presentations


Presentation on theme: "Web Application with Dataase"— Presentation transcript:

1 Web Application with Dataase
CS 3870/CS 5870: Note06 Prog3 Web Application with Dataase

2 AutoPostBack Control property Button Textbox Others Default: True
Default: False Others Should double check

3 Page Shopping Property AutoPastBack of Textbox Must be True to fire Textchanged event (When focus leaves the textbox)

4 Textchanged Event of Textbox txtID
‘ Clear other textboxes id = txtID.Text.Trim Dim row as Data.DataRow row = SQLDataClass.tblProducts.Rows.Find(id) If row Is Nothing Then ‘ not found txtID.Focus() Else ‘ Found txtQuanity.Focus() End If

5 Textchanged Event of Textbox txtID
If row Is Nothing Then ‘ not found Session(“Prog3_ID”) = “” txtID.Focus() Else ‘ Found txtName.Text = row(1) price = row(2) txtPrice.Text = FormatCurrency(price) Session("Prog3_Price") = price Session("Prog3_ID") = id txtQuanity.Focus() End If

6 Textchanged Event of txtQuantity
If Session("Prog3_ID") = "" Then txtID.Focus() Exit Sub End If ‘ Otherwise, need to parse txtPrice or search database price = Session("Prog3_Price") subTotal = quanity * price tax = subTotal * grandTotal = subTotal + tax ‘ Display result

7 DBNull ‘ Page Updating ‘ Procedure DisplayRow ‘ finding the row txtID.Text = row(0) txtName.Text = row(1) txtPrice.Text = FormatCurrency(row(2)) // Description is not required If TypeOf (row(3)) Is DBNull Then txtDescription.Text = "" Else txtDescription.Text = row(3) End If ManageButtons()

8 Validating Input txtID txtQuantity No need to do it
Database will check it txtQuantity Validator No Validator Your choice Prog3 of CS3870 does not use Validator

9 Grading You will lose 15 points if page Default.aspx cannot access the database. You will lose 10 points if page Updating.aspx or page Shopping.aspx cannot work correctly with the database.

10 Grading You must follow the Programming Rules

11 Comment Block For code files only
Including Global.asax and SQLDataClass Not for *.aspx or .master files

12 Programming Rules Your Web pages should be the same as the sample pages.

13 Prog3 Global.asax Web.config <customErrors mode="Off"/>
<compilation debug=“true" targetFramework="4.5"> Price: reject 0 Quantity: accept 0

14 Test 1 50 points Tuesday (week 5), October 3 Lab 206 2:00 – 4:00
Based on Prog3

15 Test 1 Grading Cannot display records in GridView: -15
Cannot display individual records: -15 Formatting GridView: 5 points Placing controls: 5 points Checking input: 5 points Help: -5


Download ppt "Web Application with Dataase"

Similar presentations


Ads by Google