示例#1
0
    void Start()
    {
        if (!String.IsNullOrEmpty(PlayerPrefs.GetString("RoomName")))
        {
            Room room = GRoom.GetRoom(PlayerPrefs.GetString("RoomName"));

            if (room != null)
            {
                roomText.text = room.Appelation;

                // PlayerPrefs.SetString("today", date);  "2019-02-11"

                /*int year = Int32.Parse(PlayerPrefs.GetString("today").Split('-')[0]);
                 * int month = Int32.Parse(PlayerPrefs.GetString("today").Split('-')[1]);
                 * int day = Int32.Parse(PlayerPrefs.GetString("today").Split('-')[2]);*/

                display(new DateTime(2019, 02, 11, 8, 0, 0), room, monday810);
                display(new DateTime(2019, 02, 11, 10, 0, 0), room, monday1012);
                display(new DateTime(2019, 02, 11, 12, 0, 0), room, monday1214);
                display(new DateTime(2019, 02, 11, 14, 0, 0), room, monday1416);
                display(new DateTime(2019, 02, 11, 16, 0, 0), room, monday1618);

                display(new DateTime(2019, 02, 12, 8, 0, 0), room, tuesday810);
                display(new DateTime(2019, 02, 12, 10, 0, 0), room, tuesday1012);
                display(new DateTime(2019, 02, 12, 12, 0, 0), room, tuesday1214);
                display(new DateTime(2019, 02, 12, 14, 0, 0), room, tuesday1416);
                display(new DateTime(2019, 02, 12, 16, 0, 0), room, tuesday1618);

                display(new DateTime(2019, 02, 13, 8, 0, 0), room, wednesday810);
                display(new DateTime(2019, 02, 13, 10, 0, 0), room, wednesday1012);
                display(new DateTime(2019, 02, 13, 12, 0, 0), room, wednesday1214);
                display(new DateTime(2019, 02, 13, 14, 0, 0), room, wednesday1416);
                display(new DateTime(2019, 02, 13, 16, 0, 0), room, wednesday1618);

                display(new DateTime(2019, 02, 14, 8, 0, 0), room, thursday810);
                display(new DateTime(2019, 02, 14, 10, 0, 0), room, thursday1012);
                display(new DateTime(2019, 02, 14, 12, 0, 0), room, thursday1214);
                display(new DateTime(2019, 02, 14, 14, 0, 0), room, thursday1416);
                display(new DateTime(2019, 02, 14, 16, 0, 0), room, thursday1618);

                display(new DateTime(2019, 02, 15, 8, 0, 0), room, friday810);
                display(new DateTime(2019, 02, 15, 10, 0, 0), room, friday1012);
                display(new DateTime(2019, 02, 15, 12, 0, 0), room, friday1214);
                display(new DateTime(2019, 02, 15, 14, 0, 0), room, friday1416);
                display(new DateTime(2019, 02, 15, 16, 0, 0), room, friday1618);

                weekText.text = "Sem. du " + PlayerPrefs.GetString("today");
            }
        }
    }
示例#2
0
    void Start()
    {
        if (!String.IsNullOrEmpty(PlayerPrefs.GetString("RoomName")))
        {
            roomText.text = PlayerPrefs.GetString("RoomName");
            Room room = GRoom.GetRoom(PlayerPrefs.GetString("RoomName"));

            if (room != null)
            {
                typeText.text     = "Salle de " + room.Type;
                nbPlacesText.text = room.NPlaces.ToString();
                nbPCsText.text    = room.NPCs.ToString();
            }
        }
    }
示例#3
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);
        }
    }