Exemple #1
0
        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"));
        }
Exemple #2
0
        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
            });
        }