예제 #1
0
        public IActionResult Add(BanAddViewModel model)
        {
            if (ModelState.IsValid)
            {
                var ban = new Ban();
                ban.UserId      = model.UserId;
                ban.Description = model.Description;

                _banService.Add(ban);

                TempData["Message"]      = "Kısıtlama eklendi";
                TempData["MessageState"] = "warning";
                return(RedirectToAction("Bans", "Admin"));
            }

            TempData["Message"]      = "Bir hata oluştu !";
            TempData["MessageState"] = "danger";
            return(RedirectToAction("Bans", "Admin"));
        }