Пример #1
0
        public void CreateMeeting(AppointmentModel data)
        {
            try
            {
                ExchangeService service        = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
                SearchFilter    sfSearchFilter = new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false);
                service.UseDefaultCredentials = true;

                service.AutodiscoverUrl(Session.UserData.email, adAutoDiscoCallBack);
                Appointment meeting = new Appointment(service);

                meeting.Subject = data.Subject;
                meeting.Body    = new EmailTemplate().MeetingMeghivo(data.interview.projekt_megnevezes, data.interview.date_start + "  " + data.interview.time_start + " - " + data.interview.time_end, data.interview.helyszin, data.interview.jelolt_megnevezes);
                DateTime date_start = DateHandler.GenerateFromString(data.Start, data.Time_start);
                DateTime date_end   = DateHandler.GenerateFromString(data.Start, data.Time_end);
                meeting.Start    = date_start;
                meeting.End      = date_end;
                meeting.Location = data.Location;
                foreach (var attendee in data.Attendees)
                {
                    meeting.RequiredAttendees.Add(attendee);
                }
                meeting.ReminderMinutesBeforeStart = 30;
                meeting.Save(SendInvitationsMode.SendToAllAndSaveCopy);
                Item item = Item.Bind(service, meeting.Id, new PropertySet(ItemSchema.Subject));
            }
            catch (Exception e)
            {
                MessageBox.Show("Sikertelen létrehozás! \n\n Error: \n" + e);
            }
        }