Ejemplo n.º 1
0
 public Importer(IImportDataTableToDataRepositoryMapper dataRepositoryMapper, IReadOnlyList <ColumnInfo> columnInfos, IImporterTask importerTask, IDialogCreator dialogCreator)
 {
     _dataRepositoryMapper = dataRepositoryMapper;
     _columnInfos          = columnInfos;
     _importerTask         = importerTask;
     _dialogCreator        = dialogCreator;
 }
 protected override void Context()
 {
     _importerTask            = new ImporterTask(new ColumnCaptionHelper(), new LowerLimitOfQuantificationTask());
     _table                   = new ImportDataTable();
     _importDataTableGridView = A.Fake <IImportDataTableGridView>();
     sut = new ImportDataTableGridPresenter(_importDataTableGridView, _importerTask);
 }
Ejemplo n.º 3
0
 public ImportDataTableControl(ISimpleChartPresenter presenter, IImportDataTableToDataRepositoryMapper mapper, IImportDataTableGridPresenter gridPresenter, IImporterTask importerTask)
 {
     _presenter = presenter;
     _presenter.LogLinSelectionEnabled = true;
     _mapper        = mapper;
     _gridPresenter = gridPresenter;
     _importerTask  = importerTask;
     _gridPresenter.CopyMetaDataColumnControlEvent += onCopyMetaDataColumnControl;
     _gridPresenter.SetUnitEvent += onSetUnitClick;
 }
Ejemplo n.º 4
0
        public override void GlobalContext()
        {
            var dataRepositoryMapper = A.Fake <IImportDataTableToDataRepositoryMapper>();

            _dialogCreator = A.Fake <IDialogCreator>();
            var columnInfos = A.Fake <IReadOnlyList <ColumnInfo> >();

            _importerTask = new ImporterTask(new ColumnCaptionHelper(), new LowerLimitOfQuantificationTask());
            sut           = new Presentation.Services.Importer.Importer(dataRepositoryMapper, columnInfos, _importerTask, _dialogCreator);
        }
Ejemplo n.º 5
0
        public SetUnitView(ImportDataColumn importDataColumn, IImporterTask importerTask)
        {
            _importDataColumn = importDataColumn;
            getUnits();

            InitializeComponent();
            Shown += (s, e) => enableButtons();

            Text           = Captions.Importer.PleaseEnterDimensionAndUnitInformation;
            btnOK.Click   += (o, e) => this.DoWithinExceptionHandler(onOkClick);
            btnCopy.Click += (o, e) => this.DoWithinExceptionHandler(onCopyClick);

            if (useDimensionSelector)
            {
                _dimensionComboBox = createComboBox("Dimension", onDimensionComboBoxTextChanged);
            }

            _unitComboBox = createComboBox("Unit", onUnitComboBoxTextChanged);

            if (useDimensionSelector)
            {
                fillDimensionComboBox();
            }

            fillUnitComboBox();

            if (useDimensionSelector)
            {
                var dimItem = _dimensionComboBox.Properties.Items.GetItem(_importDataColumn.ActiveDimension.Name);
                if (_dimensionComboBox.Properties.Items.Contains(dimItem))
                {
                    _dimensionComboBox.EditValue = _importDataColumn.ActiveDimension.Name;
                }
                else
                {
                    importerTask.SetColumnUnit(_importDataColumn, selectedUnit.Name, true);
                }
            }

            var unitItem = _unitComboBox.Properties.Items.GetItem(_importDataColumn.ActiveUnit.Name);

            if (_unitComboBox.Properties.Items.Contains(unitItem))
            {
                _unitComboBox.EditValue = _importDataColumn.ActiveUnit.Name;
            }

            arrangeControls();

            enableButtons();
            if (ParentForm != null)
            {
                Icon = ParentForm.Icon;
            }
        }
Ejemplo n.º 6
0
 public ImporterView(IColumnInfosToImportDataTableMapper importMapper, IImportDataTableToDataRepositoryMapper dataRepositoryMapper, IImageListRetriever imageListRetriever,
                     IDialogCreator dialogCreator, IImporterTask importerTask, IColumnCaptionHelper columnCaptionHelper)
 {
     _importMapper         = importMapper;
     _dataRepositoryMapper = dataRepositoryMapper;
     _imageListRetriever   = imageListRetriever;
     _dialogCreator        = dialogCreator;
     _importerTask         = importerTask;
     _columnCaptionHelper  = columnCaptionHelper;
     InitializeComponent();
 }
Ejemplo n.º 7
0
        public override void GlobalContext()
        {
            _importMapper         = new ColumnInfosToImportDataTableMapper();
            _dialogCreator        = A.Fake <IDialogCreator>();
            _dataRepositoryMapper = new ImportDataTableToDataRepositoryMapper(createDimensionFactory(), new ColumnCaptionHelper());
            _importerTask         = new ImporterTask(new  ColumnCaptionHelper(), new LowerLimitOfQuantificationTask());
            var namingPatternView = A.Fake <INamingPatternView>();
            var importerView      = A.Fake <IImporterView>();

            sut =
                new ImporterPresenter(importerView,
                                      _dataRepositoryMapper,
                                      new NamingPatternPresenter(namingPatternView),
                                      _dialogCreator, A.Fake <IExcelPreviewPresenter>(), new RepositoryNamingTask(new MetaDataCategoryToNamingPatternMapper()), new NamingPatternToRepositoryNameMapper());

            _excelFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Data");
        }
 public ImportDataTableGridPresenter(IImportDataTableGridView view, IImporterTask importerTask) : base(view)
 {
     _importerTask = importerTask;
 }