Ejemplo n.º 1
0
        /// <summary>
        /// 从excel文件中读取产品信息
        /// </summary>
        /// <param name="stream"></param>
        /// <param name="errMsg"></param>
        /// <returns></returns>
        public IList <Product> ReadListFromExcel(System.IO.Stream stream, out string errMsg)
        {
            IDataTableConverter <Product>       productReader = new ProductDataTableConverter();
            ImportToDatabaseFromExcel <Product> importor      = new ImportToDatabaseFromExcel <Product>(productReader, this);

            return(importor.ReadList(stream, out errMsg));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 从excel文件中读取产品信息和内嵌图片
        /// </summary>
        /// <param name="stream"></param>
        /// <param name="errMsg"></param>
        /// <param name="allPictures"></param>
        /// <returns></returns>
        public IList <Product> ReadListFromExcelWithAllPictures(System.IO.Stream stream, out string errMsg, out System.Collections.IList allPictures)
        {
            IDataTableConverter <Product>       productReader = new ProductDataTableConverter();
            ImportToDatabaseFromExcel <Product> importor      = new ImportToDatabaseFromExcel <Product>(productReader, this);

            return(importor.ReadListWithAllPictures(stream, out errMsg, out allPictures));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 导入excel产品列表
        /// </summary>
        /// <param name="stream">excel流</param>
        /// <param name="errMsg"></param>
        public void ImportProductFromExcel(System.IO.Stream stream, out string errMsg)
        {
            IDataTableConverter <Product>       productReader = new ProductDataTableConverter();
            ImportToDatabaseFromExcel <Product> importor      = new ImportToDatabaseFromExcel <Product>(productReader, this);

            importor.ImportXslData(stream, out errMsg);
        }
Ejemplo n.º 4
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));
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
0
        public IList <Supplier> ReadSupplierListFromExcel(System.IO.Stream stream, out string errmsg)
        {
            IDataTableConverter <Supplier>       supplierReader = new SupplierDataConverter();
            ImportToDatabaseFromExcel <Supplier> importor       = new ImportToDatabaseFromExcel <Supplier>(supplierReader, this);

            return(importor.ReadList(stream, out errmsg));
        }
Ejemplo n.º 7
0
        public void ImportSupplierFromExcel(System.IO.Stream stream, out string errmsg)
        {
            IDataTableConverter <Supplier>       supplierReader = new SupplierDataConverter();
            ImportToDatabaseFromExcel <Supplier> importor       = new ImportToDatabaseFromExcel <Supplier>(supplierReader, this);

            importor.ImportXslData(stream, out errmsg);
        }