예제 #1
0
        public static int[][] GenerateSeatState(SeatState seatState)
        {
            int[][] result = new int[seatState.Height][];
            for (int i = 0; i < seatState.Height; i++)
            {
                result[i] = new int[seatState.Width];
            }

            int count = 0;

            for (int i = 0; i < seatState.Height; i++)
            {
                for (int j = 0; j < seatState.Width; j++)
                {
                    result[i][j] = seatState.LstSeatStates[count].StateSeat;
                    count++;
                }
            }

            return(result);
        }
예제 #2
0
        public static SeatState ChangeStateSeat(int?xLocation, int?yLocation, int?type, SeatState seatState)
        {
            int?indexSelect = seatState.Width * yLocation + xLocation;

            seatState.LstSeatStates[(int)indexSelect].StateSeat = (int)type;
            return(seatState);
        }
예제 #3
0
        public static string ConvertBookingSessionToJson(SeatState seatState)
        {
            var temp = new JavaScriptSerializer().Serialize(seatState);

            return(temp);
        }