Exemplo n.º 1
0
        public ViewResult Book(BookingModel model)
        {
            var request = new BookRequest
            {
                RoomNumber = model.RoomNumber,
                PersonName = model.PersonName,
                BeginAt = model.BeginAt,
                EndAt = model.EndAt
            };

            var binding = new NetTcpBinding();
            var endpointAddress = new EndpointAddress("net.tcp://*****:*****@ViewBag.Title = "Booking completed";
                return View("Success", model);
            }

            @ViewBag.Title = "Booking failed";
            @ViewBag.Message = result.Message;

            return View("Failed");
        }
Exemplo n.º 2
0
 public IAsyncResult BeginBook(BookRequest request, AsyncCallback callback, object state)
 {
     var bookTask = new BookTask(request, _register);
     var asyncWrap = new AsyncTaskWrap<BookTask, Booking>(bookTask, x => x.Result, callback, state);
     _executor.Execute(asyncWrap);
     return asyncWrap;
 }
Exemplo n.º 3
0
 public BookTask(BookRequest request, BookRegister register)
 {
     _request = request;
     _register = register;
 }