Example #1
0
        public ActionResult Create(BookingVm bookingvm)
        {
            if (ModelState.IsValid)
            {
                var bookingBo = new BookingBo() { BookId = bookingvm.BookId, Customer = bookingvm.Customer, Email = "*****@*****.**" };
                try
                {
                    bookingServiceClient.AddBooking(bookingBo);
                }
                catch (FaultException ex)
                {
                    ModelState.AddModelError(string.Empty, ex.Message);
                    return View(bookingvm);
                }

                return RedirectToAction("Index", "Book");
            }

            return View(bookingvm);
        }
Example #2
0
 //
 // GET: /Booking/Delete/5
 public ActionResult Delete(int id)
 {
     // TODO find it
     BookingVm book = new BookingVm() { BookId = id, Customer = "To Delete" };
     return View(book);
 }
Example #3
0
 //
 // GET: /Booking/Create
 public ActionResult Create(int id)
 {
     var booking = new BookingVm() { BookId = id };
     return View(booking);
 }