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); }
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); }
public static string ConvertBookingSessionToJson(SeatState seatState) { var temp = new JavaScriptSerializer().Serialize(seatState); return(temp); }