public async Task <IActionResult> Edit(int id, [Bind("EventsId,Information")] EventsInfo eventsInfo)
        {
            if (id != eventsInfo.EventsId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(eventsInfo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EventsInfoExists(eventsInfo.EventsId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(eventsInfo));
        }
Esempio n. 2
0
        public async Task <IActionResult> Edit(int id, [Bind("EnquiryId,Email,Message")] Enquiry enquiry)
        {
            if (id != enquiry.EnquiryId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(enquiry);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EnquiryExists(enquiry.EnquiryId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(enquiry));
        }
        public async Task <IActionResult> Edit(int id, [Bind("SessionId,CineplexId,MovieId,MovieTime")] SessionTime sessionTime)
        {
            if (id != sessionTime.SessionId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sessionTime);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SessionTimeExists(sessionTime.SessionId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            ViewData["CineplexId"] = new SelectList(_context.Cineplex, "CineplexId", "Location", sessionTime.CineplexId);
            ViewData["MovieId"]    = new SelectList(_context.Movie, "MovieId", "LongDescription", sessionTime.MovieId);
            return(View(sessionTime));
        }
        public async Task <IActionResult> Edit(int id, [Bind("MovieId,ImageUrl,LongDescription,Price,ShortDescription,Title")] Movie movie)
        {
            if (id != movie.MovieId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(movie);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MovieExists(movie.MovieId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(movie));
        }
Esempio n. 5
0
        public async Task <IActionResult> Edit(int id, [Bind("CineplexId,ImageUrl,Location,LongDescription,ShortDescription")] Cineplex cineplex)
        {
            if (id != cineplex.CineplexId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cineplex);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CineplexExists(cineplex.CineplexId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(cineplex));
        }
        public async Task <IActionResult> Edit(int id, [Bind("EventsId,EnquiryId")] EnquiryEvents enquiryEvents)
        {
            if (id != enquiryEvents.EventsId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(enquiryEvents);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EnquiryEventsExists(enquiryEvents.EventsId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            ViewData["EnquiryId"] = new SelectList(_context.Enquiry, "EnquiryId", "Email", enquiryEvents.EnquiryId);
            ViewData["EventsId"]  = new SelectList(_context.EventsInfo, "EventsId", "EventsId", enquiryEvents.EventsId);
            return(View(enquiryEvents));
        }
        public async Task <IActionResult> Edit()
        {
            var aBCDataContext     = _context.Reservation.Where(e => e.EnquiryId == 3);
            List <Reservation> res = await aBCDataContext.ToListAsync();

            String  userName = HttpContext.Session.GetString("userName");
            Enquiry enquiry  = await _context.Enquiry.SingleOrDefaultAsync(m => m.Email == userName);

            if (enquiry == null)
            {
                Enquiry en = new Enquiry();
                en.Email   = userName;
                en.Message = "";
                _context.Add(en);
                await _context.SaveChangesAsync();

                enquiry = await _context.Enquiry.SingleOrDefaultAsync(m => m.Email == userName);
            }
            ViewData["userid"] = enquiry.EnquiryId;

            foreach (Reservation reservation in res)
            {
                reservation.EnquiryId = enquiry.EnquiryId;
                try
                {
                    _context.Update(reservation);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ReservationExists(reservation.ReservationId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
            }
            return(RedirectToAction("UserResInfo"));
        }