public IActionResult CreateEvent(string name, DateTime date, string description, DateTime starttime, DateTime endtime, int nrbar, int nrevent, int nriets) { EventModel newEvent = new EventModel(null, date, description, starttime, endtime, nrbar, nrevent, nriets); logic.AddEvent(newEvent); return(RedirectToAction("EmployeeHome")); }
public async Task <ActionResult <AddEventResponse> > AddEvent(AddEventModel request) { var uid = new Guid(HttpContext.Request.Headers[AuthorizationHeaders.PersonUid].First()); var validationResult = _eventValidation.ValidateAddEvent(request); if (!validationResult.ValidationResult) { return(BadRequest(validationResult.ValidationMessage)); } var eventUid = await _eventLogic.AddEvent(request, uid); return(new AddEventResponse { EventUid = eventUid }); }