UIM010150.cs 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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 System.Xml;
  11. using CoreFS.CA06;
  12. namespace Core.LZMes.Client.UIM
  13. {
  14. public partial class UIM010150 : FrmBase
  15. {
  16. private int areaType = 2;//中间库
  17. public UIM010150()
  18. {
  19. InitializeComponent();
  20. }
  21. public override void ToolBar_Click(object sender, string ToolbarKey)
  22. {
  23. switch (ToolbarKey)
  24. {
  25. case "Query":
  26. this.DoQuery();
  27. break;
  28. case "Exit":
  29. this.Close();
  30. break;
  31. }
  32. }
  33. private void DoQuery()
  34. {
  35. CoreClientParam ccp1 = new CoreClientParam();
  36. ccp1.ServerName = "UIM.UIM010150";
  37. ccp1.MethodName = "queryCoilCount";
  38. ccp1.ServerParams = new object[] { areaType };
  39. ccp1 = this.ExecuteQuery(ccp1, CoreInvokeType.Internal);
  40. if (null != ccp1.ReturnObject && !"".Equals(ccp1.ReturnObject))
  41. {
  42. Hashtable ht = (Hashtable)(((ArrayList)ccp1.ReturnObject)[0]);
  43. this.textBox1.Text = ((Hashtable)ht["COIL_COUNT"])["value"].ToString();
  44. this.textBox2.Text = ((Hashtable)ht["TOT_COUNT"])["value"].ToString();
  45. }
  46. this.dataSet1.Tables[0].Clear();
  47. CoreClientParam ccp2 = new CoreClientParam();
  48. ccp2.ServerName = "UIM.UIM010150";
  49. ccp2.MethodName = "queryColCoils";
  50. ccp2.ServerParams = new object[] { areaType };
  51. ccp2.SourceDataTable = this.dataSet1.Tables[0];
  52. this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
  53. DataRowCollection drs = this.dataSet1.Tables[0].Rows;
  54. for (int i = panel5.Controls.Count - 1; i >= 0 ; i--)
  55. {
  56. if (null != panel5.Controls[i])
  57. {
  58. for (int j = panel5.Controls[i].Controls.Count - 1; j >= 0; j--)
  59. {
  60. if (null != panel5.Controls[i].Controls[j])
  61. {
  62. for (int l = 0; l < drs.Count; l++)
  63. {
  64. if (panel5.Controls[i].Controls[j].Controls[1].Name.Contains(drs[l]["row_name"].ToString().Trim()))
  65. {
  66. panel5.Controls[i].Controls[j].Controls[1].Text = drs[l]["row_count"].ToString().Trim();
  67. break ;
  68. }
  69. }
  70. }
  71. }
  72. }
  73. }
  74. }
  75. private void UIM010150_Load(object sender, EventArgs e)
  76. {
  77. //query
  78. string xmlStr = queryAreaInfo();
  79. if (null != xmlStr)
  80. {
  81. Infragistics.Win.Misc.UltraGroupBox ultraGroupBox = null;
  82. //parse xmls
  83. XmlDocument xmldoc = new XmlDocument();
  84. xmldoc.LoadXml(xmlStr);
  85. XmlNodeList nodeList = xmldoc.SelectSingleNode("areas").ChildNodes;
  86. for (int i = nodeList.Count - 1; i >= 0; i--)
  87. {
  88. XmlNode node = nodeList[i];
  89. //create ultraGroupBox
  90. ultraGroupBox = new Infragistics.Win.Misc.UltraGroupBox();
  91. ultraGroupBox.Text = node.Attributes["name"].Value.Trim();
  92. ultraGroupBox.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  93. ultraGroupBox.Name = node.Attributes["name"].Value.Trim();
  94. ultraGroupBox.Height = 80;
  95. ultraGroupBox.ViewStyle = Infragistics.Win.Misc.GroupBoxViewStyle.Office2003;
  96. ultraGroupBox.Dock = DockStyle.Top;
  97. XmlNodeList rowList = node.ChildNodes;
  98. //create panel
  99. Panel panel = null;
  100. for (int j = rowList.Count - 1; j >= 0; j--)
  101. {
  102. XmlNode rowNode = rowList[j];
  103. panel = new Panel();
  104. panel.Dock = DockStyle.Left;
  105. panel.Width = 80;
  106. Label lbl1 = new Label();
  107. lbl1.Text = rowNode.Attributes["name"].Value.Trim().Split(new Char[] { '_' })[0];
  108. lbl1.Height = 30;
  109. lbl1.Width = 80;
  110. lbl1.TextAlign = ContentAlignment.MiddleCenter;
  111. lbl1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  112. lbl1.Location = new Point(0, 0);
  113. lbl1.Cursor = System.Windows.Forms.Cursors.Hand;
  114. lbl1.Name = "lbl1_" + rowNode.Attributes["name"].Value.Trim();
  115. lbl1.BackColor = System.Drawing.Color.FromArgb(220, 229, 236);
  116. lbl1.BorderStyle = BorderStyle.FixedSingle;
  117. lbl1.DoubleClick += new EventHandler(lbl_Click);
  118. Label lbl2 = new Label();
  119. lbl2.Height = 30;
  120. lbl2.Width = 80;
  121. lbl2.TextAlign = ContentAlignment.MiddleCenter;
  122. lbl2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  123. lbl2.Location = new Point(0,26);
  124. lbl2.Name = "lbl2_" + rowNode.Attributes["name"].Value.Trim();
  125. lbl2.Cursor = System.Windows.Forms.Cursors.Hand;
  126. lbl2.BackColor = Color.White;
  127. lbl2.ForeColor = Color.Blue;
  128. lbl2.BorderStyle = BorderStyle.FixedSingle;
  129. lbl2.DoubleClick += new EventHandler(lbl_Click);
  130. panel.Controls.Add(lbl1);
  131. panel.Controls.Add(lbl2);
  132. ultraGroupBox.Controls.Add(panel);
  133. }
  134. panel5.Controls.Add(ultraGroupBox);
  135. }
  136. }
  137. }
  138. /// <summary>
  139. /// 查询区域信息
  140. /// </summary>
  141. private string queryAreaInfo()
  142. {
  143. CoreClientParam ccp = new CoreClientParam();
  144. ccp.ServerName = "UIM.UIM010150";
  145. ccp.MethodName = "queryYardArea";
  146. ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  147. string xmlStr = null != ccp.ReturnObject ? ccp.ReturnObject.ToString() : null;
  148. return xmlStr;
  149. }
  150. private void lbl_Click(object sender, EventArgs e)
  151. {
  152. Label lbl = (Label)sender;
  153. string str = lbl.Name;
  154. string yardRow = str.Split(new char[]{'_'})[1].Trim();
  155. //MessageBox.Show(lbl.Name);
  156. UIM010151 dlg = new UIM010151(this, areaType, yardRow);
  157. dlg.ShowDialog(this);
  158. }
  159. /// <summary>
  160. /// 查询区域中一列的垛位信息
  161. /// </summary>
  162. /// <param name="areayType"></param>
  163. /// <param name="yardRow"></param>
  164. internal void queryYardCols(int areaType, string yardRow)
  165. {
  166. this.dataSet3.Tables[0].Clear();
  167. CoreClientParam ccp = new CoreClientParam();
  168. ccp.ServerName = "UIM.UIM010150";
  169. ccp.MethodName = "queryYardCols";
  170. ccp.ServerParams = new object[] { areaType, yardRow };
  171. ccp.SourceDataTable = this.dataSet3.Tables[0];
  172. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  173. }
  174. /// <summary>
  175. /// 查询区域中一列的垛位中钢卷信息
  176. /// </summary>
  177. /// <param name="areayType"></param>
  178. /// <param name="yardRow"></param>
  179. internal void queryYardColCoils(int areaType, string yardRow)
  180. {
  181. this.dataSet2.Tables[0].Clear();
  182. CoreClientParam ccp = new CoreClientParam();
  183. ccp.ServerName = "UIM.UIM010150";
  184. ccp.MethodName = "queryYardColCoils";
  185. ccp.ServerParams = new object[] { areaType, yardRow };
  186. ccp.SourceDataTable = this.dataSet2.Tables[0];
  187. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  188. }
  189. internal int queryMinYardCol(int areaType, string yardRow)
  190. {
  191. int minRow = 1;
  192. CoreClientParam ccp = new CoreClientParam();
  193. ccp.ServerName = "UIM.UIM010150";
  194. ccp.MethodName = "queryMinYardCol";
  195. ccp.ServerParams = new object[] { areaType, yardRow };
  196. ccp = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  197. if (ccp.ReturnObject != null)
  198. {
  199. minRow = int.Parse(ccp.ReturnObject.ToString());
  200. }
  201. return minRow;
  202. }
  203. }
  204. }