コード例 #1
0
        public ActionResult IncluirRole(Role role)
        {
            if (role == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            if (!ModelState.IsValid)
            {
                ModelState.AddModelError("Erro", "Um ou mais campos estão preechidos de forma incorreta");
                return(View(role));
            }

            roleDAO.Add(role);
            return(RedirectToAction("IndexRoles"));
        }
コード例 #2
0
 public void Add(Role t)
 {
     roleDAO.Add(t);
 }