Monday, June 1, 2015

ASP.NET,C# PhoneBook



TASK: A single contact PhoneBook web application
To download the source code, open the link below:

https://skydrive.live.com/?cid=86920718d1b9886d#cid=86920718D1B9886D&id=86920718D1B9886D%21104

On this page there is a rar file of PhoneBook. Download this file to get the source code.

For this task, you are required to create a single contact PhoneBook web application using Web Forms.
Your application must have the following pages:
1. Add Contact page:
·         First name (Text box – required filed)
·         Last name (Text box – required filed)
·         Area Code (Drop down list – required filed)
·         Phone Number (Text box – required filed, user should not be able to enter an invalid phone number and more than 8 digits)
·         Address (Text box – required filed)
·         State (Drop down list – required filed)
·         Email (Text box – required filed, should have a valid format)
·         Date of Birth (desired control – required)
·         Save button

Please note:
-          Once a contact is saved, the user will be redirected to the ‘Search Contact’ page.

2. Search Contact page:
·         Search by (Drop down list, containing ‘Last name’ and ‘Phone number’ options - upon selection of each option, the relevant search fields should appear)
·         Search phrase (Text box – required)
·         ‘Not Found’ error message (Label)
·         Search button
·         Result section containing:
-          Full name (Label)
-          Phone number (Label)

For this task, you need to create a web service:

- A web service for Add and Search Contact: This web service must contain three web methods:

1.      AddContact: This web method stores the contact information in a text file. You should make use of FileStream, StreamWriter and StreamReader objects, or others from System.IO namespace.

2.      SearchByLastname: This web method receives a last name and if it has been stored before, returns the full phone number (area code+phone number) of the user.

3.      SearchByPhone: This web method receives a phone number and if it has been stored before, returns the full name (first name+last name) of the user.

You will have to validate the area code to the corresponding state through JavaScript. Like:
States
AreaCode
NSW, ACT
02
VIC, TAS
03
QLD
07
WA, SA, NT
08

If the AreaCode and the State does not match then show an error: “The selected area code is not valid in the selected state!”

Please note:
-          You are not required to create multiple users for this task.
-          You  are required to check all the validations for this task.
-           Your web application is required to consume both web services.
-          Your final application should look like the following example (feel free to design the interface)

Error messages for required fields and invalid fields:



If the area code is not valid for the selected state, an error message will be displayed:


The Search page look like this:

No comments:

Post a Comment