Exemplo n.º 1
0
        public IList <Category> ReadListFromExcel(System.IO.Stream stream, out string errMsg)
        {
            IDataTableConverter <Category>       CategoryReader = new CategoryDataTableConverter();
            ImportToDatabaseFromExcel <Category> importor       = new ImportToDatabaseFromExcel <Category>(CategoryReader, this);

            return(importor.ReadList(stream, out errMsg));
        }
Exemplo n.º 2
0
        /// <summary>
        /// stream 相对于 filepath的好处: filepath只能是服务器上的物理文件路径; stream可以是客户端文件信息(比如 fileupload 的 PostFileStream属性)
        /// </summary>
        /// <param name="stream"></param>
        public void ImportCategoryFromExcel(System.IO.Stream stream, out string errMsg)
        {
            IDataTableConverter <Category>       CategoryReader = new CategoryDataTableConverter();
            ImportToDatabaseFromExcel <Category> importor       = new ImportToDatabaseFromExcel <Category>(CategoryReader, this);

            importor.ImportXslData(stream, out errMsg);
        }