Example #1
0
        public void CreateAndCancelAppointmentRequestSelfTest()
        {
            var app = new AppointmentRequestParams();

            app.Subject   = "到台灣銀行洽工 ";
            app.StartDate = new DateTime(2017, 4, 11, 08, 30, 0);
            app.EndDate   = new DateTime(2017, 4, 11, 12, 00, 0);
            app.Organizer = new Attendee {
                Email = "*****@*****.**", DisplayName = "亂馬客"
            };

            ZmailRequest.ApiRequest = new CreateAppointmentRequest(app);
            var zResquest = ZmailDispatcher.SendRequest(ZmailRequest);
            var resp      = zResquest.ApiResponse as CreateAppointmentResponse;
            var appResp   = resp?.AppointmentResponse;

            Console.WriteLine($"{appResp?.InviteMessageId}");

            var appCancelParam = new CancelAppointmentRequestParam();

            appCancelParam.Subject   = app.Subject;
            appCancelParam.Body      = $"取消: {app.Subject}";
            appCancelParam.Id        = appResp?.InviteMessageId;
            appCancelParam.Attendees = new List <Attendee>
            {
                app.Organizer
            };
            ZmailRequest.ApiRequest = new CancelAppointmentRequest(appCancelParam);
            zResquest = ZmailDispatcher.SendRequest(ZmailRequest);
            var resp2 = zResquest.ApiResponse as CancelAppointmentResponse;
        }
Example #2
0
        public void CancelAppointmentRequestSelfTest()
        {
            var appCancelParam = new CancelAppointmentRequestParam();

            appCancelParam.Subject   = "到台灣銀行洽工 ";
            appCancelParam.Body      = "取消:到台灣銀行洽工 ";
            appCancelParam.Id        = "32326-32325";
            appCancelParam.Attendees = new List <Attendee>
            {
                new Attendee {
                    Email = "*****@*****.**"
                }
            };
            ZmailRequest.ApiRequest = new CancelAppointmentRequest(appCancelParam);
            var zResquest = ZmailDispatcher.SendRequest(ZmailRequest);
            var resp      = zResquest.ApiResponse as CancelAppointmentResponse;
        }
Example #3
0
        public void CreateAndCancelAppointmentRequestBookTest()
        {
            var app = new AppointmentRequestParams();

            app.Subject   = "開會,新增行事曆,訂會議室  ";
            app.StartDate = new DateTime(2017, 4, 6, 13, 0, 0);
            app.EndDate   = new DateTime(2017, 4, 6, 14, 00, 0);
            app.Organizer = new Attendee {
                DisplayName = "RM", Email = "*****@*****.**"
            };
            app.Locations = new List <Attendee> {
                new Attendee {
                    DisplayName = "協志會議室-舞蝶館", Email = "*****@*****.**"
                }
            };
            app.Attendees = new List <Attendee> {
                new Attendee {
                    Email = "*****@*****.**", DisplayName = "丸子姐"
                }
            };
            ZmailRequest.ApiRequest = new CreateAppointmentRequest(app);
            var zResquest = ZmailDispatcher.SendRequest(ZmailRequest);
            var resp      = zResquest.ApiResponse as CreateAppointmentResponse;
            var appResp   = resp?.AppointmentResponse;

            Console.WriteLine($"{appResp?.InviteMessageId}");

            var appCancelParam = new CancelAppointmentRequestParam();

            appCancelParam.Subject   = app.Subject;
            appCancelParam.Body      = $"取消: {app.Subject}";
            appCancelParam.Id        = appResp?.InviteMessageId;
            appCancelParam.Attendees = new List <Attendee>
            {
                app.Organizer
            };
            appCancelParam.Attendees.AddRange(app.Locations);
            appCancelParam.Attendees.AddRange(app.Attendees);

            ZmailRequest.ApiRequest = new CancelAppointmentRequest(appCancelParam);
            zResquest = ZmailDispatcher.SendRequest(ZmailRequest);
            var resp2 = zResquest.ApiResponse as CancelAppointmentResponse;
        }