public void Repository_Seat_deveria_gravar_um_novo_assento()
        {
            //Arrange
            Seat result = _repository.Add(_seat);

            result.Id.Should().BeGreaterThan(0);
        }
예제 #2
0
        public ActionResult AddNotation(MovieSessionSaloonVM item)
        {
            MovieSessionSaloon mss = new MovieSessionSaloon
            {
                MovieID   = item.Movie.ID,
                SessionID = item.Session.ID,
                SaloonID  = item.Saloon.ID
            };


            _mssRep.Add(mss);

            for (char j = 'A'; j < 'I'; j++)
            {
                for (int k = 1; k <= 14; k++)
                {
                    Seat seat = new Seat();
                    seat.SeatActive = false;
                    seat.SaloonID   = item.Saloon.ID;
                    seat.SessionID  = item.Session.ID;
                    seat.Character  = Convert.ToString(j);
                    seat.Number     = k;
                    _seaRep.Add(seat);
                }
            }



            return(RedirectToAction("SeansList"));
        }
예제 #3
0
        public int SeatAdd(mSeat newseat)
        {
            Seat seat = new Seat();

            seat_repo.Add(newseat.ToDb(seat));
            SubmitChanges();
            Auth useseatauth = new Auth {
                name = EnumDescription.GetFieldText(eAuthType.UseSeat) + " - " + seat.name,
                type = (int)eAuthType.UseSeat,
                key1 = seat.id
            };

            auth_repo.Add(useseatauth);
            Auth editseatauth = new Auth {
                name = EnumDescription.GetFieldText(eAuthType.EditSeat) + " - " + seat.name,
                type = (int)eAuthType.EditSeat,
                key1 = seat.id
            };

            auth_repo.Add(editseatauth);
            foreach (eSelpropType etype in Enum.GetValues(typeof(eSelpropType)))
            {
                Auth selpropauth = new Auth {
                    name = EnumDescription.GetFieldText(eAuthType.UseSeatProp) + " - " + EnumDescription.GetFieldText(etype) + " - " + seat.name,
                    type = (int)eAuthType.UseSeatProp,
                    key1 = seat.id,
                    key2 = (int)etype
                };
                auth_repo.Add(selpropauth);
            }
            foreach (eItemPropType etype in Enum.GetValues(typeof(eItemPropType)))
            {
                Auth itempropauth = new Auth {
                    name = EnumDescription.GetFieldText(eAuthType.UseSeatProp) + " - " + EnumDescription.GetFieldText(etype) + " - " + seat.name,
                    type = (int)eAuthType.UseSeatProp,
                    key1 = seat.id,
                    key2 = (int)etype
                };
                auth_repo.Add(itempropauth);
            }
            SubmitChanges();
            return(seat.id);
        }
예제 #4
0
 public void Add(Seat seat)
 {
     repository.Add(seat);
     repository.Save();
 }