Example #1
0
        public async Task <ActionResult> Create(CreateHolidayViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                var isSuccess = await _holidayService.AddHoliday(viewModel);

                if (isSuccess)
                {
                    _logger.Info($"Holiday on {viewModel.HolidayDate} created successfully");
                    return(RedirectToAction("Index"));
                }
            }

            return(View(viewModel));
        }