2022-11-23 焊接导入修改

This commit is contained in:
2022-11-23 15:38:28 +08:00
parent 0759a36121
commit 7994db8452
11 changed files with 84 additions and 51 deletions
@@ -70,7 +70,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
return;
}
string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower();
if (IsXls != ".xls")
if (IsXls != ".xlsx")
{
ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning);
return;
@@ -108,37 +108,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// <param name="filename">Excel文件路径名</param>
private void ImportXlsToData(string fileName)
{
//支持.xls和.xlsx,即包括office2010等版本的 HDR=Yes代表第一行是标题,不是数据;
//string cmdText = "Provider=Microsoft.ACE.OLEDB.4.0;Data Source={0};Extended Properties='Excel 8.0; HDR=Yes; IMEX=1'";
////建立连接
//OleDbConnection conn = new OleDbConnection(string.Format(cmdText, fileName));
try
try
{
//打开连接
//if (conn.State == ConnectionState.Broken || conn.State == ConnectionState.Closed)
//{
// conn.Open();
//}
//OleDbDataAdapter oleAdMaster = null;
//DataTable m_tableName = new DataTable();
//DataSet ds = new DataSet();
//m_tableName = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
//if (m_tableName != null && m_tableName.Rows.Count > 0)
//{
// m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim();
//}
//string sqlMaster;
//sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]";
//oleAdMaster = new OleDbDataAdapter(sqlMaster, conn);
//oleAdMaster.Fill(ds, "m_tableName");
//oleAdMaster.Dispose();
//conn.Close();
//conn.Dispose();
string oleDBConnString = String.Empty;
string oleDBConnString = String.Empty;
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
oleDBConnString += "Data Source=";
oleDBConnString += fileName;
@@ -1381,8 +1381,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
ShowNotify("导入成功!", MessageBoxIcon.Success);
PipelineService.hJGL_Pipelines = PipelineService.GetPipelinesByProjectId(this.CurrUser.LoginProjectId);
WeldJointService.hJGL_WeldJoints = WeldJointService.GetWeldJointByProjectid(this.CurrUser.LoginProjectId);
PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else
@@ -1684,6 +1684,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
BLL.HJGL_DesignBasisDataImportVerSionLogService.UpdateVersion(this.CurrUser.LoginProjectId, unitworkId, version, DataClassification);
PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId);
ShowNotify("恢复成功!");