Пример #1
0
        public void CreateAppointmentRequestBookTestWithResource()
        {
            var app = new AppointmentRequestParams();

            app.Subject   = " 到小琉球玩 ";
            app.StartDate = new DateTime(2017, 6, 4, 14, 0, 0);
            app.EndDate   = new DateTime(2017, 6, 4, 15, 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 = "丸子姐"
                }
            };

            app.Resources = 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}");
        }
Пример #2
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;
        }
Пример #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;
        }
Пример #4
0
        public void CreateAppointmentRequestSelfBookTest()
        {
            var app = new AppointmentRequestParams();

            app.Subject   = "開會,新增行事曆,訂會議室 測試";
            app.StartDate = new DateTime(2017, 4, 6, 9, 30, 0);
            app.EndDate   = new DateTime(2017, 4, 6, 10, 30, 0);
            app.Organizer = new Attendee {
                Email = "*****@*****.**", DisplayName = "亂馬客"
            };
            app.Locations = new List <Attendee> {
                new Attendee {
                    DisplayName = "協志會議室-舞蝶館", Email = "*****@*****.**"
                }
            };

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

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