Example #1
0
 public static List<DBClassRoom> GetClassRooms(SqlConnection connection)
 {
     string commandText = "select IDrooms,Housing,Number from ClassRooms order by IDrooms asc";
     SqlCommand command = new SqlCommand(commandText, connection);
     DataTable dtClassRooms = FilingDT(command);
     DBClassRoom[] classRooms = new DBClassRoom[dtClassRooms.Rows.Count];
     for (int rowIndexRooms = 0; rowIndexRooms < dtClassRooms.Rows.Count; rowIndexRooms++)
     {
         //список всех типов  для данной аудитории получаем
         commandText = "select IDTypes,flag from ClassRoomsTypes where IDrooms=@IDrooms order by IDTypes asc";
         command = new SqlCommand(commandText, connection);
         command.Parameters.AddWithValue("@IDrooms", Convert.ToInt32(dtClassRooms.Rows[rowIndexRooms][0].ToString()));
         DataTable dttypes = FilingDT(command);
         int[] ClassRoomsTypesRoom = new int[dttypes.Rows.Count];
         BitArray secondTypesMask = new BitArray(dttypes.Rows.Count, false);
         for (int rowIndexTypes = 0; rowIndexTypes < dttypes.Rows.Count; rowIndexTypes++)
         {
             ClassRoomsTypesRoom[rowIndexTypes] = Convert.ToInt32(dttypes.Rows[rowIndexTypes][0].ToString());
             if (Convert.ToInt32(dttypes.Rows[rowIndexTypes][1].ToString()) == 1)
             {
                 secondTypesMask[rowIndexTypes] = true;
             }
         }
         classRooms[rowIndexRooms] = new DBClassRoom(Convert.ToInt32(dtClassRooms.Rows[rowIndexRooms][0].ToString()),
                                         Convert.ToInt32(dtClassRooms.Rows[rowIndexRooms][2].ToString()),
                                         Convert.ToInt32(dtClassRooms.Rows[rowIndexRooms][1].ToString()),
                                         ClassRoomsTypesRoom.ToList(),
                                         secondTypesMask);
     }
     return classRooms.ToList();
 }
Example #2
0
 public static List<DBClassRoom> GetClassRooms()
 {
     DBClassRoom[] cl = new DBClassRoom[35];
     cl[0] = new DBClassRoom(0, 410, 2, new List<int> { 0, 7 }, new System.Collections.BitArray(new bool[] { false, true }));
     cl[1] = new DBClassRoom(1, 411, 4, new List<int> { 0 });
     cl[2] = new DBClassRoom(2, 409, 2, new List<int> { 0 });
     cl[3] = new DBClassRoom(3, 412, 2, new List<int> { 0, 1 });
     cl[4] = new DBClassRoom(4, 213, 2, new List<int> { 0 });
     cl[5] = new DBClassRoom(5, 202, 2, new List<int> { 0 });
     cl[6] = new DBClassRoom(6, 502, 2, new List<int> { 0 });
     cl[7] = new DBClassRoom(7, 111, 2, new List<int> { 0, 4 });
     cl[8] = new DBClassRoom(8, 301, 2, new List<int> { 0 });
     cl[9] = new DBClassRoom(9, 416, 2, new List<int> { 2 });
     cl[10] = new DBClassRoom(10, 518, 2, new List<int> { 2 });
     cl[11] = new DBClassRoom(11, 517, 2, new List<int> { 2 });
     cl[12] = new DBClassRoom(12, 439, 1, new List<int> { 2 });
     cl[13] = new DBClassRoom(13, 401, 3, new List<int> { 2 });
     cl[14] = new DBClassRoom(14, 203, 1, new List<int> { 2 });
     cl[15] = new DBClassRoom(15, 231, 1, new List<int> { 2 });
     cl[16] = new DBClassRoom(16, 516, 2, new List<int> { 2 });
     cl[17] = new DBClassRoom(17, 511, 2, new List<int> { 2 });
     cl[18] = new DBClassRoom(18, 514, 2, new List<int> { 3, 1 });
     cl[19] = new DBClassRoom(19, 311, 4, new List<int> { 3 });
     cl[20] = new DBClassRoom(20, 405, 2, new List<int> { 1 });
     cl[21] = new DBClassRoom(21, 404, 2, new List<int> { 3, 4 });
     cl[22] = new DBClassRoom(22, 207, 2, new List<int> { 4 });
     cl[23] = new DBClassRoom(23, 204, 2, new List<int> { 1, 4 });
     cl[24] = new DBClassRoom(24, 402, 2, new List<int> { 4 });
     cl[25] = new DBClassRoom(25, 419, 1, new List<int> { 1 });
     cl[26] = new DBClassRoom(26, 216, 2, new List<int> { 4 });
     cl[27] = new DBClassRoom(27, 0, 1, new List<int> { 5 });
     cl[28] = new DBClassRoom(28, 1, 1, new List<int> { 6 });
     cl[29] = new DBClassRoom(29, 254, 1, new List<int> { 1 });
     cl[30] = new DBClassRoom(30, 401, 4, new List<int> { 1 });
     cl[31] = new DBClassRoom(31, 512, 2, new List<int> { 1 });
     cl[32] = new DBClassRoom(32, 527, 1, new List<int> { 1 });
     cl[33] = new DBClassRoom(33, 506, 2, new List<int> { 1 });
     cl[34] = new DBClassRoom(34, 316, 2, new List<int> { 7 });
     return cl.ToList();
 }