예제 #1
0
        private static async void DoSomething()
        {
            ApiWrapper.Host     = new Uri("http://detussenschool.nl/elo/");
            ApiWrapper.ApiToken = "1e2b4d58bb7873fedb15ed705fd3e165";

            // var token = await ApiWrapper.GetApiToken("tom", "MK3$tpthggguhdwu", "services");

            var names = new string[] { "event41", "event42", "event43", "event44", "event45", "event46",
                                       "event21", "event22", "event23", "event24", "event25", "event26",
                                       "event31", "event32", "event33", "event34", "event35", "event36" };
            var starttimes = new DateTime[]
            {
                DateTime.Today.AddDays(11).AddHours(8),
                DateTime.Today.AddDays(12).AddHours(8),
                DateTime.Today.AddDays(12).AddHours(8),
                DateTime.Today.AddDays(12).AddHours(8),
                DateTime.Today.AddDays(12).AddHours(8),
                DateTime.Today.AddDays(12).AddHours(8),

                DateTime.Today.AddDays(1).AddHours(10),
                DateTime.Today.AddDays(2).AddHours(10),
                DateTime.Today.AddDays(3).AddHours(10),
                DateTime.Today.AddDays(4).AddHours(10),
                DateTime.Today.AddDays(5).AddHours(10),
                DateTime.Today.AddDays(6).AddHours(10),

                DateTime.Today.AddDays(1).AddHours(12),
                DateTime.Today.AddDays(2).AddHours(12),
                DateTime.Today.AddDays(3).AddHours(12),
                DateTime.Today.AddDays(4).AddHours(12),
                DateTime.Today.AddDays(5).AddHours(12),
                DateTime.Today.AddDays(6).AddHours(12),
            };
            var durations = new TimeSpan[]
            {
                TimeSpan.FromMinutes(50),
                TimeSpan.FromMinutes(50),
                TimeSpan.FromMinutes(50),
                TimeSpan.FromMinutes(50),
                TimeSpan.FromMinutes(50),
                TimeSpan.FromMinutes(50), TimeSpan.FromMinutes(50),
                TimeSpan.FromMinutes(50),
                TimeSpan.FromMinutes(50),
                TimeSpan.FromMinutes(50),
                TimeSpan.FromMinutes(50),
                TimeSpan.FromMinutes(50), TimeSpan.FromMinutes(50),
                TimeSpan.FromMinutes(50),
                TimeSpan.FromMinutes(50),
                TimeSpan.FromMinutes(50),
                TimeSpan.FromMinutes(50),
                TimeSpan.FromMinutes(50),
            };
            var courses = await ApiWrapper.GetCourses();

            var course = courses.DataArray.Last();

            var group =
                await
                ApiWrapper.CreateGroups(new string[] { "Test" }, new int[] { course.id },
                                        new string[] { "de beschrijving van de group" });

            ApiWrapper.group
            //  var result = ApiWrapper.CreateCalanderEvents(course.Result.Data.)

//
//            var events = await ApiWrapper.GetCalanderEvents();
//            int[] eventids = new int[events.Data.events.Count];
//            int[] repeats = new int[eventids.Length];
//            for (int i = 0; i < events.Data.events.Count; i++)
//            {
//                eventids[i] = events.Data.events[i].id;
//                repeats[i] = 0;
//            }
//
//
//            var obj = await ApiWrapper.DeleteCalanderEvents(
//                eventids, repeats);
//
//
            Console.WriteLine(ObjectDumper.Dump(course));
        }