public async Task<ActionResult> CreateEvent(CreateEventViewModel eventObject)
        {
            var model = eventObject;

            // Create EWS Appointment

            var request = new CreateAppointmentRequest
            {
                Body = "Created From Web App",
                End = DateTime.Parse(eventObject.Event.end).ToString(),
                Start = DateTime.Parse(eventObject.Event.start).ToString(),
                Location = "Web",
                Subject = eventObject.Event.title,

                Recipients = eventObject.Users

            };
            var resp = await _client.CreateAppointment(request);

            // Send Emails
            var emailRequest = new SendEmailRequest
            {
                Recipients = eventObject.Users,
                Body = "Automated Email After Appointment Creation",
                FileAttachments = new List<string>(),
                Subject = "Automated Email After Appointment Creation"
            };
            var sendEmailResponse = await _client.SendEmail(emailRequest);

            return RedirectToAction("Index");
        }
        public ActionResult CreateEventFormPopUp(string start, List<string> users)
        {
            var startTime = DateTime.Parse(start);
            var first = true;
            var list = new List<SelectListItem>();
            var time = startTime.AddMinutes(30);
            while (true)
            {
                list.Add(new SelectListItem
                {
                    Selected = first,
                    Text = time.ToString("t"),
                    Value = time.ToString("o")
                });
                first = false;
                if (time.Hour == 0)
                {
                    break;
                }
                time = time.AddMinutes(30);

            }

            EventObject model = new EventObject { start = startTime.ToString("o"), displayStart = startTime.ToString("t") };
            var viewModel = new CreateEventViewModel { EndTimeList = list, Event = model, Users = users };
            return PartialView("_CreateEventPartial", viewModel);
        }