private static void SetExcelInputParameters(ExcelSheetSelectorViewModel excelSelectorViewModel,
                                             string fileName,
                                             string sheetName)
 {
     if (File.Exists(fileName))
     {
         excelSelectorViewModel.InputFileName = fileName;
         if (excelSelectorViewModel.SheetNames.Contains(sheetName))
         {
             excelSelectorViewModel.SelectedSheet = sheetName;
         }
     }
 }
        public InputWorkFlowStepViewModel(DataStore dataStore, Action goToNextStep, Action goToPreviousStep)
        {
            _dataStore    = dataStore;
            _goToNextStep = goToNextStep;
            Name          = "Input";

            JournalSelectorViewModel = new ExcelSheetSelectorViewModel {
                Title = "Please provide the journal"
            };
            PreviousBalanceSheetSelectorViewModel =
                new ExcelSheetSelectorViewModel {
                Title = "Please provide the previous period balance sheet"
            };

            AccountDefinitionViewModel =
                new ExcelSheetSelectorViewModel()
            {
                Title = "Please provide the account definition"
            };


            JournalSelectorViewModel.ValidityChanged += RaiseCanExecuteChanged;
            PreviousBalanceSheetSelectorViewModel.ValidityChanged += RaiseCanExecuteChanged;
            AccountDefinitionViewModel.ValidityChanged            += RaiseCanExecuteChanged;

            GoToPreviousCommand = new DelegateCommand(goToPreviousStep, () => true);
            GoToNextCommand     = new DelegateCommand(GoToNext, CanGoToNext);

            SetParametersValueFromCache(dataStore);

            /*
             *
             * JournalSelectorViewModel.InputFileName =
             *  @"C:\Users\Z003P4AY\Desktop\V1.0.0.0\Samples\InputSample_JournalFY17.xlsx";
             *
             * JournalSelectorViewModel.SelectedSheet = "Journal";
             *
             * PreviousBalanceSheetSelectorViewModel.InputFileName =
             *  @"C:\Users\Z003P4AY\Desktop\V1.0.0.0\Samples\InputSample_BalanceSheetFY16.xlsx";
             *
             * PreviousBalanceSheetSelectorViewModel.SelectedSheet = "BS";
             *
             * AccountDefinitionViewModel.InputFileName =
             *  @"C:\Users\Z003P4AY\Desktop\V1.0.0.0\Samples\InputSample_JournalFY17.xlsx";
             *
             * AccountDefinitionViewModel.SelectedSheet = "Definition";
             *
             * AccountingPeriodStartDate = new DateTime(2016, 4, 1);
             * AccountingPeriodEndDate = new DateTime(2017, 3, 31);
             */
        }
Exemplo n.º 3
0
        public InputWorkFlowStepViewModel(DataStore dataStore, Action goToNextStep, Action goToPreviousStep)
        {
            _dataStore    = dataStore;
            _goToNextStep = goToNextStep;
            Name          = "Input";

            TradeLogSelectorViewModel = new ExcelSheetSelectorViewModel {
                Title = "Please provide the Trade Log"
            };

            TradeLogSelectorViewModel.ValidityChanged += RaiseCanExecuteChanged;

            GoToPreviousCommand = new DelegateCommand(goToPreviousStep, () => true);
            GoToNextCommand     = new DelegateCommand(GoToNext, CanGoToNext);
        }