Exemplo n.º 1
0
        public ActionResult RolEkle(KullaniciRolModel model)
        {
            ViewBag.Roller = new SelectList(_roleRepository.GetRoles(), "Id", "Name");
            if (ModelState.IsValid)
            {
                if (_roleRepository.RolEkle(model.Email, model.RolId))
                {
                    return(RedirectToAction("Index"));
                }

                ModelState.AddModelError("", "Rol eklerken bir hata oluştu");
                return(View(model));
            }
            ModelState.AddModelError("", "Model Error");
            return(View(model));
        }