Likes

Developing Windows Azure and Web Services Lab @ 3 Ans 2

Modify the BlueYonder.FlightDetails project to allow users to update the schedule departure of specific flight.



To implement the required functionality, you need to perform the following tasks:
1. Browse to the location where the Exercise 04.zip file is saved.
2. Extract the files.
3. Double-click the Exercise 04 folder.
4. Double-click the BlueYonder.Companion folder.
5. Double-click the BlueYonder.Companion.sin file. The BlueYonder.Companion - Microsoft Visual Studio window displayed.
6. Ensure that the Solution Explorer window is opened.
7. Ensure that the BlueYonder.FlightDetails node is expanded.
8. Double-click the Program.es file within the BlueYonder.FlightDetails node. The Program.es file is displayed.
9. Type the highlighted portions of the following code snippet in the Program.es file:
if (flightDetails != null)
{
Console.WriteLine("The flight starts from " + flightDetails.Source.City H ”, " + flightDetails.Source.Country + " for " + flightDetails.Destination.City + ”, " + flightDetails.Destination.Country +
}
else
{
Console.WriteLine("Invalid Flight Number.");
>
Console.WriteLine("\nDo you want to update the Flight Schedule? Enter Yes or
No");
string ans = Console.ReadLine(); if (ans.ToLower() == "yes")
{
Console.WriteLine("Enter the date in the MM/DD/YYYY format:"); string date = Console.ReadLine();
Console.WriteLine("Enter the time in the HH:MM:SS format:");
string time = Console.ReadLineQ;
string dateTime = date + " " + time;
foreach (var item in flightDetails.Schedules)
{
item.Departure = Convert.ToDateTime(dateTime)j bdbc .SaveChangesQi
}
Console.WriteLine("\nFlight Schedule is updated")$
}
Console.WriteLine("\nPress the ENTER key to close the application.") Console .ReadLineQ ;
10. Select FILE—Save All to save the changes
11. Select TEST—Windows—Test Explorer The Test Explorer window is displayed
12. Click Run All, and then wait for all the tests to complete.
13. Press the F5 key The output is displayed,
14. Enter a flight number, and then press the Enter key. The details of the specified flight is displayed.
15. Enter Yes. and then press the Enter key to update the flight schedule.
16. Enter the date in the specified format, and then press the Enter key.
17. Enter the time in the specified format, and then press the Enter key. The flight schedule is updated.
18. Press the Enter key to close the Console window.
19. Open SQL Server Management Studio, and connect to the ASQLExpress database server.
20. Expand the Databases node in the Object Explorer window, and then expand the BlueYonder.Companion.Lab02
database.
21. Expand the Tables nodes.
22. Right-click the FlightSchedules table, and then select Select Top 1000 Rows. The FlightSchedules table is displayed with updated record.
23. Close the SQL Server Management window.
24. Switch to Microsoft Visual Studio 2012, and close it.

No comments: