public IEnumerable <BROLE_MAP> GetOtherBroleMaps(BROLE_MAP broleMap) { var existingData = _xmlMapper.uow.GetGenericRepository <BROLE_MAP>() .Get(x => x.BROLE != broleMap.BROLE && x.MSACCT == broleMap.MSACCT); return(existingData); }
public void InsertBroleMap(BROLE_MAP roleMap) { var broleMapToDelete = GetOtherBroleMaps(roleMap); if (broleMapToDelete.Any()) { DeleteBroleMap(broleMapToDelete); } var existRoleMap = GetBroleMap(roleMap.BROLE, roleMap.MSACCT); if (existRoleMap != null) { roleMap.BROLE_MAP_ID = existRoleMap.BROLE_MAP_ID; } _xmlMapper.InsertOrUpdate(roleMap); if (roleMap.ROLEID.HasValue && roleMap.ROLEID.Value != Enums.UserRole.POA) { DeletePoaByMsAccount(roleMap.MSACCT); } }