public static bool ImportSpssAll(StudyUnitVM studyUnit, MainWindowVM mainWindow) { string path = IOUtils.QueryOpenPathName(SPSS_FILTER); if (string.IsNullOrEmpty(path)) { return(false); } try { SpssReader reader = new SpssReader(); if (!reader.ImportVariables(path, studyUnit)) { return(false); } StudyUnit studyUnitModel = studyUnit.StudyUnitModel; mainWindow.RecreateViewModels(); RawData rawData = reader.LoadRawData(path); if (rawData == null) { return(false); } StudyUnitVM newStudyUnit = mainWindow.GetStudyUnit(studyUnitModel); List <StatisticsInfo> statisticsInfos = StatisticsUtils.CreateStatisticsInfos(rawData, newStudyUnit); studyUnitModel.StatisticsInfos = statisticsInfos; mainWindow.RecreateViewModels(); return(true); } catch (Exception ex) { EDOUtils.ShowUnexpectedError(ex); } return(false); }
public static bool ImportSpssVariables(StudyUnitVM studyUnit) { string path = IOUtils.QueryOpenPathName(SPSS_FILTER); if (string.IsNullOrEmpty(path)) { return(false); } try { SpssReader reader = new SpssReader(); return(reader.ImportVariables(path, studyUnit)); } catch (Exception ex) { EDOUtils.ShowUnexpectedError(ex); } return(false); }