Exemplo n.º 1
0
        public IActionResult BookingVenue(BookingVenue BookingVenue)
        {
            if (ModelState.IsValid)
            {
                BookingDetails BD = new BookingDetails
                {
                    BookingDate     = BookingVenue.BookingDate,
                    Createdby       = Convert.ToInt32(HttpContext.Session.GetString("UserID")),
                    CreatedDate     = DateTime.Now,
                    BookingApproval = "P"
                };

                var result = _IBookingVenue.BookEvent(BD);

                BookingVenue BV = new BookingVenue
                {
                    VenueID     = BookingVenue.VenueID,
                    EventTypeID = BookingVenue.EventTypeID,
                    GuestCount  = BookingVenue.GuestCount,
                    Createdby   = Convert.ToInt32(HttpContext.Session.GetString("UserID")),
                    CreatedDate = DateTime.Now,
                    BookingID   = result
                };

                var VenueID = _IBookingVenue.BookVenue(BV);

                HttpContext.Session.SetInt32("BookingID", result);

                if (result > 0)
                {
                    SetSlider();
                    ModelState.Clear();
                    ViewData["BookingMessage"] = "Venue Booked Successfully";
                    return(View("Success"));
                }
                else
                {
                    SetSlider();
                    return(View("BookingVenue", BookingVenue));
                }
            }
            else
            {
                SetSlider();
                return(View("BookingVenue", BookingVenue));
            }
        }