Exemple #1
0
        public static List <Ticket> sellTicket(ref TicketEmission emission, int adultsNum, int childrensNum)
        {
            //emission.ticketsSet.Where<Ticket>(t => t.place == place).First().isSold = true;
            //emission.currentQuantity--;
            List <Ticket> arTick = new List <Ticket>();
            var           elems  = emission.ticketsSet.Where <Ticket>(t => t.isSold == false).ToList();

            for (int i = 0; i <= adultsNum + childrensNum - 1; i++)
            {
                var el = elems.ElementAt(i);
                el.isSold = true;
                arTick.Add(el);
                emission.currentQuantity--;
            }
            return(arTick);
        }
Exemple #2
0
 public static int sellTicket(ref TicketEmission emission, ApplicationUser user, int place, int curEmissionId)
 {
     emission.ticketsSet.Where <Ticket>(t => t.place == place).First().isSold = true;
     emission.currentQuantity--;
     return(10);
 }
Exemple #3
0
 public static int reserve(TicketEmission emission, ApplicationUser user, int place)
 {
     return(0);
 }
Exemple #4
0
 public void getCurrentQuantity(TicketEmission emission)
 {
 }