示例#1
0
        private void AddPassPartoutWeekToDB(PassParToutWeek passParToutWeek, int orderId)
        {
            if (passParToutWeek.Count > 0)
            {
                List <PassPartoutType> ppttList = passPartoutTypeRepository.GetAllPassPartoutType().ToList();

                foreach (PassPartoutType type in ppttList)
                {
                    if (type.Name.Equals(passParToutWeek.Type))
                    {
                        passParToutWeek.Id = type.Id;
                        break;
                    }
                }

                PassPartoutOrder passPartoutOrderWeek = new PassPartoutOrder
                {
                    OrderId       = orderId,
                    PassPartoutId = passParToutWeek.Id
                };

                for (int i = 0; i < passParToutWeek.Count; i++)
                {
                    passPartoutOrderRepository.AddPassPartoutOrder(passPartoutOrderWeek);
                }

                eventRepository.LowerAllAvailableSeats(passParToutWeek.Count);
            }
        }
示例#2
0
        private void AddPassPartoutDaysToDB(List <PassParToutDay> passParToutDays, int orderId)
        {
            foreach (PassParToutDay pd in passParToutDays)
            {
                List <PassPartoutType> ppttList = passPartoutTypeRepository.GetAllPassPartoutType().ToList();

                foreach (PassPartoutType type in ppttList)
                {
                    if (type.Name.Equals(pd.Day))
                    {
                        pd.Id = type.Id;
                        break;
                    }
                }

                PassPartoutOrder passPartoutOrder = new PassPartoutOrder
                {
                    OrderId       = orderId,
                    PassPartoutId = pd.Id
                };

                for (int i = 0; i < pd.Count; i++)
                {
                    passPartoutOrderRepository.AddPassPartoutOrder(passPartoutOrder);
                }

                Day day = dayRepository.GetDayByName(pd.Day);

                eventRepository.LowerAvailableSeatsforDay(day.Id, pd.Count);
            }
        }
示例#3
0
 public void AddPassPartoutOrder(PassPartoutOrder passPartoutOrder)
 {
     db.PassPartoutOrder.Add(passPartoutOrder);
     db.SaveChanges();
 }