|
|
@@ -13,23 +13,19 @@ namespace UMES.DLLService
|
|
|
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
|
|
|
public interface IMESHelper
|
|
|
{
|
|
|
- [DispId(14)]
|
|
|
+ [DispId(12)]
|
|
|
bool CheckRoutePassed(string iSN, string iResCode, out string oErrMessage);
|
|
|
bool GetRcardMOInfo(string iSN, out string oMoCode, out string oErrMessage);
|
|
|
bool CheckUserAndResourcePassed(string iUserCode, string iResCode, string iPassWord, out string oErrMessage);
|
|
|
- bool GetAddressRangeByMO(string iSN, out string oWIFI, out string oBT, out string oCode1, out string oCode2, out string oCdoe3, out string oErrMessage);
|
|
|
- bool SetAddressInfo(string iSN, string iWIFI, string iBT, string iCode1, string iCode2, string iCode3, out string oErrorMessage);
|
|
|
- //bool GetMaster(out string oMaster);
|
|
|
- //bool SetMaster(string Master);
|
|
|
- bool SetTestDetail(string iSN, string iTestResult, string iResCode, string[] iTestDetail, out string oErrMessage);
|
|
|
- bool GetMEIOrNetCodeRange(string iSnCode, string iIMEI1, string iNetCode, out string oIMEI1, out string oIMEI2, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oID4, out string oID5, out string oErrMessage);
|
|
|
+ bool GetAddressRangeByMO(string iSN, out Dictionary<string, string> oInfo, out string oErrMessage);
|
|
|
+ bool SetAddressInfo(string iSN, string iMac, string iBT, string iCode1, string iCode2, string iCode3, out string oErrorMessage);
|
|
|
+ bool SetTestDetail(string iSN, string iTestResult, string iResCode, string[,] iTestDetail, out string oErrMessage);
|
|
|
+ bool GetMEIOrNetCodeRange(string iSnCode, string iIMEI1, string iNetCode, out Dictionary<string, string> oInfo, out string oErrMessage);
|
|
|
bool SetIMEIInfo(string iSnCode, string iIMEI1, out string oErrMessage);
|
|
|
- bool GetMobileAllInfo(string iSnCode, out string oWIFI, out string oBT, out string oCode1, out string oCode2, out string oCode3, out string oIMEI1, out string oIMEI2, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oID4, out string oID5, out string oErrorMessage);
|
|
|
+ bool GetMobileAllInfo(string iSnCode, out Dictionary<string, string> oInfo, out string oErrorMessage);
|
|
|
bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iOperator, string iResult, string iErrCode, string flag, out string oErrorMessage);
|
|
|
bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage);
|
|
|
bool GoMo(string iMO, string iSN, string iResCode, out string oErrMessage);
|
|
|
- bool GetSoftVersion(string iSN, out string oSoftVersion, out string oErrMessage);
|
|
|
- //bool GetProductRelation(string iSN, out string oWIFI, out string oBT, out string IMEI1, out string IMEI2, out string IMEI3, out string oNetCode, out string oMEID, out string oErrMessage);
|
|
|
}
|
|
|
|
|
|
[Guid("41EAB546-6EF4-464A-895A-9C34013A5D8C")]
|
|
|
@@ -43,14 +39,12 @@ namespace UMES.DLLService
|
|
|
//用于存放批量执行的SQL
|
|
|
List<string> sqls = new List<string>();
|
|
|
//系统默认的的连接字符串
|
|
|
- private string ConnectionStrings = "Data Source=10.8.0.34/orcl;User ID=MES;PassWord=select!#%*(;";
|
|
|
+ private string ConnectionStrings = "Data Source=192.168.1.23/orcl;User ID=MES;PassWord=select!#%*(;";
|
|
|
//用户选择的数据库的连接字符串
|
|
|
private OracleConnection connection;
|
|
|
//用户选择的数据库的连接字符串
|
|
|
private OracleCommand command = null;
|
|
|
|
|
|
- DataTable MasterDB;
|
|
|
-
|
|
|
public MESHelper()
|
|
|
{
|
|
|
connection = new OracleConnection(ConnectionStrings);
|
|
|
@@ -130,70 +124,6 @@ namespace UMES.DLLService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- [Description("获取工单软件版本")]
|
|
|
- public bool GetSoftVersion(string iSN, out string oSoftVersion, out string oErrMessage)
|
|
|
- {
|
|
|
- string oMakeCode = "";
|
|
|
- oErrMessage = "";
|
|
|
- GetRcardMOInfo(iSN, out oMakeCode, out oErrMessage);
|
|
|
- oSoftVersion = getFieldDataByCondition("make", "ma_softversion", "ma_code='" + oMakeCode + "'").ToString();
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- //[Description("获取SN关联采集信息")]
|
|
|
- //public bool GetProductRelation(string iSN, out string oWIFI, out string oBT, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oNetCode, out string oMEID, out string oErrMessage)
|
|
|
- //{
|
|
|
- // oWIFI = "";
|
|
|
- // oBT = "";
|
|
|
- // oIMEI1 = "";
|
|
|
- // oIMEI2 = "";
|
|
|
- // oIMEI3 = "";
|
|
|
- // oNetCode = "";
|
|
|
- // oMEID = "";
|
|
|
- // string oMakeCode = "";
|
|
|
- // if (GetRcardMOInfo(iSN, out oMakeCode, out oErrMessage))
|
|
|
- // {
|
|
|
- // DataTable dt = (DataTable)ExecuteSql("select mal_mac,mal_bt from makeaddresslist where mal_makecode='" + oMakeCode + "' and rownum=1 ", "select");
|
|
|
- // if (dt.Rows.Count > 0)
|
|
|
- // {
|
|
|
- // if (dt.Rows[0]["mal_mac"].ToString() != "")
|
|
|
- // {
|
|
|
- // oWIFI = "Required";
|
|
|
- // }
|
|
|
- // if (dt.Rows[0]["mal_bt"].ToString() != "")
|
|
|
- // {
|
|
|
- // oBT = "Required";
|
|
|
- // }
|
|
|
- // }
|
|
|
- // dt = (DataTable)ExecuteSql("select mil_imei1,mil_imei2,mil_imei3,mil_netcode,mil_meid from makeimeilist where mil_makecode='" + oMakeCode + "' and rownum=1", "select");
|
|
|
- // if (dt.Rows.Count > 0)
|
|
|
- // {
|
|
|
- // if (dt.Rows[0]["mil_imei1"].ToString() != "")
|
|
|
- // {
|
|
|
- // oIMEI1 = "Required";
|
|
|
- // }
|
|
|
- // if (dt.Rows[0]["mil_imei2"].ToString() != "")
|
|
|
- // {
|
|
|
- // oIMEI2 = "Required";
|
|
|
- // }
|
|
|
- // if (dt.Rows[0]["mil_imei3"].ToString() != "")
|
|
|
- // {
|
|
|
- // oIMEI3 = "Required";
|
|
|
- // }
|
|
|
- // if (dt.Rows[0]["mil_netcode"].ToString() != "")
|
|
|
- // {
|
|
|
- // oNetCode = "Required";
|
|
|
- // }
|
|
|
- // if (dt.Rows[0]["mil_meid"].ToString() != "")
|
|
|
- // {
|
|
|
- // oMEID = "Required";
|
|
|
- // }
|
|
|
- // }
|
|
|
- // return true;
|
|
|
- // }
|
|
|
- // else return false;
|
|
|
- //}
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 验证用户身份信息和岗位资源
|
|
|
/// </summary>
|
|
|
@@ -272,13 +202,14 @@ namespace UMES.DLLService
|
|
|
/// <param name="oErrMessage"></param>
|
|
|
/// <returns></returns>
|
|
|
[Description("分配MAC和BT信息")]
|
|
|
- public bool GetAddressRangeByMO(string iSN, out string oWIFI, out string oBT, out string oCode1, out string oCode2, out string oCdoe3, out string oErrMessage)
|
|
|
+ public bool GetAddressRangeByMO(string iSN, out Dictionary<string, string> oInfo, out string oErrMessage)
|
|
|
{
|
|
|
- oWIFI = "";
|
|
|
- oBT = "";
|
|
|
- oCode1 = "";
|
|
|
- oCode2 = "";
|
|
|
- oCdoe3 = "";
|
|
|
+ oInfo = new Dictionary<string, string>();
|
|
|
+ string oWIFI = "";
|
|
|
+ string oBT = "";
|
|
|
+ string oCode1 = "";
|
|
|
+ string oCode2 = "";
|
|
|
+ string oCdoe3 = "";
|
|
|
if (iSN == "")
|
|
|
{
|
|
|
oErrMessage = "SN不能为空";
|
|
|
@@ -290,11 +221,11 @@ namespace UMES.DLLService
|
|
|
string[] param = new string[] { iSN, omakeCode, oWIFI, oBT, oCode1, oCode2, oCdoe3, oErrMessage };
|
|
|
string[] ParamName = new string[] { "v_i_sncode", "v_i_macode", "v_o_mac", "v_o_bt", "v_o_code1", "v_o_code2", "v_o_code3", "v_o_errmsg" };
|
|
|
CallProcedure("CS_GETADDRESSBYMAKECODE", ParamName, ref param);
|
|
|
- oWIFI = param[2];
|
|
|
- oBT = param[3];
|
|
|
- oCode1 = param[4];
|
|
|
- oCode2 = param[5];
|
|
|
- oCdoe3 = param[6];
|
|
|
+ oInfo.Add("MAC", param[2]);
|
|
|
+ oInfo.Add("BT", param[3]);
|
|
|
+ oInfo.Add("Code1", param[4]);
|
|
|
+ oInfo.Add("Code2", param[5]);
|
|
|
+ oInfo.Add("Code3", param[6]);
|
|
|
oErrMessage = param[7];
|
|
|
if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
|
|
|
return true;
|
|
|
@@ -321,18 +252,18 @@ namespace UMES.DLLService
|
|
|
/// <param name="oErrMessage"></param>
|
|
|
/// <returns></returns>
|
|
|
[Description("分配IMEI和NetCode信息")]
|
|
|
- public bool GetMEIOrNetCodeRange(string iSN, string iIMEI1, string iNetCode, out string oIMEI1, out string oIMEI2, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oID4, out string oID5, out string oErrMessage)
|
|
|
+ public bool GetMEIOrNetCodeRange(string iSN, string iIMEI1, string iNetCode, out Dictionary<string, string> oInfo, out string oErrMessage)
|
|
|
{
|
|
|
- oIMEI1 = "";
|
|
|
- oIMEI2 = "";
|
|
|
- oMEID = "";
|
|
|
- oNetCode = "";
|
|
|
- oPSN = "";
|
|
|
- oID1 = "";
|
|
|
- oID2 = "";
|
|
|
- oID3 = "";
|
|
|
- oID4 = "";
|
|
|
- oID5 = "";
|
|
|
+ oInfo = new Dictionary<string, string>();
|
|
|
+ string oIMEI1 = "";
|
|
|
+ string oIMEI2 = "";
|
|
|
+ string oMEID = "";
|
|
|
+ string oNetCode = "";
|
|
|
+ string oPSN = "";
|
|
|
+ string oID1 = "";
|
|
|
+ string oID2 = "";
|
|
|
+ string oID3 = "";
|
|
|
+
|
|
|
if (iSN == "")
|
|
|
{
|
|
|
oErrMessage = "SN不能为空";
|
|
|
@@ -342,14 +273,14 @@ namespace UMES.DLLService
|
|
|
string[] param = new string[] { iSN, "", iIMEI1, iNetCode, oIMEI1, oIMEI2, "", oMEID, oNetCode, oPSN, oID1, oID2, oID3, oErrMessage };
|
|
|
string[] ParamName = new string[] { "v_i_sncode", "v_i_macode", "v_i_imei", "v_i_netcode", "v_o_imei1", "v_o_imei2", "v_o_imei3", "v_o_meid", "v_o_netcode", "v_o_psn", "v_o_id1", "v_o_id2", "v_o_id3", "v_o_errmsg" };
|
|
|
CallProcedure("CS_GETIMEIORNETCODERANGE", ParamName, ref param);
|
|
|
- oIMEI1 = param[4];
|
|
|
- oIMEI2 = param[5];
|
|
|
- oMEID = param[7];
|
|
|
- oNetCode = param[8];
|
|
|
- oPSN = param[9];
|
|
|
- oID1 = param[10];
|
|
|
- oID2 = param[11];
|
|
|
- oID3 = param[12];
|
|
|
+ oInfo.Add("IMEI1", param[4]);
|
|
|
+ oInfo.Add("IMEI2", param[5]);
|
|
|
+ oInfo.Add("MEID", param[7]);
|
|
|
+ oInfo.Add("NETCODE", param[8]);
|
|
|
+ oInfo.Add("PSN", param[9]);
|
|
|
+ oInfo.Add("ID1", param[10]);
|
|
|
+ oInfo.Add("ID2", param[11]);
|
|
|
+ oInfo.Add("ID3", param[12]);
|
|
|
oErrMessage = param[13];
|
|
|
if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
|
|
|
return true;
|
|
|
@@ -413,23 +344,10 @@ namespace UMES.DLLService
|
|
|
/// <param name="oErrMessage"></param>
|
|
|
/// <returns></returns>
|
|
|
[Description("查询已分配的信息")]
|
|
|
- public bool GetMobileAllInfo(string iSN, out string oWIFI, out string oBT, out string oCode1, out string oCode2, out string oCode3, out string oIMEI1, out string oIMEI2, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oID4, out string oID5, out string oErrMessage)
|
|
|
+ public bool GetMobileAllInfo(string iSN, out Dictionary<string, string> oInfo, out string oErrMessage)
|
|
|
{
|
|
|
- oBT = "";
|
|
|
- oMEID = "";
|
|
|
- oWIFI = "";
|
|
|
- oPSN = "";
|
|
|
- oNetCode = "";
|
|
|
- oIMEI1 = "";
|
|
|
- oIMEI2 = "";
|
|
|
- oCode1 = "";
|
|
|
- oCode2 = "";
|
|
|
- oCode3 = "";
|
|
|
- oID1 = "";
|
|
|
- oID2 = "";
|
|
|
- oID3 = "";
|
|
|
- oID4 = "";
|
|
|
- oID5 = "";
|
|
|
+ oInfo = new Dictionary<string, string>();
|
|
|
+ oErrMessage = "";
|
|
|
if (iSN == "")
|
|
|
{
|
|
|
oErrMessage = "SN不能为空";
|
|
|
@@ -442,19 +360,32 @@ namespace UMES.DLLService
|
|
|
DataTable dt = getFieldsDataByCondition("MakeSerial", new string[] { "ms_id", "ms_mac", "ms_bt", "ms_meid", "ms_netcode", "ms_psn", "ms_imei1", "ms_imei2", "ms_imei3", "ms_othcode1", "ms_othcode2", "ms_othcode3", "ms_othid1", "ms_othid2", "ms_othid3" }, "ms_id='" + ms_id + "'");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
- oWIFI = dt.Rows[0]["ms_mac"].ToString();
|
|
|
- oBT = dt.Rows[0]["ms_bt"].ToString();
|
|
|
- oPSN = dt.Rows[0]["ms_psn"].ToString();
|
|
|
- oNetCode = dt.Rows[0]["ms_netcode"].ToString();
|
|
|
- oMEID = dt.Rows[0]["ms_meid"].ToString();
|
|
|
- oIMEI1 = dt.Rows[0]["ms_imei1"].ToString();
|
|
|
- oIMEI2 = dt.Rows[0]["ms_imei2"].ToString();
|
|
|
- oCode1 = dt.Rows[0]["ms_othcode1"].ToString();
|
|
|
- oCode2 = dt.Rows[0]["ms_othcode2"].ToString();
|
|
|
- oCode3 = dt.Rows[0]["ms_othcode3"].ToString();
|
|
|
- oID1 = dt.Rows[0]["ms_othid3"].ToString();
|
|
|
- oID2 = dt.Rows[0]["ms_othid3"].ToString();
|
|
|
- oID3 = dt.Rows[0]["ms_othid3"].ToString();
|
|
|
+ string Code1 = "";
|
|
|
+ string Code2 = "";
|
|
|
+ string Code3 = "";
|
|
|
+ string Code4 = "";
|
|
|
+ string Code5 = "";
|
|
|
+ string Code6 = "";
|
|
|
+ string Code7 = "";
|
|
|
+ string Code8 = "";
|
|
|
+ string Code9 = "";
|
|
|
+ string Code10 = "";
|
|
|
+ string Code11 = "";
|
|
|
+ string Code12 = "";
|
|
|
+ string Code13 = "";
|
|
|
+ string Code14 = "";
|
|
|
+ string Code15 = "";
|
|
|
+ string[] param = new string[] { ms_id, Code1, Code2, Code3, Code4, Code5, Code6, Code7, Code8, Code9, Code10, Code11, Code12, Code13, Code14, Code15 };
|
|
|
+ string[] ParamName = new string[] { "v_ms_id", "v_i_code1", "v_i_code2", "v_i_code3", "v_i_code4", "v_i_code5", "v_i_code6", "v_i_code7", "v_i_code8", "v_i_code9", "v_i_code10", "v_i_code11", "v_i_code12", "v_i_code13", "v_i_code14", "v_i_code15" };
|
|
|
+ CallProcedure("GetMobileAllInfo", ParamName, ref param);
|
|
|
+ for (int i = 1; i < param.Length; i++)
|
|
|
+ {
|
|
|
+ //获取出来的参数使用^分割
|
|
|
+ if (param[i] != "" && param[i] != "null" && param[i] != null)
|
|
|
+ {
|
|
|
+ oInfo.Add(param[i].Split('^')[0], param[i].Split('^')[1]);
|
|
|
+ }
|
|
|
+ }
|
|
|
oErrMessage = "";
|
|
|
return true;
|
|
|
}
|
|
|
@@ -499,7 +430,7 @@ namespace UMES.DLLService
|
|
|
/// 保存Mac地址和BT地址
|
|
|
/// </summary>
|
|
|
/// <param name="iSN"></param>
|
|
|
- /// <param name="iWIFI"></param>
|
|
|
+ /// <param name="iMac"></param>
|
|
|
/// <param name="iBT"></param>
|
|
|
/// <param name="iCode1"></param>
|
|
|
/// <param name="iCode2"></param>
|
|
|
@@ -507,7 +438,7 @@ namespace UMES.DLLService
|
|
|
/// <param name="oErrMessage"></param>
|
|
|
/// <returns></returns>
|
|
|
[Description("写入SN的Wifi,BT信息")]
|
|
|
- public bool SetAddressInfo(string iSN, string iWIFI, string iBT, string iCode1, string iCode2, string iCode3, out string oErrMessage)
|
|
|
+ public bool SetAddressInfo(string iSN, string iMac, string iBT, string iCode1, string iCode2, string iCode3, out string oErrMessage)
|
|
|
{
|
|
|
if (iSN == "")
|
|
|
{
|
|
|
@@ -515,7 +446,7 @@ namespace UMES.DLLService
|
|
|
return false;
|
|
|
}
|
|
|
oErrMessage = "";
|
|
|
- string[] param = new string[] { iSN, iWIFI, iBT, iCode1, iCode2, iCode3, oErrMessage };
|
|
|
+ string[] param = new string[] { iSN, iMac, iBT, iCode1, iCode2, iCode3, oErrMessage };
|
|
|
string[] ParamName = new string[] { "v_i_sncode", "v_i_mac", "v_i_bt", "v_i_code1", "v_i_code2", "v_i_code3", "v_o_errmsg" };
|
|
|
CallProcedure("CS_SETADDRESSINFO", ParamName, ref param);
|
|
|
oErrMessage = param[6];
|
|
|
@@ -591,41 +522,6 @@ namespace UMES.DLLService
|
|
|
return CS_SetFinish(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrMessage);
|
|
|
}
|
|
|
|
|
|
- //[Description("获取账套信息")]
|
|
|
- //public bool GetMaster(out string oMaster)
|
|
|
- //{
|
|
|
- // MasterDB = (DataTable)ExecuteSql("select ms_pwd,ma_user,ma_inneraddress from master", "select");
|
|
|
- // oMaster = "";
|
|
|
- // for (int i = 0; i < MasterDB.Rows.Count; i++)
|
|
|
- // {
|
|
|
- // if (i != MasterDB.Rows.Count - 1)
|
|
|
- // oMaster += MasterDB.Rows[i]["ma_user"].ToString() + "|";
|
|
|
- // else
|
|
|
- // oMaster += MasterDB.Rows[i]["ma_user"].ToString();
|
|
|
- // }
|
|
|
- // return true;
|
|
|
- //}
|
|
|
-
|
|
|
- //[Description("设置账套信息")]
|
|
|
- //public bool SetMaster(string iMaster)
|
|
|
- //{
|
|
|
- // DataTable dt = (DataTable)ExecuteSql("select ms_pwd,ma_user,ma_inneraddress from master where ma_user='" + iMaster + "'", "select");
|
|
|
- // if (dt.Rows.Count > 0)
|
|
|
- // {
|
|
|
- // ConnectionStrings = "Data Source=" + dt.Rows[0]["ma_inneraddress"].ToString() + "/orcl;User ID=" + iMaster + ";PassWord=" + dt.Rows[0]["ms_pwd"].ToString() + ";";
|
|
|
- // try
|
|
|
- // {
|
|
|
- // connection = new OracleConnection(ConnectionStrings);
|
|
|
- // }
|
|
|
- // catch (Exception)
|
|
|
- // {
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // return true;
|
|
|
- // }
|
|
|
- // return false;
|
|
|
- //}
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 设置测试结果
|
|
|
/// </summary>
|
|
|
@@ -689,7 +585,7 @@ namespace UMES.DLLService
|
|
|
/// <param name="oErrMessage"></param>
|
|
|
/// <returns></returns>
|
|
|
[Description("设置测试结果")]
|
|
|
- public bool SetTestDetail(string iSN, string iTestResult, string iResCode, string[] iTestDetail, out string oErrMessage)
|
|
|
+ public bool SetTestDetail(string iSN, string iClass, string iResCode, string[,] iTestDetail, out string oErrMessage)
|
|
|
{
|
|
|
if (iSN == "" || iSN == null)
|
|
|
{
|
|
|
@@ -701,10 +597,33 @@ namespace UMES.DLLService
|
|
|
GetRcardMOInfo(iSN, out omakeCode, out oErrMessage);
|
|
|
sql.Clear();
|
|
|
sql.Append("begin ");
|
|
|
- for (int i = 0; i < iTestDetail.Length; i++)
|
|
|
+ bool needBreak = false;
|
|
|
+ for (int i = 0; i < iTestDetail.Length / 200; i++)
|
|
|
{
|
|
|
- sql.Append("Insert into STEPTESTDETAIL (STD_ID,STD_CLASS,STD_SN,STD_MAKECODE,STD_ACTUALVALUE,STD_TESTRESULT,STD_INDATE,STD_RESCODE)");
|
|
|
- sql.Append("values(STEPTESTDETAIL_SEQ.nextval,'ITEM" + i + "','" + iSN + "','" + omakeCode + "','" + iTestDetail[i] + "','" + iTestResult + "',sysdate,'" + iResCode + "');");
|
|
|
+ string DataField = "Insert into MES_TEST(STD_ID,STD_SN,STD_MAKECODE,STD_CLASS,STD_TESTDATE,";
|
|
|
+ string ValueField = ")values(MES_TEST_SEQ.nextval,'" + iSN + "','" + omakeCode + "','" + iClass + "',sysdate,";
|
|
|
+ for (int j = 0; j < 200; j++)
|
|
|
+ {
|
|
|
+ if (j == 0)
|
|
|
+ {
|
|
|
+ DataField += "STD_ITEMNAME,";
|
|
|
+ //如果传递的参数没有测试名称则中断插入
|
|
|
+ if (iTestDetail[i, j] == "" || iTestDetail[i, j] == null)
|
|
|
+ {
|
|
|
+ //外层循环也需要中断
|
|
|
+ needBreak = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ DataField += "STD_ITEM" + j + " ,";
|
|
|
+ }
|
|
|
+ ValueField += "'" + iTestDetail[i, j] + "',";
|
|
|
+ }
|
|
|
+ if (needBreak)
|
|
|
+ break;
|
|
|
+ sql.Append(DataField.Substring(0, DataField.Length - 1) + ValueField.Substring(0, ValueField.Length - 1) + ");");
|
|
|
}
|
|
|
sql.Append("end;");
|
|
|
ExecuteSql(sql.ToString(), "insert");
|