FrmOutPRce.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. using Core.Mes.Client.Comm.Server;
  2. using Core.Mes.Client.Comm.Tool;
  3. using CoreFS.CA06;
  4. using System;
  5. using System.Collections;
  6. using System.Collections.Generic;
  7. using System.ComponentModel;
  8. using System.Data;
  9. using System.Drawing;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Windows.Forms;
  13. namespace Core.StlMes.Client.Mcp.Entity
  14. {
  15. public partial class FrmOutPrce : Form
  16. {
  17. OpeBase _ob = null;
  18. private string zYgNo = "";
  19. bool _falg = false;
  20. public FrmOutPrce(OpeBase ob,String planNo,bool falg)
  21. {
  22. InitializeComponent();
  23. _ob = ob;
  24. zYgNo = planNo;
  25. _falg = falg;
  26. }
  27. private void button1_Click(object sender, EventArgs e)
  28. {
  29. if (cmbGx.Text.ToString().Equals("")) { MessageUtil.ShowTips("请选择需要结炉的委外工序"); return; }
  30. string gx = "";
  31. DataTable dt2 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryGX", new object[] { cmbGx.Value.ToString() }, _ob);
  32. if (dt2.Rows.Count > 0)
  33. {
  34. gx = dt2.Rows[0]["BASECODE"].ToString();
  35. }
  36. ArrayList list = new ArrayList();
  37. list.Add(zYgNo);
  38. list.Add(gx);
  39. list.Add(cmbGx.Text.ToString());
  40. if (MessageUtil.ShowYesNoAndQuestion("是否结炉?") == DialogResult.No)
  41. {
  42. return;
  43. }
  44. CoreClientParam ccp = new CoreClientParam();
  45. ccp.ServerName = "com.steering.mes.mcp.coup.FrmOutSourPerfor";
  46. ccp.MethodName = "doBeside";
  47. ccp.ServerParams = new object[] { list };
  48. ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  49. if (ccp.ReturnCode != -1)
  50. {
  51. if (ccp.ReturnInfo.Equals("结炉成功!"))
  52. {
  53. MessageUtil.ShowTips(ccp.ReturnInfo);
  54. this.Close();
  55. }
  56. else
  57. {
  58. MessageUtil.ShowTips(ccp.ReturnInfo);
  59. }
  60. }
  61. }
  62. private void FrmOutPrce_Load(object sender, EventArgs e)
  63. {
  64. if (_falg == true)
  65. {
  66. button2.Visible = false;
  67. button1.Visible = true;
  68. }
  69. else
  70. {
  71. button2.Visible = true;
  72. button1.Visible = false;
  73. }
  74. }
  75. private void button2_Click(object sender, EventArgs e)
  76. {
  77. if (cmbGx.Text.ToString().Equals("")) { MessageUtil.ShowTips("请选择需要撤销结炉的委外工序"); return; }
  78. string gx = "";
  79. DataTable dt2 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryGX", new object[] { cmbGx.Value.ToString() }, _ob);
  80. if (dt2.Rows.Count > 0)
  81. {
  82. gx = dt2.Rows[0]["BASECODE"].ToString();
  83. }
  84. ArrayList list = new ArrayList();
  85. list.Add(zYgNo);
  86. list.Add(gx);
  87. list.Add(cmbGx.Text.ToString());
  88. if (MessageUtil.ShowYesNoAndQuestion("是否撤销结炉?") == DialogResult.No)
  89. {
  90. return;
  91. }
  92. CoreClientParam ccp = new CoreClientParam();
  93. ccp.ServerName = "com.steering.mes.mcp.coup.FrmOutSourPerfor";
  94. ccp.MethodName = "undoBeside";
  95. ccp.ServerParams = new object[] { list };
  96. ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  97. if (ccp.ReturnCode != -1)
  98. {
  99. if (ccp.ReturnInfo.Equals("撤销结炉成功!"))
  100. {
  101. MessageUtil.ShowTips(ccp.ReturnInfo);
  102. this.Close();
  103. }
  104. else
  105. {
  106. MessageUtil.ShowTips(ccp.ReturnInfo);
  107. }
  108. }
  109. }
  110. }
  111. }