private void fieldMapping_MappingRemoved(object sender, Objects.FieldMappingEventArgs e)
        {
            //Add back any selected mappings to the relevant master collection, and remove them as well
            FieldMapping currentFieldMappingControl = (FieldMapping)sender;

            FieldMapperWrapper.ProcessMappingRemoval(currentFieldMappingControl, flowLayoutPanel1.Controls, e);
        }
        private void fieldMapping_DestinationFieldChanged(object sender, Objects.FieldMappingEventArgs e)
        {
            //Remove the passed field from the master collection (Mapped Fields) if it was "added" (thus should no longer be available in other controls), or add the passed field back to the master collection of UnMappedFields
            FieldMapping currentFieldMappingControl = (FieldMapping)sender;

            FieldMapperWrapper.ProcessDestinationFieldChange(currentFieldMappingControl, flowLayoutPanel1.Controls, e);
        }
        private void fieldMapping_SourceFieldChanged(object sender, Objects.FieldMappingEventArgs e)
        {
            //Remove the current field from the master collection, add the old field back to the master collection
            FieldMapping currentFieldMappingControl = (FieldMapping)sender;

            FieldMapperWrapper.ProcessSourceFieldChange(currentFieldMappingControl, flowLayoutPanel1.Controls, e);
        }
Exemplo n.º 4
0
        private void fieldMapping_MappingRemoved(object sender, Objects.FieldMappingEventArgs e)
        {
            //Add back any selected mappings to the relevant master collection, and remove them as well
            FieldMapping currentFieldMappingControl = (FieldMapping)sender;

            FieldMapperWrapper.ProcessMappingRemoval(currentFieldMappingControl, flowLayoutPanel1.Controls, e);
            Invalidate();

            //Debug.WriteLine(String.Format("DestinationFieldChanged: Removing current OCM field from unmapped fields: {0}; Adding to mapped fields: {1}; Current mapped fields: {2}; Current unmapped fields: {3}; ", e.OCMField.Name, fieldMapping.DestinationField.Name, FieldMappings.OCMAccountFields.OCMFields.MappedFields.Count, FieldMappings.OCMAccountFields.OCMFields.UnMappedFields.Count));

            //FieldMappings.OCMAccountFields.OCMFields.MappedFields.Remove(currentFieldMappingControl.DestinationField);
            //FieldMappings.OCMAccountFields.OCMFields.UnMappedFields.Add(e.OCMField);

            //FieldMappings.BCMAccountFields.BCMFields.MappedFields.Remove(currentFieldMappingControl.SourceField);
            //FieldMappings.BCMAccountFields.BCMFields.UnMappedFields.Add(e.BCMField);

            //currentFieldMappingControl.UpdateSourceMappings(FieldMappings.BCMAccountFields.BCMFields.UnMappedFields);
            //currentFieldMappingControl.UpdateDestinationMappings(FieldMappings.OCMAccountFields.OCMFields.UnMappedFields);
            //foreach (Control c in flowLayoutPanel1.Controls)
            //{
            //    if (c.GetType() == typeof(FieldMapping))
            //    {
            //        FieldMapping fm = (FieldMapping) c;
            //        if (fm != currentFieldMappingControl)
            //        {
            //            if (e.OCMField != null)
            //                fm.AddOCMField(e.OCMField);
            //            if (e.BCMField != null)
            //                fm.AddBCMField(e.BCMField);
            //        }
            //    }
            //}
        }
Exemplo n.º 5
0
        private void fieldMapping_DestinationFieldChanged(object sender, Objects.FieldMappingEventArgs e)
        {
            //Remove the passed field from the master collection (Mapped Fields) if it was "added" (thus should no longer be available in other controls), or add the passed field back to the master collection of UnMappedFields
            FieldMapping currentFieldMappingControl = (FieldMapping)sender;

            FieldMapperWrapper.ProcessDestinationFieldChange(currentFieldMappingControl, flowLayoutPanel1.Controls, e);

            //foreach (Control c in flowLayoutPanel1.Controls)
            //{
            //    if (c.GetType() == typeof(FieldMapping))
            //    {
            //        FieldMapping fm = (FieldMapping) c;
            //        if (fm != currentFieldMappingControl)
            //        {
            //            //Add or remove the field that was changed and update relevant DestinationFields/SourceFields collection and combo

            //            switch (e.ChangeType)
            //            {
            //                case FieldMappingEventArgs.ChangeTypes.Added:
            //                    fm.RemoveOCMField(e.OCMField);
            //                    break;
            //                case FieldMappingEventArgs.ChangeTypes.Removed:
            //                    fm.AddOCMField(e.OCMField);
            //                    break;
            //            }
            //        }
            //    }
            //}
        }
Exemplo n.º 6
0
        private void fieldMapping_SourceFieldChanged(object sender, Objects.FieldMappingEventArgs e)
        {
            //Remove the current field from the master collection, add the old field back to the master collection
            FieldMapping currentFieldMappingControl = (FieldMapping)sender;

            FieldMapperWrapper.ProcessSourceFieldChange(currentFieldMappingControl, flowLayoutPanel1.Controls, e);

            //try
            //{
            //    foreach (Control c in flowLayoutPanel1.Controls)
            //    {
            //        if (c.GetType() == typeof(FieldMapping))
            //        {
            //            FieldMapping fm = (FieldMapping) c;
            //            if (fm != currentFieldMappingControl)
            //                //Add or remove the field that was changed and update relevant DestinationFields/SourceFields collection and combo
            //                switch (e.ChangeType)
            //                {
            //                    case FieldMappingEventArgs.ChangeTypes.Added:
            //                        fm.RemoveBCMField(e.BCMField);
            //                        break;
            //                    case FieldMappingEventArgs.ChangeTypes.Removed:
            //                        fm.AddBCMField(e.BCMField);
            //                        break;
            //                }
            //        }
            //    }
            //}
            //catch (System.Exception ex)
            //{
            //    //MessageBox.Show("Error in BCM_Migration_Tool.Controls.Accounts.fieldMapping_SourceFieldChanged()", ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
            //}
        }