Commit d3652cb5 by guanzhenshan

判断导入的格式是否正确

parent cd8587f0
......@@ -4613,6 +4613,25 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
var read = new System.IO.StreamReader(file.OpenReadStream());
var list = new List<dc_base_income_ebay_paypal>();
var s = read.ReadLine(); //不要第一行
if (formattype == 1 && s.Substring(0, 2) != "日期")
{
return Json(new
{
success = false,
msg = file.FileName + "不是中文格式"
});
}
else if (formattype != 1 && s.Substring(0, 2) != "日期")
{
return Json(new
{
success = false,
msg = file.FileName + "不是英文格式"
});
}
s = read.ReadLine();
var row_index = 1;
while (!string.IsNullOrEmpty(s))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment