예제 #1
0
        public object ReadLinkList(ICell cell, TypeInfo t)
        {
            if (cell == null || cell.StringCellValue == "")
            {
                return(null);
            }

            string       linkWhere = cell.StringCellValue;
            CellPosition cp;
            string       linkSheetName = ReadLinkHelper.ParseLinkCell(cell, out cp);

            ISheet linkSheet = cell.Sheet.Workbook.GetSheet(linkSheetName);

            return(ReadListData(linkSheet, cp.colStart, cp.rowStart, cp.rowEnd, t));
        }
예제 #2
0
        public object ReadLinkObject(ICell cell, TypeInfo t)
        {
            if (cell == null || cell.StringCellValue == "")
            {
                return(null);
            }
            string       linkWhere = cell.StringCellValue;
            CellPosition cp;
            string       linkSheetName = ReadLinkHelper.ParseLinkCell(cell, out cp);

            if (cp.rowEnd <= 0)
            {
                cp.rowEnd = cp.rowStart;
            }

            ISheet linkSheet = cell.Sheet.Workbook.GetSheet(linkSheetName);
            Schema schema    = SchemaReader.ReadSchema(linkSheet, headModel);

            //内容要跳过头
            return(ReadList(linkSheet, schema, cp.rowStart, cp.rowEnd, cp.colStart, cp.colEnd + 1, null)[0]);
        }
예제 #3
0
        public object ReadLinkDict(ICell cell, string keyField = null, bool removeKeyFieldInElement = false)
        {
            if (cell == null || cell.StringCellValue == "")
            {
                return(null);
            }
            string       linkWhere = cell.StringCellValue;
            CellPosition cp;
            string       cellKey;
            string       linkSheetName = ReadLinkHelper.ParseLinkCell(cell, out cp, out cellKey);

            if (string.IsNullOrEmpty(keyField))
            {
                keyField = cellKey;
            }

            ISheet linkSheet = cell.Sheet.Workbook.GetSheet(linkSheetName);
            Schema schema    = SchemaReader.ReadSchema(linkSheet, headModel);

            //内容要跳过头
            return(ReadDictionary(linkSheet, schema, keyField, cp.rowStart, cp.colStart, cp.colEnd + 1, null, removeKeyFieldInElement, cp.rowEnd));
        }