20240429 修改综合管理导入导出

This commit is contained in:
2024-04-29 19:13:54 +08:00
parent fc56b1f6c2
commit a3e123957d
48 changed files with 560 additions and 266 deletions
@@ -126,7 +126,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
oleDBConn.Close();
oleDBConn.Dispose();
AddDatasetToSQL(ds.Tables[0], 13);
AddDatasetToSQL(ds.Tables[0], 14);
hdCheckResult.Text = "1";
}
catch (Exception exc)
@@ -173,7 +173,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
var cns = from x in Funs.DB.Base_CNProfessional select x;
for (int i = 0; i < ir; i++)
for (int i = 1; i < ir; i++)
{
Model.Comprehensive_InspectionEquipment oldViewInfo = new Model.Comprehensive_InspectionEquipment();
string row0 = pds.Rows[i][0].ToString().Trim();
@@ -223,21 +223,23 @@ namespace FineUIPro.Web.CQMS.Comprehensive
}
}
string row12 = pds.Rows[i][12].ToString();
if (string.IsNullOrEmpty(row12))
string row13 = pds.Rows[i][13].ToString();
if (string.IsNullOrEmpty(row13))
{
result += (i + 2).ToString() + "," + "标识编号" + "," + "此项为必填项!" + "|";
}
//else
//{
// var view = oldViewInfos.FirstOrDefault(x => x.RemarkCode == row12);
// if (view != null)
// {
// result += (i + 2).ToString() + "," + "标识编号" + "," + "[" + row12 + "]已存在!" + "|";
// }
//}
else
{
try
{
int t = Convert.ToInt32(row13);
}
catch (Exception)
{
result += (i + 2).ToString() + "," + "标识编号" + "," + "[" + row13 + "]错误!" + "|";
}
}
}
else
{
result += (i + 2).ToString() + "," + "报验单位" + "," + "[" + row0 + "]不存在!" + "|";
@@ -349,7 +351,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
oleDBConn.Close();
oleDBConn.Dispose();
AddDatasetToSQL2(ds.Tables[0], 13);
AddDatasetToSQL2(ds.Tables[0], 14);
}
catch (Exception ex)
{
@@ -388,7 +390,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
var cns = from x in Funs.DB.Base_CNProfessional select x;
for (int i = 0; i < ir; i++)
for (int i = 1; i < ir; i++)
{
Model.Comprehensive_InspectionEquipment oldViewInfo = new Model.Comprehensive_InspectionEquipment();
string row0 = pds.Rows[i][0].ToString().Trim();
@@ -396,7 +398,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
if (unitInfo != null && !string.IsNullOrEmpty(row0))
{
oldViewInfo = oldViewInfos.Where(x => x.UnitId == unitInfo.UnitId
&& x.RemarkCode == pds.Rows[i][12].ToString().Trim()
&& x.RemarkCode ==Funs.GetNewInt(pds.Rows[i][13].ToString().Trim())
).FirstOrDefault();
if (oldViewInfo == null)//新增
{
@@ -421,11 +423,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
{
Ins.InspectionDate = Convert.ToDateTime(pds.Rows[i][11].ToString().Trim());
}
Ins.RemarkCode = pds.Rows[i][12].ToString().Trim();
Ins.UsedPlace = pds.Rows[i][12].ToString().Trim();
Ins.RemarkCode =Funs.GetNewInt(pds.Rows[i][13].ToString().Trim());
Ins.InspectionEquipmentId = SQLHelper.GetNewID(typeof(Model.Comprehensive_InspectionEquipment));
Ins.CompileMan = this.CurrUser.UserId;
Ins.CompileDate = DateTime.Now.Date;
Ins.Status = BLL.Const.Comprehensive_Complete;
Ins.Status = BLL.Const.Comprehensive_Compile;
BLL.InspectionEquipmentService.AddInspectionEquipment(Ins);
}
@@ -451,10 +454,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
{
oldViewInfo.InspectionDate = Convert.ToDateTime(pds.Rows[i][11].ToString().Trim());
}
oldViewInfo.RemarkCode = pds.Rows[i][12].ToString().Trim();
oldViewInfo.UsedPlace= pds.Rows[i][12].ToString().Trim();
oldViewInfo.RemarkCode =Funs.GetNewInt(pds.Rows[i][13].ToString().Trim());
oldViewInfo.CompileMan = this.CurrUser.UserId;
oldViewInfo.CompileDate = DateTime.Now.Date;
oldViewInfo.Status = BLL.Const.Comprehensive_Complete;
oldViewInfo.Status = BLL.Const.Comprehensive_Compile;
BLL.InspectionEquipmentService.UpdateInspectionEquipment(oldViewInfo);
//result += (i + 2).ToString() + "," + "报验编号" + "," + "该单位报验编号已存在!" + "|";
}
@@ -476,7 +480,6 @@ namespace FineUIPro.Web.CQMS.Comprehensive
#endregion
#endregion
#region
/// <summary>
/// 下载模板按钮