using System.Collections.Generic; using System.Text; namespace UAS_AutoPass.ToolClass { class LogicHandler { public LogicHandler() { } static DataHelper dh = new DataHelper(); //用于拼接SQL static StringBuilder sql = new StringBuilder(); //用于存放批量执行的SQL static List sqls = new List(); public static bool CheckStepSNAndMacode(string iMakeCode, string iSourceCode, string iSN, string iUserCode, out string oMakeCode, out string oMsID, out string oErrorMessage) { oErrorMessage = ""; oMakeCode = ""; oMsID = ""; string[] param = new string[] { iMakeCode, iSourceCode, iSN, iUserCode, oMakeCode, oMsID, oErrorMessage }; dh.CallProcedure("CS_CHECKSTEPSNANDMACODE", ref param); oMakeCode = param[4]; oMsID = param[5]; oErrorMessage = param[6]; if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null") return true; else return false; } public static void AutoPassLog(string iSN,string iSource,string iMakeCode,string iDate,string iStepCode,string iLineCode,string iFileName,string iIFNG) { sql.Clear(); sql.Append("insert into AUTOSCANLOG(as_id,as_indate,as_testdate,as_sourcecode,as_stepcode,"); sql.Append("as_linecode,as_makecode,as_sncode,as_filename,as_ifng)values(AUTOSCANLOG_seq.nextval,"); sql.Append("sysdate,to_date('"+ iDate + "','yyyy-mm-dd,hh24:mi:ss'),'" + iSource+"','"+iStepCode+"','"+iLineCode+"','"+iMakeCode+"',"); sql.Append("'"+iSN+"','"+ iFileName + "','"+ iIFNG + "')"); dh.ExecuteSql(sql.ToString(), "select"); } public static bool SetStepResult(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, out string oErrorMessage) { return CS_SetResult(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrorMessage); } public static bool CS_SetResult(string iMakeCode, string iSourceCode, string iSN, string iUserCode, string iResult, out string oErrorMessage) { oErrorMessage = ""; string[] param = new string[] { iMakeCode, iSourceCode, iSN, iUserCode, iResult, oErrorMessage }; dh.CallProcedure("CS_SETSTEPRESULT", ref param); oErrorMessage = param[5]; if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null") return true; else return false; } } }