Example #1
0
    public static void RetrieveLessons()
    {
        IDataReader reader = DBCommands.RetrieveLessons();

        while (reader.Read())
        {
            int id     = Int32.Parse(reader[0].ToString());
            int roomId = Int32.Parse(reader[1].ToString());
            int floor  = Int32.Parse(reader[2].ToString());
            Debug.Log("date: " + reader[3].ToString().Split(' ')[0] + " " + reader[4].ToString().Split(' ')[1]);
            DateTime start       = Convert.ToDateTime(reader[3].ToString().Split(' ')[0] + " " + reader[4].ToString().Split(' ')[1]); // ????
            int      duration    = Int32.Parse(reader[5].ToString());
            int      idPromo     = Int32.Parse(reader[6].ToString());
            int      idProf      = Int32.Parse(reader[7].ToString());
            string   description = reader[8].ToString();

            Room  room    = GRoom.GetRoom(roomId, floor);
            User  teacher = GUser.GetUser(idProf);
            Promo promo   = GPromo.GetPromo(idPromo);
            CreateLesson(id, room, start, duration, teacher, promo, description);
        }
    }