UIJ030021.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using CoreFS.CA06;
  11. namespace Core.LZMes.Client.UIJ
  12. {
  13. public partial class UIJ030021 : FrmBase
  14. {
  15. private ArrayList coils = new ArrayList();
  16. public ArrayList Coils
  17. {
  18. get { return coils; }
  19. set { coils = value; }
  20. }
  21. private string ordNo = string.Empty;
  22. public string OrdNo
  23. {
  24. get { return ordNo; }
  25. set { ordNo = value; }
  26. }
  27. private string ordSeq = string.Empty;
  28. public string OrdSeq
  29. {
  30. get { return ordSeq; }
  31. set { ordSeq = value; }
  32. }
  33. private UIJ030020 onwer = null;
  34. public UIJ030020 ShowOnwer
  35. {
  36. get { return onwer; }
  37. set { onwer = value; }
  38. }
  39. public UIJ030021()
  40. {
  41. InitializeComponent();
  42. }
  43. private void UIJ030021_Load(object sender, EventArgs e)
  44. {
  45. textBox1.Text = ordNo + "-" + ordSeq;
  46. DoQuery();
  47. }
  48. private void DoQuery()
  49. {
  50. string coilNo = textBox2.Text.Trim();
  51. string thkMin = textBox3.Text.Trim();
  52. string thkMax = textBox4.Text.Trim();
  53. string wthMin = textBox5.Text.Trim();
  54. string wthMax = textBox6.Text.Trim();
  55. this.dataSet1.Tables[0].Clear();
  56. CoreClientParam ccp = new CoreClientParam();
  57. ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  58. ccp.MethodName = "querySameCoils";
  59. ccp.SourceDataTable = this.dataSet1.Tables[0];
  60. ccp.ServerParams = new Object[] { ordNo,ordSeq,coilNo,thkMin,thkMax,wthMin,wthMax };
  61. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  62. }
  63. private void label2_Click(object sender, EventArgs e)
  64. {
  65. DoQuery();
  66. }
  67. private void label6_Click(object sender, EventArgs e)
  68. {
  69. ultraGrid1.UpdateData();
  70. ArrayList newCoils = new ArrayList();
  71. Infragistics.Win.UltraWinGrid.RowsCollection rs = ultraGrid1.Rows;
  72. for (int i = 0; i < rs.Count; i++)
  73. {
  74. if (Convert.ToBoolean(rs[i].Cells["CHK"].Value))
  75. {
  76. newCoils.Add(rs[i].Cells["COIL_NO"].Value.ToString());
  77. }
  78. }
  79. bool flag = false;
  80. if (coils.Count == newCoils.Count)
  81. {
  82. if (DialogResult.Yes == MessageBox.Show("冷轧MES", "是否确定替换钢卷?", MessageBoxButtons.YesNo))
  83. {
  84. flag = true;
  85. }
  86. }
  87. else
  88. {
  89. if (DialogResult.Yes == MessageBox.Show("冷轧MES", "钢卷数量不相等,是否确定替换钢卷?", MessageBoxButtons.YesNo))
  90. {
  91. flag = true;
  92. }
  93. }
  94. if (flag)
  95. {
  96. CoreClientParam ccp = new CoreClientParam();
  97. ccp.ServerName = "UIJ.UIJ03.UIJ030020";
  98. ccp.MethodName = "replaceCoils";
  99. ccp.SourceDataTable = this.dataSet1.Tables[0];
  100. ccp.ServerParams = new Object[] { coils,newCoils };
  101. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  102. if (0 == ccp.ReturnCode)
  103. {
  104. MessageBox.Show("换卷成功!");
  105. onwer.queryDlivDirCoil("C");
  106. this.Close();
  107. }
  108. }
  109. }
  110. }
  111. }