mercredi 1 juin 2016

Checkbox turning multiple values true

I've been stuck of this for a while and would love some insight.

When I add a new user or source and check the drawn checkbox, it causes the bool to be true when checked, as expected.

However it also checks all the other users connected to that source as true or false.

before

after

This only occurs when I load the XML file into my program that already had existing data, then add new Users or Sources via the UI.

this is a part of the LoadXML Method.

// Load the source list
        sourceProps.SystemSources.Clear();
        fCMUserSourceBindingSource.Clear();
        fCMSourceBindingSource.Clear();

        foreach (FusionSource src in fusionSystem.sourceList)
        {
            FCMSource fSource = new FCMSource(src);
            sourceProps.SystemSources.Add(fSource);
            fCMSourceBindingSource.Add(fSource);
            fCMUserSourceBindingSource.Add(fSource);
        }
        txtSourceID.Text = sourceProps.GenerateNextSourceId();

        // Load the user data from the fusionSystem object.
        userProfile.SystemUserList.Clear();

        //currently clears grid. might need to clear list instead
        fCMUserBindingSource.Clear();

        foreach (FusionUser usr in fusionSystem.userList)
        {
            FCMUser fUser = new FCMUser(usr);
            userProfile.SystemUserList.Add(fUser);
            fCMUserBindingSource.Add(fUser);

            foreach (FusionSourcePermission srcPerm in usr.SourcePermissionList)
            {
                FCMSource fSource = new FCMSource(srcPerm);
                fUser.fusionUserSources.Add(fSource);
            }
        }
        AddColumnsUsersToSourceAllocation();
        txtUserID.Text = userProfile.GenerateNextUserId();

        // Load the zone group data from the fusionSystem object
        zoneProps.systemZoneGroupList.Clear();
        fCMZoneGroupBindingSource.Clear();

Any help would be appreciated.




Aucun commentaire:

Enregistrer un commentaire