public ActionResult Create(EventBlockCreate model) { if (!ModelState.IsValid) { return(View(model)); } if (EventBlockService.CreateEvent(model)) { TempData["SaveResult"] = "Your event was created"; return(RedirectToAction("Index")); } ModelState.AddModelError("", "Event could not be created"); return(View(model)); }
public bool CreateEvent(EventBlockCreate model) { var entity = new Data.Event() { Title = model.Title, IsAllDay = model.IsAllDay, Start = model.Start, End = model.End, Description = model.Description, ThemeColor = model.ThemeColor, }; using (var ctx = new StudyTimeHelperEntities()) { ctx.Event.Add(entity); return(ctx.SaveChanges() == 1); } }
public bool EventCreate(EventBlockCreate model) { throw new NotImplementedException(); }
public bool CreateEvent(EventBlockCreate model) { CreateEventCallCount++; return(CreateEventReturnValue); }