Ejemplo n.º 1
0
        public IActionResult CreateUpdateEventAgeRestriction(AgeSystemCreateUpdateViewModel viewModel = null)
        {
            if (viewModel == null)
            {
                viewModel = new AgeSystemCreateUpdateViewModel();
            }

            return(View("CreateUpdateEventAgeRestriction", viewModel));
        }
Ejemplo n.º 2
0
        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"
            }));
        }