示例#1
0
        public ActionResult AddRole(UserRole role)
        {
            UserDomainLogic userDomainLogic = new UserDomainLogic();
            Message         message         = new Message();

            if (userDomainLogic.AddRole(role))
            {
                ModelState.Clear();
                role = new UserRole();
                message.MessageText = "Role added successfully.";
                message.MessageType = MessageType.Success;
            }
            else
            {
                message.MessageText = "Role already exists.";
                message.MessageType = MessageType.Error;
            }
            return(Json(message, JsonRequestBehavior.AllowGet));;
        }