Ejemplo n.º 1
0
        public ActionResult GetErrorItemCollection(string filePath, string className, string[] keyValue)
        {
            ExcelImportBase importApp = CreateInstance(className);

            if (importApp == null)
            {
                throw new Exception("创建反射实例失败!");
            }
            var data = importApp.Scan(filePath, keyValue);

            return(Content(data.ToJson()));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 导入数据
        /// </summary>
        /// <param name="filePath"></param>
        /// <param name="className"></param>
        /// <param name="acctId"></param>
        /// <returns></returns>
        public ActionResult Import(string filePath, string className, string[] keyValue)
        {
            ExcelImportBase importApp = CreateInstance(className);
            var             data      = importApp.Scan(filePath, keyValue);

            if (data.Count > 0)
            {
                return(Error("导入数据存在未处理的错误!"));
            }
            else
            {
                importApp.Import(filePath, keyValue);
                return(Success("数据导入成功!"));
            }
        }