public IActionResult Calendar()
        {
            ViewData["page-2"] = "active";

            var guests   = _internService.GetWhitelist();
            var eventype = _eventTypeService.GetAll();

            var model = new CalendarViewModel(eventype, guests)
            {
                Creator = ViewBag.fullname
            };

            return(View(model));
        }
        public IActionResult CreateEvent(CalendarViewModel model)
        {
            var even = _mapper.Map <EventModel>(model);

            even.CreatedBy = int.Parse(ViewBag.id);

            var ok = _eventService.InsertEvent(even);

            if (!ok)
            {
                Response.StatusCode = -1;
            }

            return(RedirectToAction("Calendar"));
        }
        public IActionResult Calendar()
        {
            ViewData["page-2"] = "active";

            object guests    = _internService.GetWhitelist();
            string whitelist = AppExtensions.Dump(guests);

            IList <EventTypeModel> eventype = _eventTypeService.GetAll();

            var model = new CalendarViewModel(eventype, whitelist)
            {
                Creator = ViewBag.fullname
            };

            return(View(model));
        }
        public IActionResult CreateEvent(CalendarViewModel model)
        {
            var even = _mapper.Map <EventModel>(model);

            even.CreatedBy = int.Parse(ViewBag.id);

            if (even.Image is null)
            {
                even.Image = "/img/_event.svg";
            }

            //Log.Information(AppExtensions.Dump(even));

            var ok = _eventService.InsertEvent(even);

            if (!ok)
            {
                Response.StatusCode = -1;
            }

            return(RedirectToAction("Calendar"));
        }