LogicHandler.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace UAS_MesInterface
  8. {
  9. public class LogicHandler
  10. {
  11. public LogicHandler(string Environment)
  12. {
  13. dh = new DataHelper(Environment);
  14. }
  15. DataHelper dh;
  16. //用于拼接SQL
  17. StringBuilder sql = new StringBuilder();
  18. //用于存放批量执行的SQL
  19. List<string> sqls = new List<string>();
  20. /// <summary>
  21. /// 检测当前的岗位资源对应的工序
  22. /// </summary>
  23. /// <param name="iSnCode"></param>
  24. /// <param name="iMakeCode"></param>
  25. /// <param name="iSourceCode"></param>
  26. /// <param name="oErrMessage"></param>
  27. /// <returns></returns>
  28. public bool CheckRoutePassed(string iSnCode, string iSourceCode, out string oErrMessage)
  29. {
  30. oErrMessage = "";
  31. string[] param = new string[] { "", iSourceCode, iSnCode, "", "", "", oErrMessage };
  32. dh.CallProcedure("CS_CHECKSTEPSNANDMACODE", ref param);
  33. oErrMessage = param[6];
  34. if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
  35. return true;
  36. else
  37. return false;
  38. }
  39. /// <summary>
  40. /// 验证用户身份信息
  41. /// </summary>
  42. /// <param name="iUserCode"></param>
  43. /// <param name="oErrorMessage"></param>
  44. /// <returns></returns>
  45. public bool CheckUserLogin(string iUserCode, string iPassWord, out string oErrorMessage)
  46. {
  47. oErrorMessage = "";
  48. string SQL = "select em_code from employee where em_code=:UserName and em_password =:PassWord";
  49. DataTable dt;
  50. dt = (DataTable)dh.ExecuteSql(SQL, "select", iUserCode, iPassWord);
  51. if (dt.Rows.Count > 0)
  52. return true;
  53. else
  54. {
  55. oErrorMessage = "用户名或者密码不正确!";
  56. return false;
  57. }
  58. }
  59. /// <summary>
  60. /// 验证用户身份信息和岗位资源
  61. /// </summary>
  62. /// <param name="iUserCode"></param>
  63. /// <param name="iPassWord"></param>
  64. /// <param name="oErrorMessage"></param>
  65. /// <returns></returns>
  66. public bool CheckUserAndResourcePassed(string iUserCode, string iSourceCode, out string oErrorMessage)
  67. {
  68. oErrorMessage = "";
  69. string SQL = "select em_code,em_type,em_name from employee where em_code=:UserName ";
  70. DataTable dt;
  71. dt = (DataTable)dh.ExecuteSql(SQL, "select", iUserCode);
  72. if (dt.Rows.Count > 0)
  73. {
  74. string em_name = dt.Rows[0]["em_name"].ToString();
  75. string em_type = dt.Rows[0]["em_type"].ToString();
  76. if (iSourceCode == "")
  77. {
  78. oErrorMessage = "岗位资源不允许为空";
  79. return false;
  80. }
  81. if (em_type == "admin")
  82. {
  83. if (dh.CheckExist("Source", "sc_code='" + iSourceCode + "' and sc_statuscode='AUDITED'"))
  84. {
  85. return true;
  86. }
  87. else
  88. {
  89. oErrorMessage = "岗位资源编号错误或者未审核!";
  90. return false;
  91. }
  92. }
  93. else
  94. {
  95. dt = dh.getFieldsDatasByCondition("cs$empgroup left join cs$userresource on ur_groupcode=eg_groupcode left join source on ur_resourcecode=sc_code", new string[] { "ur_resourcecode" }, "eg_emcode = '" + iUserCode + "' and sc_statuscode='AUDITED'");
  96. //如果存在该编号
  97. if (dt.Rows.Count > 0)
  98. {
  99. //判断如果多个岗位资源存在,用户输入的只要在其中就行
  100. for (int i = 0; i < dt.Rows.Count; i++)
  101. {
  102. if (dt.Rows[i]["ur_resourcecode"].ToString() == iSourceCode)
  103. return true;
  104. }
  105. oErrorMessage = "用户不处于当前资源所属分组!";
  106. }
  107. else
  108. oErrorMessage = "岗位资源编号错误或者未审核!";
  109. }
  110. }
  111. else
  112. oErrorMessage = "用户不存在!";
  113. return false;
  114. }
  115. /// <summary>
  116. /// 分配Mac地址和BT地址
  117. /// </summary>
  118. /// <param name="iSnCode"></param>
  119. /// <param name="iMakeCode"></param>
  120. /// <param name="oMac"></param>
  121. /// <param name="oBT"></param>
  122. /// <param name="oCode1"></param>
  123. /// <param name="oCode2"></param>
  124. /// <param name="oCdoe3"></param>
  125. /// <param name="oErrorMessage"></param>
  126. /// <returns></returns>
  127. public bool GetAddressRangeByMO(string iSnCode, out string oMac, out string oBT, out string oCode1, out string oCode2, out string oCdoe3, out string oErrorMessage)
  128. {
  129. oMac = "";
  130. oBT = "";
  131. oCode1 = "";
  132. oCode2 = "";
  133. oCdoe3 = "";
  134. oErrorMessage = "";
  135. string omakeCode = "";
  136. GetRcardMOInfo(iSnCode,out omakeCode,out oErrorMessage);
  137. string[] param = new string[] { iSnCode, omakeCode, oMac, oBT, oCode1, oCode2, oCdoe3, oErrorMessage };
  138. dh.CallProcedure("CS_GETADDRESSBYMAKECODE", ref param);
  139. oMac = param[2];
  140. oBT = param[3];
  141. oCode1 = param[4];
  142. oCode2 = param[5];
  143. oCdoe3 = param[6];
  144. oErrorMessage = param[7];
  145. if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
  146. return true;
  147. else
  148. return false;
  149. }
  150. /// <summary>
  151. /// 输入的 SN 号查找在制品是否有 IMEI 信息存在,如果存在则将 IMEI 信息传出,如果没有则在该工单下未使用的 IMEI 中随机分配一组
  152. /// 如果iIMEI1、iNetCode不为空,则分别作为获取的附件加条件。
  153. /// </summary>
  154. /// <param name="iSN"></param>
  155. /// <param name="iMO"></param>
  156. /// <param name="iIMEI1"></param>
  157. /// <param name="iNetCode"></param>
  158. /// <param name="oIMEI1"></param>
  159. /// <param name="oIMEI2"></param>
  160. /// <param name="oIMEI3"></param>
  161. /// <param name="oMEID"></param>
  162. /// <param name="oNetCode"></param>
  163. /// <param name="oPSN"></param>
  164. /// <param name="oMac"></param>
  165. /// <param name="oBT"></param>
  166. /// <param name="oID1"></param>
  167. /// <param name="oID2"></param>
  168. /// <param name="oID3"></param>
  169. /// <param name="oErrorMessage"></param>
  170. /// <returns></returns>
  171. public bool GetMEIOrNetCodeRange(string iSnCode, string iIMEI1, string iNetCode, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oErrorMessage)
  172. {
  173. oIMEI1 = "";
  174. oIMEI2 = "";
  175. oIMEI3 = "";
  176. oMEID = "";
  177. oNetCode = "";
  178. oPSN = "";
  179. oID1 = "";
  180. oID2 = "";
  181. oID3 = "";
  182. oErrorMessage = "";
  183. string[] param = new string[] { iSnCode, "", iIMEI1, iNetCode, oIMEI1, oIMEI2, oIMEI3, oMEID, oNetCode, oPSN, oID1, oID2, oID3, oErrorMessage };
  184. dh.CallProcedure("CS_GETIMEIORNETCODERANGE", ref param);
  185. oIMEI1 = param[4];
  186. oIMEI2 = param[5];
  187. oIMEI3 = param[6];
  188. oMEID = param[7];
  189. oNetCode = param[8];
  190. oPSN = param[9];
  191. oID1 = param[10];
  192. oID2 = param[11];
  193. oID3 = param[12];
  194. oErrorMessage = param[13];
  195. if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
  196. return true;
  197. else
  198. return false;
  199. }
  200. /// <summary>
  201. /// 获取工单的最近一条执行记录
  202. /// </summary>
  203. /// <param name="iSnCode"></param>
  204. /// <param name="oMakeCode"></param>
  205. /// <param name="oErrorMessage"></param>
  206. /// <returns></returns>
  207. public bool GetRcardMOInfo(string iSnCode, out string oMakeCode, out string oErrorMessage)
  208. {
  209. //取MakeProcess表中的执行记录ID最大的一个工单的号码
  210. oMakeCode = "";
  211. oErrorMessage = "";
  212. string ms_id = dh.getFieldDataByCondition("MakeSerial", "max(ms_id) ms_id", "ms_sncode='" + iSnCode + "' or ms_firstsn in (select firstsn from makesnrelation where sn='" + iSnCode + "')").ToString();
  213. oMakeCode = dh.getFieldDataByCondition("MakeSerial", "ms_makecode", "ms_id='" + ms_id + "'").ToString();
  214. if (oMakeCode != "")
  215. return true;
  216. else
  217. {
  218. oErrorMessage = "序列号:" + iSnCode + " 未归属工单";
  219. return false;
  220. }
  221. }
  222. /// <summary>
  223. /// 获取序列号的所有串号信息
  224. /// </summary>
  225. /// <param name="iSnCode"></param>
  226. /// <param name="oIMEI1"></param>
  227. /// <param name="oIMEI2"></param>
  228. /// <param name="oIMEI3"></param>
  229. /// <param name="oMEID"></param>
  230. /// <param name="oNetCode"></param>
  231. /// <param name="oPSN"></param>
  232. /// <param name="oMac"></param>
  233. /// <param name="oBT"></param>
  234. /// <param name="oCode1"></param>
  235. /// <param name="oCode2"></param>
  236. /// <param name="oCode3"></param>
  237. /// <param name="oErrorMessage"></param>
  238. /// <returns></returns>
  239. public bool GetMobileAllInfo(string iSnCode, out string oMac, out string oBT, out string oCode1, out string oCode2, out string oCode3, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oErrorMessage)
  240. {
  241. oBT = "";
  242. oMEID = "";
  243. oMac = "";
  244. oPSN = "";
  245. oNetCode = "";
  246. oIMEI1 = "";
  247. oIMEI2 = "";
  248. oIMEI3 = "";
  249. oCode1 = "";
  250. oCode2 = "";
  251. oCode3 = "";
  252. oID1 = "";
  253. oID2 = "";
  254. oID3 = "";
  255. //通过序列号获取最近操作的工单号
  256. string ms_id = dh.getFieldDataByCondition("makeserial", "ms_id", "ms_sncode='" + iSnCode + "'").ToString();
  257. if (ms_id != "")
  258. {
  259. DataTable dt = dh.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 + "'");
  260. if (dt.Rows.Count > 0)
  261. {
  262. oMac = dt.Rows[0]["ms_mac"].ToString();
  263. oBT = dt.Rows[0]["ms_bt"].ToString();
  264. oPSN = dt.Rows[0]["ms_psn"].ToString();
  265. oNetCode = dt.Rows[0]["ms_netcode"].ToString();
  266. oMEID = dt.Rows[0]["ms_meid"].ToString();
  267. oIMEI1 = dt.Rows[0]["ms_imei1"].ToString();
  268. oIMEI2 = dt.Rows[0]["ms_imei2"].ToString();
  269. oIMEI3 = dt.Rows[0]["ms_imei3"].ToString();
  270. oCode1 = dt.Rows[0]["ms_othcode1"].ToString();
  271. oCode2 = dt.Rows[0]["ms_othcode2"].ToString();
  272. oCode3 = dt.Rows[0]["ms_othcode3"].ToString();
  273. oID1 = dt.Rows[0]["ms_othid3"].ToString();
  274. oID2 = dt.Rows[0]["ms_othid3"].ToString();
  275. oID3 = dt.Rows[0]["ms_othid3"].ToString();
  276. oErrorMessage = "";
  277. return true;
  278. }
  279. else
  280. {
  281. oErrorMessage = "序列号" + iSnCode + "不存在";
  282. return false;
  283. }
  284. }
  285. else
  286. {
  287. oErrorMessage = "序列号" + iSnCode + "不存在";
  288. return false;
  289. }
  290. }
  291. /// <summary>
  292. /// 记录操作日志
  293. /// </summary>
  294. /// <param name="iSnCode"></param>
  295. /// <param name="iMakeCode"></param>
  296. /// <param name="iMPKind"></param>
  297. /// <param name="result"></param>
  298. /// <param name="iUserCode"></param>
  299. private void InsertMakeProcess(string iSnCode, string iMakeCode, string iSourceCode, string iMPKind, string result, string iUserCode)
  300. {
  301. string CurrentStep = "";
  302. string LineCode = "";
  303. string CurrentStepName = "";
  304. GetStepCodeAndNameAndLineBySource(iSourceCode, ref CurrentStep, ref CurrentStepName, ref LineCode);
  305. sql.Clear();
  306. sql.Append("insert into MakeProcess(mp_id,mp_makecode,mp_maid, mp_mscode,mp_sncode,mp_stepcode,mp_stepname,");
  307. sql.Append("mp_craftcode,mp_craftname,mp_kind,mp_result,mp_indate,mp_inman,mp_wccode,mp_linecode,mp_sourcecode,mp_snstatus,mp_sncheckno,mp_snoutboxcode)");
  308. sql.Append("select MakeProcess_seq.nextval, ma_code,ma_id,ms_code,ms_sncode,'" + CurrentStep + "','" + CurrentStepName + "',");
  309. sql.Append("ma_craftcode,ma_craftname,'" + iMPKind + "','" + result + "',sysdate,'" + iUserCode + "',ma_wccode,'" + LineCode + "','" + iSourceCode + "',");
  310. sql.Append("ms_status,ms_checkno,ms_outboxcode from make left join makeserial on ms_makecode=ma_code left join step on st_code=ms_stepcode ");
  311. sql.Append("where ms_sncode='" + iSnCode + "' and ma_code='" + iMakeCode + "' and st_code='" + CurrentStep + "'");
  312. dh.ExecuteSql(sql.ToString(), "insert");
  313. }
  314. /// <summary>
  315. /// 保存Mac地址和BT地址
  316. /// </summary>
  317. /// <param name="iSN"></param>
  318. /// <param name="iMac"></param>
  319. /// <param name="iBT"></param>
  320. /// <param name="iCode1"></param>
  321. /// <param name="iCode2"></param>
  322. /// <param name="iCode3"></param>
  323. /// <param name="oErrorMessage"></param>
  324. /// <returns></returns>
  325. public bool SetAddressInfo(string iSN, string iMac, string iBT, string iCode1, string iCode2, string iCode3, out string oErrorMessage)
  326. {
  327. oErrorMessage = "";
  328. string[] param = new string[] { iSN, iMac, iBT, iCode1, iCode2, iCode3, oErrorMessage };
  329. dh.CallProcedure("CS_SETADDRESSINFO", ref param);
  330. oErrorMessage = param[6];
  331. if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
  332. return true;
  333. else
  334. return false;
  335. }
  336. private bool SetStepFinish(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, string iErrCode, out string oErrorMessage)
  337. {
  338. oErrorMessage = "";
  339. string StepCode = dh.getFieldDataByCondition("Makeserial", "ms_stepcode", "ms_sncode='" + iSN + "'").ToString();
  340. string CurrentStep = GetStepCodeBySource(iSourceCode);
  341. switch (iResult)
  342. {
  343. case "OK":
  344. break;
  345. case "NG":
  346. if (iErrCode == "")
  347. {
  348. oErrorMessage = "测试结果为NG时必须传递不良代码";
  349. return false;
  350. }
  351. else
  352. {
  353. string[] BadCode = iErrCode.Split(',');
  354. sql.Clear();
  355. sql.Append("insert into makebad(mb_id,mb_makecode,mb_mscode,mb_sncode,mb_inman,mb_indate,mb_stepcode");
  356. sql.Append(",mb_sourcecode,mb_badcode,mb_badtable,mb_soncode,mb_status) select makebad_seq.nextval");
  357. sql.Append(",ma_code,ms_code,ms_sncode,'" + iUserCode + "',sysdate,'" + StepCode + "',ms_sourcecode,:bc_code,'',");
  358. sql.Append("sp_soncode,'0' from make left join makeSerial on ms_makecode=ma_code left join stepProduct on ");
  359. sql.Append("sp_mothercode=ma_prodcode and sp_stepcode=ms_nextstepcode where ms_sncode='" + iSN + "'");
  360. dh.BatchInsert(sql.ToString(), new string[] { "bc_code" }, BadCode);
  361. //将不良的序列号的状态码设为3
  362. dh.ExecuteSql("update makeserial set ms_status='3' where ms_sncode=:sncode", "update", iSN);
  363. }
  364. break;
  365. default:
  366. oErrorMessage = "测试结果必须为NG或者OK";
  367. return false;
  368. }
  369. if (StepCode == CurrentStep)
  370. {
  371. InsertMakeProcess(iSN, iMakeCode, iSourceCode, iMPKind, iResult, iUserCode);
  372. return true;
  373. }
  374. else
  375. {
  376. return CS_SetFinish(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrorMessage);
  377. }
  378. }
  379. /// <summary>
  380. /// 设置测试结果
  381. /// </summary>
  382. /// <param name="iMakeCode"></param>
  383. /// <param name="iSourceCode"></param>
  384. /// <param name="iSN"></param>
  385. /// <param name="iMPKind"></param>
  386. /// <param name="iResult"></param>
  387. /// <param name="iUserCode"></param>
  388. /// <param name="oErrorMessage"></param>
  389. /// <returns></returns>
  390. public bool SetMobileData(string iSN, string iSourceCode, string iMPKind, string iResult, string iErrCode, out string oErrorMessage)
  391. {
  392. string omakecode = "";
  393. GetRcardMOInfo(iSN,out omakecode,out oErrorMessage);
  394. return SetStepFinish(omakecode, iSourceCode, iSN, iMPKind, iResult, "", iErrCode, out oErrorMessage);
  395. }
  396. private bool CS_SetFinish(string iMakeCode, string iSourceCode, string iSN, string iUserCode, string iResult, out string oErrorMessage)
  397. {
  398. oErrorMessage = "";
  399. string[] param = new string[] { iMakeCode, iSourceCode, iSN, iUserCode, iResult, oErrorMessage };
  400. dh.CallProcedure("CS_SETSTEPRESULT", ref param);
  401. oErrorMessage = param[5];
  402. if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
  403. return true;
  404. else
  405. return false;
  406. }
  407. /// <summary>
  408. /// 方法说明:测试详细信息录入系统,针对一个SN多个测试项目结果可循环调用
  409. /// </summary>
  410. /// <param name="iSnCode">序列号</param>
  411. /// <param name="iClass"></param>
  412. /// <param name="iSubClass1"></param>
  413. /// <param name="iSubClass2"></param>
  414. /// <param name="iSubClass3"></param>
  415. /// <param name="iMaxValue"></param>
  416. /// <param name="iMinValue"></param>
  417. /// <param name="iActualValue"></param>
  418. /// <param name="iValue1"></param>
  419. /// <param name="iValue2"></param>
  420. /// <param name="iValue3"></param>
  421. /// <param name="iTestResult"></param>
  422. /// <param name="oErrMessage"></param>
  423. /// <returns></returns>
  424. public bool SetTestDetail(string iSnCode, string iMakeCode, string iClass, string iSubClass1, string iSubClass2, string iSubClass3, string iMaxValue, string iMinValue, string iActualValue, string iValue1, string iValue2, string iValue3, string iTestResult, string iSourceCode, out string oErrMessage)
  425. {
  426. oErrMessage = "";
  427. sql.Clear();
  428. sql.Append("Insert into STEPTESTDETAIL (STD_ID,STD_SN,STD_MAKECODE,STD_CLASS,STD_SUBCLASS1,STD_SUBCLASS2,");
  429. sql.Append("STD_SUBCLASS3,STD_MAXVALUE,STD_MINVALUE,STD_ACTUALVALUE,STD_VALUE1,STD_VALUE2,STD_VALUE3,STD_TESTRESULT,");
  430. sql.Append("STD_DATE,STD_RESCODE) values (STEPTESTDETAIL_SEQ.nextval,:std_sn,:std_makecode,");
  431. sql.Append(":std_class,:std_subclass1,:std_subclass2,:std_subclass3,:std_maxvalue,:std_minvalue,:std_actualvalue,:std_value1,");
  432. sql.Append(":std_value2,:std_value3,:std_testresult,sysdate,:std_record)");
  433. dh.ExecuteSql(sql.ToString(), "select", iSnCode, iMakeCode, iClass, iSubClass1, iSubClass2, iSubClass3, iMaxValue, iMinValue, iActualValue, iValue1, iValue2, iValue3, iTestResult, iSourceCode);
  434. return true;
  435. }
  436. /// <summary>
  437. /// 作业调用该方法将确认接收SN对应的IMEI及附属信息。
  438. /// </summary>
  439. /// <param name="iSN"></param>
  440. /// <param name="iMO"></param>
  441. /// <param name="iIMEI1"></param>
  442. /// <param name="iIMEI2"></param>
  443. /// <param name="iIMEI3"></param>
  444. /// <param name="iMEID"></param>
  445. /// <param name="iNetCode"></param>
  446. /// <param name="iPSN"></param>
  447. /// <param name="iID1"></param>
  448. /// <param name="iBT"></param>
  449. /// <param name="iID1"></param>
  450. /// <param name="iID2"></param>
  451. /// <param name="iID3"></param>
  452. /// <param name="oErrorMessage"></param>
  453. /// <returns></returns>
  454. public bool SetIMEIInfo(string iSnCode, string iIMEI1, out string oErrMessage)
  455. {
  456. oErrMessage = "";
  457. string[] param = new string[] { iSnCode, iIMEI1, "", "", "", "", "", "", "", "", oErrMessage };
  458. dh.CallProcedure("CS_SETIMEIINFO", ref param);
  459. oErrMessage = param[10];
  460. if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
  461. return true;
  462. else
  463. return false;
  464. }
  465. /// <summary>
  466. /// 获取执行步骤代码,名称和线别
  467. /// </summary>
  468. /// <param name="Source"></param>
  469. /// <param name="StepCode"></param>
  470. /// <param name="StepName"></param>
  471. /// <param name="LineCode"></param>
  472. private void GetStepCodeAndNameAndLineBySource(string Source, ref string StepCode, ref string StepName, ref string LineCode)
  473. {
  474. DataTable dt = dh.getFieldsDataByCondition("source", new string[] { "sc_stepcode", "sc_stepname", "sc_linecode" }, "sc_code='" + Source + "'");
  475. if (dt.Rows.Count > 0)
  476. {
  477. StepCode = dt.Rows[0]["sc_stepcode"].ToString();
  478. StepName = dt.Rows[0]["sc_stepname"].ToString();
  479. LineCode = dt.Rows[0]["sc_linecode"].ToString();
  480. }
  481. }
  482. /// <summary>
  483. /// 获取步骤代码和名称
  484. /// </summary>
  485. /// <param name="Source"></param>
  486. /// <param name="StepCode"></param>
  487. /// <param name="StepName"></param>
  488. private void GetStepCodeAndNameBySource(string Source, ref string StepCode, ref string StepName)
  489. {
  490. DataTable dt = dh.getFieldsDataByCondition("source", new string[] { "sc_stepcode", "sc_stepname", "sc_linecode" }, "sc_code='" + Source + "'");
  491. if (dt.Rows.Count > 0)
  492. {
  493. StepCode = dt.Rows[0]["sc_stepcode"].ToString();
  494. StepName = dt.Rows[0]["sc_stepname"].ToString();
  495. }
  496. }
  497. /// <summary>
  498. /// 获取步骤代码
  499. /// </summary>
  500. /// <param name="Source"></param>
  501. /// <returns></returns>
  502. private string GetStepCodeBySource(string Source)
  503. {
  504. return dh.getFieldDataByCondition("source", "sc_stepcode", "sc_code='" + Source + "'").ToString();
  505. }
  506. }
  507. }