Beispiel #1
0
        public ActionResult BookBlock(CreateBooking booking)
        {
            try
            {
                var userId = Session["UserId"].ToString();
                var user   = userService.GetUser(new Guid(userId));

                service.AddBlockBooking(
                    booking.BlockBooking.StartDate,
                    booking.BlockBooking.EndDate,
                    booking.BlockBooking.StartSlot,
                    booking.BlockBooking.EndSlot,
                    booking.Resource,
                    user.UserId);

                return(RedirectToAction("Index", new { successMessage = "Block bookings successfully added!" }));
            }
            catch
            {
                return(View("Create"));
            }
        }