コード例 #1
0
        /// <summary>
        /// Converts a string from the database to a jagged array
        /// </summary>
        /// <param name="schID">The scheduler ID of the seats you want to convert</param>
        /// <returns>Returns the jagged array</returns>
        public int[][] ConvertStringToArray(int schID)
        {
            DBSeat dbSeat           = new DBSeat();
            var    seatListoperator = dbSeat.GetSeats(schID);
            int    count            = seatListoperator.Count();


            int[][] jagged = new int[count][];

            for (int row = 0; row < count; row++)
            {
                Seat s          = seatListoperator.ElementAt(row);
                int  i          = 0;
                int  lengthChar = (1 + s.ColumnArray.Count()) / 2;
                jagged[row] = new int[lengthChar];
                foreach (char c in s.ColumnArray)
                {
                    if (!c.Equals(','))
                    {
                        jagged[row][i] = (int)Char.GetNumericValue(c);
                        i++;
                    }
                }
            }

            return(jagged);
        }
コード例 #2
0
        /// <summary>
        /// Gets all seats by a scheduler ID
        /// </summary>
        /// <param name="schedulerID">The ID of the scheduler</param>
        /// <returns>Returns a list of seats</returns>
        public List <Seat> GetAllSeatsBySchedulerID(int schedulerID)
        {
            DBSeat dbSeat = new DBSeat();

            return(dbSeat.GetSeats(schedulerID));
        }