public ActionResult CreateEvent(CreateEventViewModel model) { string[] dateTime = model.date.Split('.'); int day = Int32.Parse(dateTime[0]); int month = Int32.Parse(dateTime[1]); int year = Int32.Parse(dateTime[2]); DateTime start = new DateTime(year, month, day, model.hourStart, model.minStart, 0); DateTime end = new DateTime(year, month, day, model.hourEnd, model.minEnd, 0); //List<Snippet> snippets = _snippetService.GetAllSnippetsByID(model.Snippets); Event ev = new Event { Name = model.name, Description = model.description, Start = start, End = end /*, Snippets = snippets*/ }; bool res = _eventService.AddOrUpdateEvent(ev, model.Snippets); if (!res) { return(Json("error", JsonRequestBehavior.AllowGet)); } return(Json("Натпреварот е успешно креиран.", JsonRequestBehavior.AllowGet)); }