コード例 #1
0
        public ViewResult CreateSeat()
        {
            SeatModelUI seatData = new SeatModelUI
            {
                NumberSeat = SeatsData.Count() + 1
            };

            return(View(seatData));
        }
コード例 #2
0
        public ViewResult Edit(SeatModel seatdata)
        {
            SeatModelUI seatData = new SeatModelUI
            {
                NumberSeat = seatdata.NumberSeat,
                IsReserve  = seatdata.PersonId != null
            };

            return(View(seatData));
        }
コード例 #3
0
        public ViewResult Details(SeatModel seatdata)
        {
            PersonModel personModel = new PersonModel();

            if (seatdata.PersonId != null)
            {
                personModel = DataProcessor.FindPerson(seatdata.PersonId);
            }

            SeatModelUI seatData = new SeatModelUI
            {
                NumberSeat = seatdata.NumberSeat,
                IsReserve  = seatdata.PersonId != null,
                FirstName  = personModel.FirstName,
                LastName   = personModel.LastName
            };

            return(View(seatData));
        }
コード例 #4
0
        public ActionResult CreateSeat(SeatModelUI seatModelUI)
        {
            if (ModelState.IsValid)
            {
                SeatModel seatModel = new SeatModel
                {
                    PersonId    = null,
                    MovieNumber = NumberMovie,
                    NumberSeat  = seatModelUI.NumberSeat
                };
                DataProcessor.InsertSeatModelElement(seatModel.NumberSeat,
                                                     default(int), NumberMovie);

                return(RedirectToAction("Manage_Seats"));
            }
            else
            {
                return(View(seatModelUI));
            }
        }
コード例 #5
0
 public ActionResult Edit(SeatModelUI seatModelUI)
 {
     if (ModelState.IsValid)
     {
         if (seatModelUI.IsReserve)
         {
             DataProcessor.UpdateSeatData(seatModelUI.FirstName, seatModelUI.LastName, seatModelUI.IsReserve
                                          , seatModelUI.NumberSeat, NumberMovie);
         }
         else
         {
             DataProcessor.UpdateSeatData("", "", seatModelUI.IsReserve
                                          , seatModelUI.NumberSeat, NumberMovie);
         }
         return(RedirectToAction("Manage_Seats"));
     }
     else
     {
         return(View(seatModelUI));
     }
 }