예제 #1
0
        public ActionResult CancleReservation(int id)
        {
            var book   = bookOperations.FindById(id);
            var userId = User.Identity.GetUserId();

            try
            {
                userOperations.CancleBooking(book, userId);
                book.UserId = null;
                db.SaveChanges();
            }
            catch
            {
                return(View("Index"));
            }

            return(RedirectToAction("ShowBookedBooks"));
        }