Exemple #1
0
        public static void testEvent()
        {
            GService g = new GService();
            // these always need to be changed before testing
            string uuid         = "UUIDTESTefefERezfzesefeKE12&";
            string uuid2        = "efeefefe";
            string uuid3        = "efefefefefef";
            string calendarName = "test12345634567VIJF";
            Person testPerson   = makePerson("testName2", "TestLastName", "*****@*****.**");

            Attendee.InewAttendee(testPerson, uuid, "1");
            IList <EventAttendee> attendees = new List <EventAttendee>();
            EventAttendee         test      = new EventAttendee()
            {
                //Email = "testname2",
                DisplayName = "*****@*****.**"
            };

            IList <string> UUIDS = new List <string>();

            UUIDS.Add(testPerson.UserDefined[0].Value);

            Console.WriteLine("attendee created");
            Console.ReadKey();

            //create event
            //create calendar
            var testCalendar = Calendarss.InewCalendar(makeCalendar(calendarName), uuid3, "1");

            DateTime start = new DateTime(2019, 5, 7, 14, 30, 0);
            DateTime end   = new DateTime(2019, 5, 7, 15, 30, 0);

            Google.Apis.Calendar.v3.Data.Event ev = makeEvent("1223432123HG23F2V32H2", "tesstlocation", "testDisc", start, end, convertPersonToAttendee(UUIDS));
            Eventss.InewEvent(ev, uuid3, uuid2, "1");
            Console.WriteLine("event created");
            Console.ReadKey();

            //update event
            ev.Summary = "newTestsSummery";

            Eventss.IupdateEventById(ev, uuid3, uuid2, "2");
            Console.WriteLine("event updated");
            Console.ReadKey();

            //delete event
            Eventss.IDeleteEventById(uuid2, uuid3);
            Calendarss.IdeleteCalendarById(uuid3);
            Console.WriteLine("event deleted");
            Console.ReadKey();
        }
Exemple #2
0
        // Create a calendar using PlanningLibrary (layered code on google calendar)
        public void createCalendar(XmlDocument doc)
        {
            // Parsing data from XmlDocument
            XmlNodeList titel      = doc.GetElementsByTagName("eventName");
            XmlNodeList id         = doc.GetElementsByTagName("UUID");
            XmlNodeList xmlVersion = doc.GetElementsByTagName("version");

            // Logging parsed data
            Console.WriteLine(titel[0].InnerText);
            Console.WriteLine(id[0].InnerText);
            Console.WriteLine(xmlVersion[0].InnerText);

            // Creating a new <google.api> calendar, filled with parsed data from XmlDocument and finally sent with PlanningLibrary method.
            // Expects a <google.api> calendar, UUID, version
            Google.Apis.Calendar.v3.Data.Calendar calendar = new Google.Apis.Calendar.v3.Data.Calendar();
            calendar.Summary = titel[0].InnerText;
            Calendarss.InewCalendar(calendar, id[0].InnerText, "1");

            Console.WriteLine("Event successfully created");
            ControlRoom.SendConfirmationMessage("Planning: Event successfully created");
        }
Exemple #3
0
        public static void testCalendar()
        {
            GService g    = new GService();
            string   uuid = "testUUID3";
            //create calendar
            //!ALways change the UUID!
            var testCalendar = Calendarss.InewCalendar(makeCalendar("calTest"), uuid, "1");

            Console.WriteLine("calendar created");
            Console.ReadKey();

            //update Calendar
            testCalendar.Summary = "updateCalTest";
            Calendarss.IupdateCalendarById(testCalendar, uuid, "2");
            Console.WriteLine("calendar updated");
            Console.ReadKey();

            //delete Calendar
            Calendarss.IdeleteCalendarById(uuid);
            Console.WriteLine("calendar deleted");
            Console.ReadKey();
        }