Exemplo n.º 1
0
        private void Hall1(int hallID)
        {
            string SeatName  = "";
            bool   SeatAvail = false;
            double price     = 10.00;

            for (int i = 0; i < 14; i++)
            {
                for (int j = 0; j < 12; j++)
                {
                    SeatName  = "(row " + (14 - i) + " seat ";
                    SeatAvail = true;
                    if ((i == 0 || i > 11) && (j > 1 && j < 10))
                    {
                        SeatName += (j - 1) + ")";
                    }
                    else if (i > 2 && i < 11)
                    {
                        SeatName += (j + 1) + ")";
                    }
                    else if ((i == 1 || i == 2 || i == 11) && (j > 0 && j < 11))
                    {
                        SeatName += (j) + ")";
                    }
                    else
                    {
                        SeatName  = "(No Seat)";
                        SeatAvail = false;
                    }

                    //Give the right prices to the rigth seats
                    if ((j == 5 || j == 6) && (i > 4 && i < 9))
                    {
                        price = prices.Item1;
                    }
                    else if ((j == 5 || j == 6) && (i > 2 && i < 11))
                    {
                        price = prices.Item2;
                    }
                    else if ((j == 4 || j == 7) && (i > 3 && i < 10))
                    {
                        price = prices.Item2;
                    }
                    else if ((j == 3 || j == 8) && (i > 4 && i < 9))
                    {
                        price = prices.Item2;
                    }
                    else
                    {
                        price = prices.Item3;
                    }
                    AD.CreateSeat(price, i, j, hallID, SeatAvail, SeatName);
                }
            }
        }