public IActionResult CreateUpdateEventAgeRestriction(AgeSystemCreateUpdateViewModel viewModel = null)
        {
            if (viewModel == null)
            {
                viewModel = new AgeSystemCreateUpdateViewModel();
            }

            return(View("CreateUpdateEventAgeRestriction", viewModel));
        }
        public IActionResult CreateUpdateEventAgeRestrictionPost(AgeSystemCreateUpdateViewModel viewmodel)
        {
            if (string.IsNullOrWhiteSpace(viewmodel.Name))
            {
                viewmodel.ErrorMessage = "שם קבוצת גיל ריק";
                return(CreateUpdateEventAgeRestriction(viewmodel));
            }

            var answer = Gateway.AddOrUpdateAgeRestriction(viewmodel);

            if (answer.AnswerType != AnswerType.Success)
            {
                viewmodel.ErrorMessage = answer.Message;
                return(CreateUpdateEventAgeRestriction(viewmodel));
            }

            return(RedirectToAction("Manage", new
            {
                tab = "settings"
            }));
        }