|
@@ -1,5 +1,6 @@
|
|
|
using MOKA_Factory_Tools.DAL;
|
|
|
using MOKA_Factory_Tools.Models;
|
|
|
+using SXLibrary;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
@@ -49,6 +50,8 @@ namespace MOKA_Factory_Tools.BLL
|
|
|
aMResult.SN = strSN;
|
|
|
#endregion
|
|
|
|
|
|
+ Log.WriteInfoLog(string.Format("上一次SN={0},当前SN={1}", strLastSN, aMResult.SN));
|
|
|
+
|
|
|
if (IsRecordExist(aMResult))
|
|
|
{
|
|
|
if ( !UpdateAMResults(aMResult, bResult, strErrMsg) )
|
|
@@ -114,9 +117,11 @@ namespace MOKA_Factory_Tools.BLL
|
|
|
AMResult redo0Model = dalAMResult.GetModel(string.Format("Station='{0}' and SN='{1}' and ReDo='{2}'", model.Station, model.SN, "0"));
|
|
|
if ( strLastSN == model.SN )
|
|
|
{// 连接抄写数据,更新ReDo="0"的记录;
|
|
|
+ Log.WriteInfoLog(string.Format("上一次SN={0} 与当前SN={1} 相同,只更新数据", strLastSN, model.SN));
|
|
|
if ( !UpdateReDo0AMResult(redo0Model, TestResult, strErrMsg) )
|
|
|
{
|
|
|
// 更新失败;
|
|
|
+ Log.WriteInfoLog(string.Format("AMResult更新SN={0},Station={1},TestTime={2},ReDo={3} 失败", redo0Model.SN, redo0Model.Station, redo0Model.TestTime, redo0Model.ReDo));
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
@@ -127,6 +132,7 @@ namespace MOKA_Factory_Tools.BLL
|
|
|
if ( !dalAMResult.Update(redo0Model, string.Format("Station='{0}' and SN='{1}' and ReDo='{2}'", redo0Model.Station, redo0Model.SN, "0")) )
|
|
|
{
|
|
|
// 更新失败;
|
|
|
+ Log.WriteInfoLog(string.Format("AMResult更新SN={0},Station={1},TestTime={2},ReDo={3} 失败", redo0Model.SN, redo0Model.Station, redo0Model.TestTime, redo0Model.ReDo));
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -134,6 +140,7 @@ namespace MOKA_Factory_Tools.BLL
|
|
|
if ( !AddAMResult(model, TestResult, strErrMsg) )
|
|
|
{
|
|
|
// 添加失败;
|
|
|
+ Log.WriteInfoLog(string.Format("AMResult新增SN={0},Station={1},TestTime={2},ReDo={3} 失败", model.SN, model.Station, model.TestTime, model.ReDo));
|
|
|
return false;
|
|
|
}
|
|
|
}
|