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);
        }
        private async Task<AppointmentManager> CreateModel(List<string> users, string start, string end)
        {
            var request = new AvailabilityRequest
            {
                DurationMinutes = 60,
                Start = DateTime.Parse(start).ToString(),
                End = DateTime.Parse(end).ToString(),
                Users = users == null ? new List<string>() : users
            };

            var result = await _client.GetAvailability(request);

            var obj = result.AvailabilityResult;
            int i = 0;

            // Part of a hack. for this demo we only expect <=5 users.
            var colorIndex = 0;
            var list = new List<EventObject>();

            foreach (var avai in result.AvailabilityResult)
            {

                var color = _colors[(i == _colors.Count) ? colorIndex = 0 : colorIndex++];
                foreach (var block in avai.Availability)
                {
                    var eventObject = new EventObject
                    {
                        title = "Interviewer " + i + " Status: " + block.Status,
                        start = block.Start.ToString("o"),
                        end = block.End.ToString("o"),
                        allDay = false,
                        backgroundColor = color
                    };
                    list.Add(eventObject);
                }
                i++;
            }

            var model = new AppointmentManager { Events = list };
            return model;
        }