public static bool saveSNRecord(SNData snData) { bool ret = false; string updateSql = "insert into Label_Print " + "([CurrentTestingLabel],[BurnedDateCode],[BurnedTimeSN],[CustomerDate],[Shijinzhisn]," + "[Sample],[SN],[midVar_time_date],[ReportNo],[strFSN]," + "[CustomerSN],[PrintCount],[PrintDate],[MO],[PN]," + "[Station],[Computer],[Operater],[Remark1],[Remark2],[Remark3]) " + "values (?,?,?,?,?" + ",?,?,?,?,?" + ",?,?,?,?,?" + ",?,?,?,?,?,?" + ")"; OleDbParameter[] b = new OleDbParameter[21]; b[0] = new OleDbParameter("0", snData.label); b[1] = new OleDbParameter("1", ""); b[2] = new OleDbParameter("2", ""); b[3] = new OleDbParameter("3", snData.customerData); b[4] = new OleDbParameter("4", snData.snDec); b[5] = new OleDbParameter("5", getSample(snData.sn)); b[6] = new OleDbParameter("6", getSample(snData.sn)); b[7] = new OleDbParameter("7", DateTime.Now.ToString()); b[8] = new OleDbParameter("8", getReportNo(snData.sn)); b[9] = new OleDbParameter("9", snData.FSN); b[10] = new OleDbParameter("10", snData.sn); b[11] = new OleDbParameter("11", 1); b[12] = new OleDbParameter("12", DateTime.Now); b[13] = new OleDbParameter("13", snData.MO); b[14] = new OleDbParameter("14", snData.PN); b[15] = new OleDbParameter("15", "S32P"); b[16] = new OleDbParameter("16", Environment.MachineName); b[17] = new OleDbParameter("17", "Operater"); b[18] = new OleDbParameter("18", "Remark1"); b[19] = new OleDbParameter("19", "Remark2"); b[20] = new OleDbParameter("20", "Remark3"); int insertCount = DbHelperOleDb.ExecuteSql(updateSql, DB_MesDataCenterConnectionString, b); if (insertCount == 1) { ret = true; } return(ret); }
public static SNData getITSN(string MO, string PN) { SNData ret = new SNData(); string stationID = "HT001"; string userID = "TestID"; string factoryID = "LXXT"; string profitCenter = "SEE-D"; string strFSN = ""; MESDataServices a = new MESDataServices(); string b = a.GetSFCNewFSN(MO, "", stationID, true, true, userID, factoryID, profitCenter, ref strFSN); string[] aret = strFSN.Split('#'); ret.FSN = strFSN; ret.label = aret[0]; ret.showDate = aret[1]; ret.sn = aret[2]; ret.customerData = aret[3]; ret.snDec = aret[4]; ret.MO = MO; ret.PN = PN; return(ret); }