Make_SMTStencil.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using UAS_MES_NEW;
  10. using UAS_MES_NEW.DataOperate;
  11. using UAS_MES_NEW.Entity;
  12. using UAS_MES_NEW.PublicMethod;
  13. namespace UAS_MES_NEW.Make
  14. {
  15. public partial class Make_SMTStencil : Form
  16. {
  17. DataTable Dbfind;
  18. bool ifUsed = false;
  19. AutoSizeFormClass asc = new AutoSizeFormClass();
  20. DataHelper dh = SystemInf.dh;
  21. StringBuilder sql = new StringBuilder();
  22. public Make_SMTStencil()
  23. {
  24. InitializeComponent();
  25. SU_DEVCODE.Enabled = false;
  26. st_combinenumber.Enabled = false;
  27. SU_DEVCODE1.Enabled = false;
  28. st_table.Enabled = false;
  29. su_singlepringqty1.Enabled = false;
  30. Receive.Enabled = false;
  31. Return.Enabled = false;
  32. SU_DEVCODE.Enabled = false;
  33. SU_DEVCODE1.Enabled = false;
  34. ST_ENSIONA.Enabled = false;
  35. ST_ENSIONB.Enabled = false;
  36. ST_ENSIONC.Enabled = false;
  37. ST_ENSIOND.Enabled = false;
  38. ST_ENSIONE.Enabled = false;
  39. Scrap.Enabled = false;
  40. }
  41. private void Make_SMTStencil_Load(object sender, EventArgs e)
  42. {
  43. asc.controllInitializeSize(this);
  44. li_code.Text = User.UserLineCode;
  45. //工单号放大镜配置
  46. ma_code.TableName = "make left join product on ma_prodcode=pr_code";
  47. ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,pr_detail # 产品名称,ma_softversion # 软件版本,ma_salecode # 销售单号,pr_sendchecktype # 产品送检方式";
  48. ma_code.FormName = Name;
  49. ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_qty", "pr_detail", "ma_softversion", "ma_salecode", "nvl(pr_sendchecktype,'LineCode')pr_sendchecktype" };
  50. ma_code.DbChange += Ma_code_DbChange;
  51. li_code.TableName = "Line";
  52. li_code.SelectField = "li_code # 线别编号,li_name # 线别名称";
  53. li_code.Condition = "li_wccode='SMT'";
  54. li_code.FormName = Name;
  55. li_code.SetValueField = new string[] { "li_code", "li_name" };
  56. li_code.DbChange += Li_code_DbChange;
  57. ma_code.Controls["TextBox"].Focus();
  58. }
  59. private void Li_code_DbChange(object sender, EventArgs e)
  60. {
  61. Dbfind = li_code.ReturnData;
  62. BaseUtil.SetFormValue(this.Controls, Dbfind);
  63. }
  64. private void Ma_code_DbChange(object sender, EventArgs e)
  65. {
  66. Dbfind = ma_code.ReturnData;
  67. BaseUtil.SetFormValue(this.Controls, Dbfind);
  68. Confirm.PerformClick();
  69. }
  70. private void Make_SMTStencil_SizeChanged(object sender, EventArgs e)
  71. {
  72. asc.controlAutoSize(this);
  73. }
  74. private void LoadGridData()
  75. {
  76. sql.Clear();
  77. sql.Append("select St_PCBCODE,su_stcode,su_table,su_status,su_linecode,su_usemacode,su_singlepringqty,su_stverison ");
  78. sql.Append("from StencilUse left join stencil on st_code=su_stcode where su_usemacode='" + ma_code.Text + "' and su_status='在线'");
  79. DataTable dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
  80. BaseUtil.FillDgvWithDataTable(ToolsBom, dt);
  81. }
  82. private void Confirm_Click(object sender, EventArgs e)
  83. {
  84. LoadGridData();
  85. }
  86. private void Receive_Click(object sender, EventArgs e)
  87. {
  88. if (ma_code.Text == "")
  89. {
  90. MessageBox.Show("工单号不能为空");
  91. }
  92. DataTable dt;
  93. int WaringCount = int.Parse(dh.GetConfig("WaringCount", "Stencil").ToString());
  94. dt = (DataTable)dh.ExecuteSql("select ST_USESTATUS,st_version,nvl(st_maxusecount,0)st_maxusecount,nvl(st_usecount,0)st_usecount from Stencil where st_code='" + SU_DEVCODE.Text + "' and st_statuscode='AUDITED'", "select");
  95. string status = "";
  96. string version = "";
  97. int st_maxusecount = 0;
  98. int st_usecount = 0;
  99. if (dt.Rows.Count > 0)
  100. {
  101. status = dt.Rows[0]["ST_USESTATUS"].ToString();
  102. version = dt.Rows[0]["st_version"].ToString();
  103. st_maxusecount = int.Parse(dt.Rows[0]["st_maxusecount"].ToString());
  104. st_usecount = int.Parse(dt.Rows[0]["st_usecount"].ToString());
  105. if (status == "在线" || status == "报废"/* || status == "在仓"*/)
  106. {
  107. MessageBox.Show("当前钢网" + SU_DEVCODE.Text + "处于" + status + "状态,无法领用");
  108. return;
  109. }
  110. }
  111. else
  112. {
  113. MessageBox.Show("钢网编号" + SU_DEVCODE.Text + "不存在或者未审核");
  114. return;
  115. }
  116. //使用次数预警
  117. if (st_maxusecount - st_usecount < WaringCount)
  118. {
  119. string close = MessageBox.Show(this.ParentForm, "钢网已使用" + st_usecount + ",距离使用上限还有" + (st_maxusecount - st_usecount) + "次", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
  120. if (close != "Yes")
  121. {
  122. return;
  123. }
  124. }
  125. //限制钢网使用的产品
  126. String pr_spec = dh.getFieldDataByCondition("product", "pr_spec", "pr_code = '" + ma_prodcode.Text + "'").ToString();
  127. String st_vendcode = dh.getFieldDataByCondition("STENCIL", "nvl(st_vendcode,'aabbcc')", "st_code = '" + SU_DEVCODE.Text + "'").ToString();
  128. //if (!pr_spec.Contains(st_vendcode))
  129. //{
  130. // MessageBox.Show("钢网编号" + SU_DEVCODE.Text + "不能在产品" + ma_prodcode.Text + "中使用");
  131. // return;
  132. //}
  133. dt = (DataTable)dh.ExecuteSql("select 1 from STENILCANUSEPRO where sp_stcode='" + SU_DEVCODE.Text + "' and sp_prodcode='" + ma_prodcode.Text + "'", "select");
  134. if (dt.Rows.Count == 0)
  135. {
  136. MessageBox.Show("钢网编号" + SU_DEVCODE.Text + "不能在产品" + ma_prodcode.Text + "中使用");
  137. return;
  138. }
  139. //一条线只能在线一个钢网
  140. dt = (DataTable)dh.ExecuteSql("select su_stcode from stenciluse where su_linecode='" + li_code.Text + "' and su_status='在线'", "select");
  141. if (dt.Rows.Count > 0)
  142. {
  143. MessageBox.Show("线别" + li_code.Text + "已有领用的钢网" + dt.Rows[0]["su_stcode"].ToString() + ",请先退回");
  144. return;
  145. }
  146. else
  147. {
  148. dt = (DataTable)dh.ExecuteSql("select em_name from employee where em_code='" + em_code.Text + "'", "select");
  149. if (dt.Rows.Count > 0)
  150. {
  151. if (int.Parse(su_singlepringqty1.Text) > 0)
  152. {
  153. if (ST_ENSIONA.Text != "" && ST_ENSIONB.Text != "" && ST_ENSIONC.Text != "" && ST_ENSIOND.Text != "" && ST_ENSIONE.Text != "")
  154. {
  155. string em_name = dt.Rows[0]["em_name"].ToString();
  156. sql.Clear();
  157. sql.Append("insert into StencilUse(su_id,SU_USEPRODCODE,SU_CLEANNUMS,su_stid,su_linecode,su_stcode,su_usedate,su_useman,SU_USEMANCODE,SU_TABLE,su_usemacode,su_singlepringqty,su_stverison,SU_STATUS)");
  158. sql.Append("select StencilUse_seq.nextval,'" + ma_prodcode.Text + "',ST_CLEANNUMS,st_id,'" + li_code.Text + "','" + SU_DEVCODE.Text + "',sysdate,'" + em_name + "','" + em_code.Text + "','" + st_table.Text + "','" + ma_code.Text + "'");
  159. sql.Append(",'" + su_singlepringqty1.Text + "',st_version,'在线' from ");
  160. sql.Append("Stencil where st_code='" + SU_DEVCODE.Text + "'");
  161. dh.ExecuteSql(sql.ToString(), "insert");
  162. dt = (DataTable)dh.ExecuteSql("select ST_USESTATUS,St_USECOUNT from Stencil where st_code='" + SU_DEVCODE.Text + "' and st_statuscode='AUDITED'", "select");
  163. string St_USECOUNT = dt.Rows[0]["St_USECOUNT"].ToString();
  164. dt = (DataTable)dh.ExecuteSql("select em_name from employee where em_code='" + em_code.Text + "'", "select");
  165. if (dt.Rows.Count > 0)
  166. {
  167. sql.Clear();
  168. sql.Append("update StencilUse set SU_ENSIONA='" + ST_ENSIONA.Text + "',SU_ENSIONB='" + ST_ENSIONB.Text + "',SU_ENSIONC='" + ST_ENSIONC.Text + "',SU_ENSIOND='" + ST_ENSIOND.Text + "',SU_ENSIONE='" + ST_ENSIONE.Text + "' ");
  169. sql.Append("where su_id=(select max(su_id) from stenciluse where su_stcode='" + SU_DEVCODE.Text + "' and su_status='在线')");
  170. dh.ExecuteSql(sql.ToString(), "update");
  171. }
  172. dh.ExecuteSql("update Stencil set ST_USESTATUS='在线' where st_code='" + SU_DEVCODE.Text + "'", "update");
  173. MessageBox.Show("领用成功");
  174. st_table.SelectedItem = null;
  175. SU_DEVCODE.Text = "";
  176. em_code.Text = "";
  177. Receive.Enabled = false;
  178. LoadGridData();
  179. }
  180. else
  181. {
  182. MessageBox.Show("请维护完成的测试参数");
  183. }
  184. }
  185. else
  186. {
  187. MessageBox.Show("单片印刷次数必须大于0");
  188. }
  189. }
  190. else
  191. {
  192. MessageBox.Show("人员编号" + em_code.Text + "不存在");
  193. }
  194. }
  195. }
  196. private void Return_Click(object sender, EventArgs e)
  197. {
  198. if (SU_RETURNIFCLEAN.Checked)
  199. {
  200. DataTable dt = (DataTable)dh.ExecuteSql("select ST_USESTATUS,St_USECOUNT from Stencil where st_code='" + SU_DEVCODE1.Text + "' and st_statuscode='AUDITED'", "select");
  201. if (dt.Rows.Count > 0)
  202. {
  203. string status = dt.Rows[0]["ST_USESTATUS"].ToString();
  204. if (status == "在仓" || status == "在仓")
  205. {
  206. MessageBox.Show("当前钢网" + SU_DEVCODE.Text + "未在线,无需归还");
  207. return;
  208. }
  209. if (status == "报废")
  210. {
  211. MessageBox.Show("当前钢网" + SU_DEVCODE.Text + "处于" + status + "状态,无法退回");
  212. return;
  213. }
  214. }
  215. else
  216. {
  217. MessageBox.Show("钢网编号" + SU_DEVCODE1.Text + "不存在或者未审核");
  218. }
  219. string St_USECOUNT = dt.Rows[0]["St_USECOUNT"].ToString();
  220. dt = (DataTable)dh.ExecuteSql("select em_name from employee where em_code='" + em_code1.Text + "'", "select");
  221. if (dt.Rows.Count > 0)
  222. {
  223. if (int.Parse(st_combinenumber.Text) >= 0)
  224. {
  225. sql.Clear();
  226. sql.Append("update StencilUse set su_cleannums=nvl(su_cleannums,0)+1, SU_BACKDATE=sysdate,su_returnman='" + dt.Rows[0]["em_name"].ToString() + "',su_returnmancode='" + em_code1.Text + "',");
  227. sql.Append("SU_THISUSETIMES='" + (st_combinenumber.Text == "" ? "0" : st_combinenumber.Text) + "',SU_STATUS='在仓',su_usecount=" + (St_USECOUNT == "" ? "0" : St_USECOUNT) + "+" + st_combinenumber.Text);
  228. sql.Append(",SU_RETURNIFCLEAN='" + (SU_RETURNIFCLEAN.Checked ? "-1" : "0") + "' where su_id=(select max(su_id) from stenciluse where su_stcode='" + SU_DEVCODE1.Text + "' and su_status='在线')");
  229. dh.ExecuteSql(sql.ToString(), "update");
  230. sql.Clear();
  231. sql.Append("update Stencil set st_cleannums=nvl(st_cleannums,0)+1,ST_USESTATUS='在仓',st_usecount=nvl(st_usecount,0)+" + (st_combinenumber.Text == "" ? "0" : st_combinenumber.Text) + " where st_code='" + SU_DEVCODE1.Text + "'");
  232. dh.ExecuteSql(sql.ToString(), "update");
  233. MessageBox.Show("钢网" + SU_DEVCODE1.Text + "退回成功!");
  234. SU_DEVCODE1.Text = "";
  235. st_combinenumber.Text = "";
  236. em_code1.Text = "";
  237. SU_RETURNIFCLEAN.Checked = false;
  238. Return.Enabled = false;
  239. Confirm.PerformClick();
  240. }
  241. else
  242. {
  243. MessageBox.Show("加工小板数必须大于等于0");
  244. }
  245. }
  246. else
  247. {
  248. MessageBox.Show("人员编号" + em_code1.Text + "不存在");
  249. }
  250. }
  251. else
  252. {
  253. MessageBox.Show("请确认是否清洗钢网");
  254. }
  255. }
  256. private void Radio_CheckedChanged(object sender, EventArgs e)
  257. {
  258. switch ((sender as Control).Name)
  259. {
  260. case "RadioReceive":
  261. if ((sender as RadioButton).Checked)
  262. {
  263. SU_DEVCODE.Enabled = true;
  264. Receive.Enabled = true;
  265. st_table.Enabled = true;
  266. su_singlepringqty1.Enabled = true;
  267. Receive.Enabled = true;
  268. st_combinenumber.Enabled = false;
  269. SU_DEVCODE1.Enabled = false;
  270. Return.Enabled = false;
  271. ST_ENSIONA.Enabled = true;
  272. ST_ENSIONB.Enabled = true;
  273. ST_ENSIONC.Enabled = true;
  274. ST_ENSIOND.Enabled = true;
  275. ST_ENSIONE.Enabled = true;
  276. Return.Enabled = false;
  277. Scrap.Enabled = false;
  278. }
  279. break;
  280. case "RadioReturn":
  281. if ((sender as RadioButton).Checked)
  282. {
  283. SU_DEVCODE1.Enabled = true;
  284. st_combinenumber.Enabled = true;
  285. Return.Enabled = true;
  286. SU_DEVCODE.Enabled = false;
  287. st_table.Enabled = false;
  288. su_singlepringqty1.Enabled = false;
  289. Receive.Enabled = false;
  290. ST_ENSIONA.Enabled = false;
  291. ST_ENSIONB.Enabled = false;
  292. ST_ENSIONC.Enabled = false;
  293. ST_ENSIOND.Enabled = false;
  294. ST_ENSIONE.Enabled = false;
  295. SU_DEVCODE.Enabled = false;
  296. Receive.Enabled = false;
  297. Receive.Enabled = false;
  298. }
  299. break;
  300. default:
  301. break;
  302. }
  303. }
  304. private void SU_DEVCODE_KeyDown(object sender, KeyEventArgs e)
  305. {
  306. if (e.KeyCode == Keys.Enter)
  307. {
  308. SU_DEVCODE.Text = SU_DEVCODE.Text.Replace(" ", "");
  309. DataTable dt = (DataTable)dh.ExecuteSql("select st_usestatus,st_table from stencil where st_code='" + SU_DEVCODE.Text + "' and st_statuscode='AUDITED'", "select");
  310. if (dt.Rows.Count == 0)
  311. {
  312. MessageBox.Show("钢网编号" + SU_DEVCODE.Text + "不存在或者未审核");
  313. }
  314. if (dt.Rows.Count > 0)
  315. {
  316. for (int i = 0; i < st_table.Items.Count; i++)
  317. {
  318. if (st_table.Items[i].ToString() == dt.Rows[0]["st_table"].ToString())
  319. {
  320. st_table.SelectedItem = st_table.Items[i];
  321. }
  322. }
  323. Receive.Enabled = true;
  324. if (dt.Rows[0]["st_usestatus"].ToString() == "报废")
  325. {
  326. MessageBox.Show("钢网编号" + SU_DEVCODE.Text + "已报废");
  327. }
  328. }
  329. }
  330. }
  331. private void SU_DEVCODE1_KeyDown(object sender, KeyEventArgs e)
  332. {
  333. if (e.KeyCode == Keys.Enter)
  334. {
  335. SU_DEVCODE1.Text = SU_DEVCODE1.Text.Replace(" ", "");
  336. DataTable dt = (DataTable)dh.ExecuteSql("select case when nvl(ST_COMBINENUMBER,1)=0 then 1 else nvl(ST_COMBINENUMBER,1) end from STENCIL where st_code='" + SU_DEVCODE1.Text + "' and st_statuscode='AUDITED'", "select");
  337. if (dt.Rows.Count > 0)
  338. {
  339. try
  340. {
  341. st_combinenumber.Text = (Math.Ceiling(decimal.Parse(ma_qty.Text) / decimal.Parse(dt.Rows[0][0].ToString()))).ToString();
  342. }
  343. catch (Exception)
  344. {
  345. }
  346. }
  347. else
  348. {
  349. MessageBox.Show("钢网编号" + SU_DEVCODE1.Text + "不存在或者未审核");
  350. }
  351. dt = (DataTable)dh.ExecuteSql("select nvl(st_usecount,0)st_usecount,case when nvl(ST_COMBINENUMBER,1)=0 then 1 else nvl(ST_COMBINENUMBER,1) end from STENCIL where st_code='" + SU_DEVCODE1.Text + "' and st_statuscode='AUDITED'", "select");
  352. if (dt.Rows.Count == 0)
  353. {
  354. MessageBox.Show("钢网编号" + SU_DEVCODE1.Text + "不存在或者未审核");
  355. }
  356. else
  357. {
  358. st_usecount.Text = dt.Rows[0]["st_usecount"].ToString();
  359. if (int.Parse(st_usecount.Text) > 0)
  360. {
  361. ifUsed = true;
  362. }
  363. else
  364. {
  365. ifUsed = false;
  366. }
  367. }
  368. }
  369. }
  370. //默认范围39-55,如不在范围内则可以报废
  371. private void ST_ENSION_TextChanged(object sender, EventArgs e)
  372. {
  373. double Range = 0;
  374. List<string> Num = new List<string>();
  375. Num.Add(ST_ENSIONA.Text);
  376. Num.Add(ST_ENSIONB.Text);
  377. Num.Add(ST_ENSIONC.Text);
  378. Num.Add(ST_ENSIOND.Text);
  379. Num.Add(ST_ENSIONE.Text);
  380. int CheckCount = 0;
  381. int FillCount = 0;
  382. foreach (string item in Num)
  383. {
  384. if (item != "")
  385. {
  386. FillCount = FillCount + 1;
  387. if (double.TryParse(item, out Range))
  388. {
  389. //如果使用过张力范围39-55,使用过30-55
  390. if (ifUsed)
  391. {
  392. if (Range > 30 && Range <= 55)
  393. {
  394. CheckCount = CheckCount + 1;
  395. }
  396. }
  397. else
  398. {
  399. if (Range > 30 && Range <= 55)
  400. {
  401. CheckCount = CheckCount + 1;
  402. }
  403. }
  404. }
  405. }
  406. }
  407. if (FillCount == 5)
  408. {
  409. if (CheckCount == 5)
  410. {
  411. Return.Enabled = true;
  412. Scrap.Enabled = false;
  413. }
  414. else
  415. {
  416. Return.Enabled = false;
  417. Scrap.Enabled = true;
  418. }
  419. }
  420. }
  421. Make_StencilScrapReason form;
  422. private void Scrap_Click(object sender, EventArgs e)
  423. {
  424. DataTable dt = (DataTable)dh.ExecuteSql("select st_usestatus,st_status from stencil where st_code='" + SU_DEVCODE1.Text + "' and st_statuscode='AUDITED'", "select");
  425. if (dt.Rows.Count > 0)
  426. {
  427. if (dt.Rows[0]["st_usestatus"].ToString() == "报废")
  428. {
  429. MessageBox.Show("钢网" + SU_DEVCODE1.Text + "已处于报废状态");
  430. return;
  431. }
  432. if (dt.Rows[0]["st_usestatus"].ToString() != "在仓")
  433. {
  434. MessageBox.Show("报废钢网必须" + SU_DEVCODE1.Text + "处于在仓状态");
  435. return;
  436. }
  437. string closetab_confirm = MessageBox.Show(this.ParentForm, "报废后不可撤销,是否确认报废", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
  438. if (closetab_confirm != "Yes")
  439. {
  440. return;
  441. }
  442. form = new Make_StencilScrapReason();
  443. BaseUtil.SetFormCenter(form);
  444. form.Controls["ConfirmScrap"].Click += Make_SMTStencil_Click;
  445. form.ShowDialog();
  446. }
  447. else
  448. {
  449. MessageBox.Show("钢网编号" + SU_DEVCODE1.Text + "不存在或者未审核");
  450. }
  451. }
  452. private void Make_SMTStencil_Click(object sender, EventArgs e)
  453. {
  454. string Code = "";
  455. string scrapreason = form.Controls["Reason"].Text;
  456. if (scrapreason == "")
  457. {
  458. MessageBox.Show("报废原因不能为空");
  459. return;
  460. }
  461. sql.Clear();
  462. sql.Append("update StencilUse set SU_IFSCRAPOLD=-1,SU_STATUS='报废',SU_ENSIONA='" + ST_ENSIONA.Text + "',SU_ENSIONB='" + ST_ENSIONB.Text + "',SU_ENSIONC='" + ST_ENSIONC.Text + "',SU_ENSIOND='" + ST_ENSIOND.Text + "',SU_ENSIONE='" + ST_ENSIONE.Text + "'");
  463. sql.Append(",SU_RETURNIFCLEAN='" + (SU_RETURNIFCLEAN.Checked ? "-1" : "0") + "' where su_id=(select max(su_id) from stenciluse where su_stcode='" + SU_DEVCODE1.Text + "')");
  464. dh.ExecuteSql(sql.ToString(), "update");
  465. sql.Clear();
  466. sql.Append("update Stencil set ST_SCRAPREASON='" + scrapreason + "',ST_SCRAPMANCODE='" + User.UserCode + "',st_scrapman='" + User.UserName + "',st_scrapdate=sysdate,ST_USESTATUS='报废',ST_ENSIONA='" + ST_ENSIONA.Text + "',ST_ENSIONB='" + ST_ENSIONB.Text + "',");
  467. sql.Append("ST_ENSIONC='" + ST_ENSIONC.Text + "',ST_ENSIOND='" + ST_ENSIOND.Text + "',ST_ENSIONE='" + ST_ENSIONE.Text + "' ");
  468. sql.Append("where st_code='" + SU_DEVCODE1.Text + "'");
  469. dh.ExecuteSql(sql.ToString(), "insert");
  470. ////推送人员信息
  471. //string[] emid = dh.GetConfig("sendEmp", "Stencil").ToString().Replace("\n", "#").Split('#');
  472. //for (int i = 0; i < emid.Length; i++)
  473. //{
  474. // string em_name = dh.getFieldDataByCondition("employee", "em_name", "em_id='" + emid[i] + "'").ToString();
  475. // // LogicHandler.SendMessage(emid[i], em_name, "钢网" + SU_DEVCODE1.Text + "已报废" + ",原因" + scrapreason + ",人员" + User.UserName);
  476. //}
  477. form.Close();
  478. SU_DEVCODE1.Text = "";
  479. ST_ENSIONA.Text = "";
  480. ST_ENSIONB.Text = "";
  481. ST_ENSIONC.Text = "";
  482. ST_ENSIOND.Text = "";
  483. ST_ENSIONE.Text = "";
  484. SU_RETURNIFCLEAN.Checked = false;
  485. Scrap.Enabled = false;
  486. MessageBox.Show("报废成功!");
  487. }
  488. private void ma_code_TextKeyDown(object sender, KeyEventArgs e)
  489. {
  490. if (e.KeyCode == Keys.Enter)
  491. {
  492. Confirm.PerformClick();
  493. }
  494. }
  495. }
  496. }