Ejemplo n.º 1
0
        public ExcelImportWizard(XPObjectSpace objectSpace, ITypeInfo typeInfo, CollectionSourceBase collectionSourceBase, XafApplication application,
                                 ExcelImportWizardStringToPropertyMap propertyValueMapper = null)
        {
            _application         = application;
            _propertyValueMapper = propertyValueMapper ?? new StringValueMapper().MapValueToObjectProperty;
            //set local variable values
            if (objectSpace == null)
            {
                throw new ArgumentNullException("objectSpace", Resources.ExcelImportWizard_ExcelImportWizard_ObjectSpace_cannot_be_NULL);
            }

            ObjectSpace             = objectSpace;
            CurrentCollectionSource = collectionSourceBase;

            Type = typeInfo.Type;

            InitializeComponent();

            ImportMapLookUp.Properties.DataSource = ImportMapsCollection.ToList();

            //disable next, until file and other info is selected
            welcomeWizardPage1.AllowNext = false;
            wizardPage1.AllowNext        = false;



            gridLookUpEdit1.Properties.View.OptionsBehavior.AutoPopulateColumns = true;
            gridLookUpEdit1.Properties.DataSource = MappableColumns;


            var mappablePropertyClassInfo
                = objectSpace.Session.GetClassInfo(typeof(MappableProperty));


            foreach (GridColumn column in gridLookUpEdit2View.Columns)
            {
                column.Caption = mappablePropertyClassInfo
                                 .GetMember(column.FieldName).DisplayName;
                if (column.FieldName == @"Mapped")
                {
                    column.Visible = false;
                }
            }
        }
Ejemplo n.º 2
0
        public ExcelImportWizard(XPObjectSpace objectSpace, ITypeInfo typeInfo, CollectionSourceBase collectionSourceBase, XafApplication application,
            ExcelImportWizardStringToPropertyMap propertyValueMapper = null) {
            _application = application;
            _propertyValueMapper = propertyValueMapper ?? new StringValueMapper().MapValueToObjectProperty;
            //set local variable values
            if (objectSpace == null)
                throw new ArgumentNullException("objectSpace", Resources.ExcelImportWizard_ExcelImportWizard_ObjectSpace_cannot_be_NULL);

            ObjectSpace = objectSpace;
            CurrentCollectionSource = collectionSourceBase;

            Type = typeInfo.Type;

            InitializeComponent();

            ImportMapLookUp.Properties.DataSource = ImportMapsCollection.ToList();

            //disable next, until file and other info is selected
            welcomeWizardPage1.AllowNext = false;
            wizardPage1.AllowNext = false;



            gridLookUpEdit1.Properties.View.OptionsBehavior.AutoPopulateColumns = true;
            gridLookUpEdit1.Properties.DataSource = MappableColumns;


            var mappablePropertyClassInfo
                = objectSpace.Session.GetClassInfo(typeof(MappableProperty));


            foreach (GridColumn column in gridLookUpEdit2View.Columns) {

                column.Caption = mappablePropertyClassInfo
                                    .GetMember(column.FieldName).DisplayName;
                if (column.FieldName == @"Mapped")
                    column.Visible = false;
            }
        }