Esempio n. 1
0
        public static void SaveCourseInfoToFile(List <Dictionary <string, string> > coursesInfo)
        {
            int fileIndex = 1;

            foreach (var courseDictionary in coursesInfo)
            {
                // Converting each cousre into a .csv file
                GCalenderEntry entry = new GCalenderEntry(courseDictionary);
                entry.SetField("Subject", "Course: " + entry.GetField("CourseCode"));
                var content = entry.GetCalenderAsText();
                Console.WriteLine(content);
                GCalenderEntry.GenerateCalenderFile(@"C:\Users\josh_\Documents\Cal", "Course" + fileIndex++, content, true);
            }
        }
Esempio n. 2
0
        static void GCalenderEntryTest()
        {
            string         course1 = "PROG W555W";
            GCalenderEntry entry1  = new GCalenderEntry();

            entry1.SetField("Code", course1);
            entry1.SetField("Subject", "School Course");
            entry1.StartDate = DateTime.Now.Date;
            entry1.SetField("StartDate", "10tvg");
            entry1.StartTime = DateTime.Parse("11:30:45");
            entry1.SetField("StartTime", "10:00");
            entry1.Subject = "Course";
            var content = entry1.GetCalenderAsText();

            Console.WriteLine(content);
            GCalenderEntry.GenerateCalenderFile(@"C:\Users\josh_\Documents\Cal", "Course1", content, true);
        }