导入Excel模板中的数据到数据库(按行读取Excel)
using Aspose.Cells;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YiCheng.Common.DAL;
using YiCheng.Common.Sql;
using YiCheng.Common.Tools;
using YiCheng.PreOrder;
using YiCheng.PreOrder.ChanPin;
using YiCheng.Systems.Files;
using YiCheng.Systems.Number;
public string ImportExcel(string path, string orderID)
{
string resultMsg = "";
Cells eCells;
var workbook = new Workbook(path);
try
{
eCells = workbook.Worksheets[0].Cells;
string title = YAsposeCellsHelper.Read(eCells, 0, "*****", 0).ToString();
}
catch
{
throw new Exception("不是***的Excel数据");
}
// 预订单
YPreOrder EShopOrder = new YPreOrder();
// 读取最后一行的数据,一般是备注之类的
string remark = Read(eCells, eCells.