Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            BookingClient client = new BookingClient();

            while (true)
            {
                try
                {
                    BookingData[] bookings =
                        client.ViewBookingsFrom(DateTime.Now);
                    Console.WriteLine("Det finns " + bookings.Length
                                      + " bokningar");

                    BookingData data = new BookingData();
                    data.Name           = Console.ReadLine();
                    data.EventStartTime = DateTime.Now;
                    data.EventStopTime  = DateTime.Now;
                    bool result = client.MakeBooking(data);
                    if (result)
                    {
                        Console.WriteLine("Bokningen lyckades");
                    }
                    else
                    {
                        Console.WriteLine("Bokningen misslyckades");
                    }
                }
                catch (WebException we)
                {
                    Console.WriteLine("Tjänsten failade");
                    Console.ReadLine();
                }
            }
        }
        // GET: Booking
        public ActionResult Index()
        {
            BookingClient      client   = new BookingClient();
            List <BookingData> bookings =
                client.ViewBookingsFrom(DateTime.Now);

            return(View(bookings));
        }