예제 #1
0
            private static void addTravelDetails()
            {
                if (blog.CurrentUser == null)
                {
                    Console.WriteLine("U have not logged in to Post a Travel Info");
                    Console.WriteLine("Please login to add new details");
                    return;
                }
                Travel details = new Travel();

                details.NoOfDays        = MyConsole.GetNumber("Enter the No of days of Travel");
                details.ModeOfTransport = MyConsole.GetMode();
                details.DateOfTravel    = MyConsole.GetDate("Enter the date as dd/MM/yyyy");
                details.Destination     = MyConsole.GetString("Enter UR place of Visit");
                details.UserDetails     = blog.CurrentUser;
                details.Details         = MyConsole.GetString("Please enter UR Experience in the Travel to be shared to all our visitors");
                try
                {
                    blog.AddTravelDetails(details);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }