Exemplo n.º 1
0
        void ProceedImportExcel()
        {
            List <string> names        = _IExcel.GetSheetNames();
            List <string> checkedNames = names.ToList();

            SelectEntitiesDialogOptions options = new SelectEntitiesDialogOptions()
            {
                Caption     = "Arkusze",
                Description = "Wybierz arkusze",
                Options     = names,
                Checked     = checkedNames
            };

            List <string> selectedNames;
            bool          isOk = _iOutput.FileDialog.ShowSelectEntitiesDialog(options, out selectedNames);

            if (!isOk)
            {
                return;
            }

            List <ITransactionParser> parsers = _import.GetParsers();

            new List <ITransactionParser>();

            GetExcelTransactionsAction.Data getExcelData = new GetExcelTransactionsAction.Data()
            {
                SheetFileNames = selectedNames,
                Excel          = _IExcel,
                Parsers        = parsers
            };

            GetExcelTransactionsAction getExcelAction = new GetExcelTransactionsAction();

            GetTransactionsAction.Result result = getExcelAction.Execute(getExcelData);

            _repository.Reports.Item.Reports = result.Reports;
            _iOutput.ShowReports(result.Reports);
        }