Example #1
0
        public static void CreatePredefinedRoles()
        {
            var allPredefinedRoles = EPredefinedRoleUtils.GetAllPredefinedRole();

            foreach (EPredefinedRole enumRole in allPredefinedRoles)
            {
                BaiRongDataProvider.RoleDao.InsertRole(EPredefinedRoleUtils.GetValue(enumRole), string.Empty, EPredefinedRoleUtils.GetText(enumRole));
            }
        }
Example #2
0
        public static void CreatePredefinedRolesIfNotExists()
        {
            var allPredefinedRoles = EPredefinedRoleUtils.GetAllPredefinedRole();

            foreach (var enumRole in allPredefinedRoles)
            {
                if (!DataProvider.RoleDao.IsRoleExists(EPredefinedRoleUtils.GetValue(enumRole)))
                {
                    DataProvider.RoleDao.InsertRole(EPredefinedRoleUtils.GetValue(enumRole), string.Empty, EPredefinedRoleUtils.GetText(enumRole));
                }
            }
        }