private List <string> extractSharedString(string zipOutputPath)
        {
            string sharedStringsFolder   = zipOutputPath + Path.DirectorySeparatorChar + "xl";
            string sharedStringsFileName = "sharedStrings.xml";

            ExcelParser operationsHelper = new ExcelParser();

            return(operationsHelper.parseSharedStringsXml(sharedStringsFolder + Path.DirectorySeparatorChar + sharedStringsFileName));
        }
        private List <Row> extractWorksheet(string zipOutputPath, int worksheetId)
        {
            string worksheetFolder   = zipOutputPath + Path.DirectorySeparatorChar + "xl" + Path.DirectorySeparatorChar + "worksheets";
            string worksheetFileName = "sheet" + worksheetId + ".xml";

            ExcelParser excelHelper = new ExcelParser();

            return(excelHelper.parseSheetXml(worksheetFolder + Path.DirectorySeparatorChar + worksheetFileName));
        }
        private List <Worksheet> extractWorkbook(string zipOutputPath)
        {
            string workbookFolder   = zipOutputPath + Path.DirectorySeparatorChar + "xl";
            string workbookFileName = "workbook.xml";

            ExcelParser operationsHelper = new ExcelParser();

            List <Worksheet> worksheetList = operationsHelper.parseWorkbookXml(workbookFolder + Path.DirectorySeparatorChar + workbookFileName);

            return(worksheetList);
        }
        public ReadFileEntity ReadFile(string fileFolder, string fileName, string entity)
        {
            string zipPath = fileFolder + Path.DirectorySeparatorChar + "_temp_";

            FileOperations fileOperations = new FileOperations();

            fileOperations.UnZip(fileFolder + Path.DirectorySeparatorChar + fileName, zipPath);

            List <Worksheet> worksheet = extractWorkbook(zipPath);

            List <string> sharedString = extractSharedString(zipPath);

            List <Row> orderRowList = null;
            List <Row> shopRowList  = null;

            ExcelParser parser = new ExcelParser();

            if (entity.Equals("shop") == true)
            {
                shopRowList = extractWorksheet(zipPath, worksheet[1].id);
                parser.mapCellValues(shopRowList, sharedString);
            }
            else if (entity.Equals("order") == true)
            {
                orderRowList = extractWorksheet(zipPath, worksheet[0].id);
                parser.mapCellValues(orderRowList, sharedString);
            }
            else
            {
                fileOperations.DeleteFiles(zipPath);
                return(null);
            }

            fileOperations.DeleteFiles(zipPath);

            return(new ReadFileEntity {
                orderList = createOrderList(orderRowList),
                shopList = createShopList(shopRowList)
            });
        }