Commit c16e40e0 by lizefeng

周转表分段导出

parent 1c82464b
......@@ -14,15 +14,14 @@ namespace AutoTurnOver.Common
/// </summary>
/// <param name="dt">提供保存数据的DataTable</param>
/// <param name="fileName">CSV的文件路径</param>
public static void SaveCSV(DataTable dt, string fileName)
public static void SaveCSV(DataTable dt, string fileName, bool existsPush)
{
// 是否追加
var existsPush = Directory.Exists(Path.GetDirectoryName(fileName));
if (!existsPush)
if (!Directory.Exists(Path.GetDirectoryName(fileName)))
{
Directory.CreateDirectory(Path.GetDirectoryName(fileName));
}
FileStream fs = new FileStream(fileName, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write);
FileStream fs = new FileStream(fileName, existsPush?FileMode.OpenOrCreate: FileMode.Create, System.IO.FileAccess.Write);
StreamWriter sw = new StreamWriter(fs, System.Text.Encoding.Default);
string data = "";
......
......@@ -227,7 +227,7 @@ namespace AutoTurnOver.Controllers
DataTableHelper.SaveCSV(table, fileName);
DataTableHelper.SaveCSV(table, fileName,page>1);
}
......
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