Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
        // Delete an event on an existing calendar using PlanningLibrary (layered code on google calendar)
        public void deleteEvent(XmlDocument doc)
        {
            // Parsing data from XmlDocument
            XmlNodeList EventID    = doc.GetElementsByTagName("UUID");       // gets the event id (not calendar)
            XmlNodeList CalendarID = doc.GetElementsByTagName("event_UUID"); // event_UUID is the field to retrieve a CALENDAR id and NOT event

            // Logging parsed data
            Console.WriteLine(CalendarID[0].InnerText);
            Console.WriteLine(EventID[0].InnerText);

            // Delete a calendar, filled with parsed data from XmlDocument and finally sent with PlanningLibrary method.
            // Expects an event UUID and calendar UUID
            Eventss.IDeleteEventById(EventID[0].InnerText, CalendarID[0].InnerText);

            Console.WriteLine("Session successfully deleted");
            ControlRoom.SendConfirmationMessage("Planning: Session successfully deleted");
        }