public ActionResult CreateEvent(string EventTitle, string EventVenue, string EventAddress1, string EventAddress2, string EventCity, string EventState, string EventPostalCode, DateTime EventStartDateTime, DateTime EventEndDateTime, string EventDescription)
        {
            Models.EventData eventData = new Models.EventData();
            string           saved     = eventData.AddEvent(EventTitle, EventVenue, EventAddress1, EventAddress2, EventCity, EventState, EventPostalCode, EventStartDateTime.ToUniversalTime(), EventEndDateTime.ToUniversalTime(), EventDescription);

            if (saved.StartsWith("Point8020.Error"))
            {
                return(RedirectToAction("TrappedError", "Home", new { ErrorMessage = "Event could not be saved: Error Code is: " + saved, SPHostUrl = SharePointContext.GetSPHostUrl(HttpContext.Request).AbsoluteUri }));
            }
            else
            {
                var spContext = SharePointContextProvider.Current.GetSharePointContext(HttpContext);
                using (var clientContext = spContext.CreateUserClientContextForSPHost())
                {
                    if (clientContext != null)
                    {
                        hostWeb = clientContext.Web;
                        clientContext.Load(hostWeb);
                        ListCollection hostLists = hostWeb.Lists;
                        clientContext.Load(hostLists);
                        clientContext.ExecuteQuery();
                        bool calendarFound = false;
                        foreach (List lst in hostLists)
                        {
                            if (lst.BaseTemplate == (int)ListTemplateType.Events)
                            {
                                if (lst.Title == "Contoso Events Calendar")
                                {
                                    calendarFound = true;
                                    break;
                                }
                            }
                        }
                        eVentCalendarExists = calendarFound;
                        if (calendarFound)
                        {
                            List calendar = hostWeb.Lists.GetByTitle("Contoso Events Calendar");
                            clientContext.Load(calendar);
                            clientContext.ExecuteQuery();
                            ListItemCreationInformation itemInfo = new ListItemCreationInformation();
                            ListItem newEvent = calendar.AddItem(itemInfo);
                            newEvent["Title"]     = EventTitle;
                            newEvent["Location"]  = EventCity;
                            newEvent["EventDate"] = EventStartDateTime.ToUniversalTime();
                            newEvent["EndDate"]   = EventEndDateTime.ToUniversalTime();
                            newEvent["Category"]  = saved;

                            newEvent.Update();
                            clientContext.ExecuteQuery();
                        }
                    }
                }

                return(RedirectToAction("Events", "Home", new { SPHostUrl = SharePointContext.GetSPHostUrl(HttpContext.Request).AbsoluteUri }));
            }
        }