Example #1
0
        public ActionResult Create([Bind(Include = "id,title")] IdentityRoles userGroup)
        {
            if (ModelState.IsValid)
            {
                repository.Add(userGroup);
                return(RedirectToAction("Index"));
            }

            return(View(userGroup));
        }
Example #2
0
        public static DataActionState Add(UserGroupsInfo userGroupsInfo)
        {
            if (!RolePermissions.AccessCheck(OperateCode.UserGroupManage))
            {
                throw new CustomException(PEExceptionType.ExceedAuthority);
            }
            DataActionState unknown = DataActionState.Unknown;

            if (GroupNameIsExist(userGroupsInfo.GroupName))
            {
                return(DataActionState.Exist);
            }
            if (dal.Add(userGroupsInfo))
            {
                unknown = DataActionState.Successed;
            }
            return(unknown);
        }