Exemplo n.º 1
0
 private void InitRoleFunctions(RoleModule roleModule)
 {
     foreach (var function in roleModule.Module.Functions)
     {
         var roleFunctions = roleModule.RoleFunctions.Where(rf => rf.Function.FunctionID == function.FunctionID);
         if (roleFunctions.Count() == 0)
         {
             RoleFunction rf = new RoleFunction()
             {
                 RoleFunctionID = Guid.NewGuid(),
                 RoleModule     = roleModule,
                 Function       = function,
                 IsActive       = false
             };
             roleModule.RoleSystem.IsActive = false;
             SetParentRoleModuleIsActiveFalse(roleModule);
             roleModule.IsActive = false;
             RoleFunctionRepository.Add(rf);
             RoleFunctionRepository.SaveChanges();
         }
     }
 }
Exemplo n.º 2
0
 private void InitRoleFunctions(AUTH_ROLE_MODULE roleModule)
 {
     foreach (var function in roleModule.AUTH_MODULE.AUTH_FUNCTION)
     {
         var roleFunctions = roleModule.AUTH_ROLE_FUNCTION.Where(rf => rf.AUTH_FUNCTION.FUNCTION_ID == function.FUNCTION_ID);
         if (roleFunctions.Count() == 0)
         {
             AUTH_ROLE_FUNCTION rf = new AUTH_ROLE_FUNCTION()
             {
                 //ROLE_FUNCTION_ID = Guid.NewGuid().ToString(),
                 ROLE_FUNCTION_ID = RoleFunctionRepository.GetNewID("AUTH_ROLE_FUNCTION", "ROLE_FUNCTION_ID"),
                 AUTH_ROLE_MODULE = roleModule,
                 AUTH_FUNCTION    = function,
                 // IS_ACTIVE = false.ToString()
                 IS_ACTIVE = "0"
             };
             roleModule.AUTH_ROLE_SYSTEM.IS_ACTIVE = "0";
             SetParentRoleModuleIsActiveFalse(roleModule);
             roleModule.IS_ACTIVE = "0";
             RoleFunctionRepository.Add(rf);
             RoleFunctionRepository.SaveChanges();
         }
     }
 }