Aptech Asp.net Assignments

Chapters: 2, 3, 4

Chapter 2:

  1. Create a Web form name login.aspx using web control as following:
  2. Create a text file to save user name and password on the server as following format: user/password
    When user click on Login button, read text file and compare with user name and password user submit. If they match redirect to index.aspx page (create in previous assigment), otherwise message to user they enter incorrect user name and password.
    If user check Remember my user on this computer, using cookies to write user name on user’computer
  3. When Page_Load, if user login successful at the last time and choose Remember my user on this computer, textbox user name should be automatically fill with user name. Both textbox and checkbox should be disabled
  4. If user click on Login as different user button, both textbox user name and checkbox should be enabled. Textbox user name should cleared. The cookies you save on user’computer should be cleared value.

Chapter 3:

  1. Create 3 Web form using web control as following:
    Depts.aspx

    – Department Name and Direct Manager can not be empty
    – If user enter Number of Staff, check whether it is a valid number
    – When click Save, save data to an xml file name depts.xml

    <?xml version=”1.0″?>
    <?xml-stylesheet type=’text/xsl’?>
    <!DOCTYPE Department[<!ENTITY D ‘Depts’>]>
    <!–Save Department data–>
    <Dept>
    <DeptName>Management</ DeptName>
    <NumOfStaff>5</ NumOfStaff>
    <Manager>Tiến</ Manager>
    <Notes>Phòng này toàn là xếp cả thôi</Notes>
    </ Dept>

    Emps.aspx

    – Employee Name, Date of Birth, Title, Department, and Join Date can not be empty
    – When form load combo Title has following data

    Key Value
    Manager Manager
    Receptionist Receptionist
    Waiter Waiter
    Driver Driver
    Door Bell Door Bell
    Supervisor Supervisor

    – Department has following data

    Key Value
    1 Management
    2 Serving
    3 Customer service

    – Check Date of Birth and Join date is valid date and check employee age >= 18, join date >= date of birth + 18 year
    – When click Save, save data to an xml file name emps.xml

    Custs.aspx

    – Customer Name can not be empty
    – When click Save, save data to an xml file name custs.xml

  2. Clear should clear all form.
  3. Create links from index.aspx to each form above

Chapter 4:

  1. Create 1 Web form using web control as following:
    Rooms.aspx

    –    On form load, Room type has data list below

    Key Value
    1 First class – Double
    2 First class – Single
    3 Second class – Double
    4 Second class – Single
    5 Normal

    –    Using RequiredFieldValidator for Room Number, Floor and Price, if user does not enter data then show appropriate error message
    –    Using RegularExpressionValidator for Room Number, user must enter 3 number character
    –    Using RangerValidator for Floor, number of floor must be between 1 and 9
    –    Using CompareValidator for Price, user must enter data is Double

  2. Open form Depts.aspx you create in previous section and do the following:
    –    Using RequiredFieldValidator for Department Name, Number of Staff and Direct Manager, if user does not enter data then show appropriate error message
    –    Using CompareValidator for Number of Staff, user must enter data is Integer
    –    Using RegularExpressionValidator for Department Name and Direct Manager, user can only enter alphabetic character
  3. Open form Emps.aspx you create in previous section and do the following:
    –    Using RequiredFieldValidator for Employee Name, Date of Birth and Join Date, if user does not enter data then show appropriate error message
    –    Using CompareValidator for Date of Birth, user must enter data is Date and employee age must be >= 18
    –    Using CompareValidator for Join Date, user must enter data is Date and Join Date must be >= Date of Birth + 18 years
    –    Using RegularExpressionValidator for Employee Name, user can only enter alphabetic character
  4. Open form Custs.aspx you create in previous section and do the following:-    Insert an combobox District above Phone as below–    Add 7 districts in Hà nội to combobox
    –    After user choose an District and enter Phone number, using CustomValidator to check whether phone number is match with District.
    Example: if district is Đống Đa, the first character in phone number must be 5, not the others (Ex: 5235649 not 8235649)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s