Example #1
0
        public static void swap(seat a, seat b)
        {
            // need to consider each field while swapping
            seat t = new seat(a.Name, a.Row, a.Col);

            a.Name = b.Name; a.Col = b.Col; a.Row = b.Row;
            b.Name = t.Name; b.Col = t.Col; b.Row = t.Row;
        }
Example #2
0
        public static List <seat> ReadSeatList(FileStream fs, DataTable dt)
        {
            BinaryReader br    = new BinaryReader(fs);
            long         nor   = NofRows * NofCols;
            List <seat>  seats = new List <seat>();

            for (int i = 0; i < nor; i++)
            {
                fs.Seek(i * seat.Size(), 0);
                string name = br.ReadString();
                int    r    = br.ReadInt32();
                int    c    = br.ReadInt32();
                dt.Rows[r][c] = name;
                seat s = new seat(name, r, c);
                //  MessageBox.Show(s.Name);
                seats.Add(s);
            }
            return(seats);
        }