Ejemplo n.º 1
0
        public async Task <XLSForm> LoadAsync(string f, string keyWordSurvey)
        {
            XLSForm  xlsform = new XLSForm();
            FileInfo file    = new FileInfo(f);

            using (ExcelPackage package = new ExcelPackage(file))
            {
                RepositorySurvey   rSurvey   = new RepositorySurvey(package, keyWordSurvey);
                RepositoryChoice   rChoices  = new RepositoryChoice(package);
                RepositorySettings rSettings = new RepositorySettings(package);

                await rSurvey.LoadContentAsync();

                await rChoices.LoadContentAsync();

                await rSettings.LoadContentAsync();

                xlsform.Surveys  = rSurvey.Records;
                xlsform.Choices  = rChoices.Records;
                xlsform.Settings = rSettings.Records[0];
            }
            return(xlsform);
        }