提交当前本机整理版本
This commit is contained in:
@@ -47,6 +47,7 @@ using System.Web;
|
||||
using Lskj.Control.BrowserSetting;
|
||||
using System.Net;
|
||||
using Newtonsoft.Json;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Lskj.PubBomImportNew
|
||||
{
|
||||
@@ -405,8 +406,10 @@ namespace Lskj.PubBomImportNew
|
||||
{
|
||||
GridColumn primKeyColumn = gcMain.GridView.Columns.Where(n => n.FieldName.Equals(_primkey, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
|
||||
string sql = "select * from " + _tableName + " where 1<>1";
|
||||
SqlDataAdapter dat = BaseImpl.GetAdapterResult(sql);
|
||||
SqlCommandBuilder scb = new SqlCommandBuilder(dat);
|
||||
DbDataAdapter dat = BaseImpl.GetAdapterResult(sql);
|
||||
DbCommandBuilder scb = SqlHelper.dbFactory.CreateCommandBuilder();
|
||||
scb.DataAdapter = dat;
|
||||
//SqlCommandBuilder scb = new SqlCommandBuilder(dat);
|
||||
DataTable datatb = new DataTable();
|
||||
DataTable failedData = new DataTable();
|
||||
dat.Fill(datatb);
|
||||
@@ -2036,4 +2039,38 @@ namespace Lskj.PubBomImportNew
|
||||
throw new Exception($"文件{Path.GetFileName(filePath)}上传失败\r\n{ex.Message}");
|
||||
isUpload = false;
|
||||
}
|
||||
msg = retur
|
||||
msg = returnMsg;
|
||||
outFileId = fileId;
|
||||
return isUpload;
|
||||
}
|
||||
/// <summary>
|
||||
/// 附件转换byte[]
|
||||
/// </summary>
|
||||
/// <param name="filePath">附件路径</param>
|
||||
/// <returns>二进制</returns>
|
||||
private byte[] ConvertFileToBytes(string filePath)
|
||||
{
|
||||
byte[] bytContent = null;
|
||||
System.IO.FileStream fs = null;
|
||||
System.IO.BinaryReader br = null;
|
||||
try
|
||||
{
|
||||
fs = new FileStream(filePath, System.IO.FileMode.Open);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (fs != null)
|
||||
br = new BinaryReader((Stream)fs);
|
||||
if (br != null)
|
||||
bytContent = br.ReadBytes((Int32)fs.Length);
|
||||
if (fs != null)
|
||||
fs.Dispose();
|
||||
}
|
||||
return bytContent;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user