1ae2482f67458a83ecef7587cba18be244c5cae3.svn-base 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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 UIM010070 : FrmBase
  15. {
  16. private int areaType = 1;//原料库
  17. public UIM010070()
  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.UIM010070";
  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.UIM010070";
  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]["col_name"].ToString().Trim()))
  65. {
  66. panel5.Controls[i].Controls[j].Controls[1].Text = drs[l]["col_count"].ToString().Trim();
  67. break ;
  68. }
  69. }
  70. }
  71. }
  72. }
  73. }
  74. }
  75. private void UIM010070_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.Name = node.Attributes["id"].Value.Trim();
  93. ultraGroupBox.Height = 70;
  94. ultraGroupBox.ViewStyle = Infragistics.Win.Misc.GroupBoxViewStyle.Office2003;
  95. ultraGroupBox.Dock = DockStyle.Top;
  96. XmlNodeList colList = node.ChildNodes;
  97. //create panel
  98. Panel panel = null;
  99. for (int j = colList.Count - 1; j >= 0; j--)
  100. {
  101. XmlNode colNode = colList[j];
  102. panel = new Panel();
  103. panel.Dock = DockStyle.Left;
  104. panel.Width = 58;
  105. Label lbl1 = new Label();
  106. lbl1.Text = colNode.Attributes["name"].Value.Trim().Split(new Char[] { '_' })[0];
  107. lbl1.Height = 26;
  108. lbl1.Width = 55;
  109. lbl1.Location = new Point(0, 0);
  110. lbl1.Cursor = System.Windows.Forms.Cursors.Hand;
  111. lbl1.Name = "lbl1_" + colNode.Attributes["name"].Value.Trim();
  112. lbl1.BackColor = System.Drawing.Color.FromArgb(220, 229, 236);
  113. lbl1.BorderStyle = BorderStyle.FixedSingle;
  114. lbl1.DoubleClick += new EventHandler(lbl_Click);
  115. Label lbl2 = new Label();
  116. lbl2.Height = 26;
  117. lbl2.Width = 55;
  118. lbl2.Location = new Point(0,26);
  119. lbl2.Name = "lbl2_" + colNode.Attributes["name"].Value.Trim();
  120. lbl2.Cursor = System.Windows.Forms.Cursors.Hand;
  121. lbl2.BackColor = Color.White;
  122. lbl2.BorderStyle = BorderStyle.FixedSingle;
  123. lbl2.DoubleClick += new EventHandler(lbl_Click);
  124. panel.Controls.Add(lbl1);
  125. panel.Controls.Add(lbl2);
  126. ultraGroupBox.Controls.Add(panel);
  127. }
  128. panel5.Controls.Add(ultraGroupBox);
  129. }
  130. }
  131. }
  132. /// <summary>
  133. /// 查询区域信息
  134. /// </summary>
  135. private string queryAreaInfo()
  136. {
  137. CoreClientParam ccp = new CoreClientParam();
  138. ccp.ServerName = "UIM.UIM010070";
  139. ccp.MethodName = "queryYardArea";
  140. ccp.ServerParams = new object[] { areaType };
  141. ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  142. string xmlStr = null != ccp.ReturnObject ? ccp.ReturnObject.ToString() : null;
  143. return xmlStr;
  144. }
  145. private void lbl_Click(object sender, EventArgs e)
  146. {
  147. Label lbl = (Label)sender;
  148. string str = lbl.Name;
  149. string yardCol = str.Split(new char[]{'_'})[1].Trim();
  150. int areaNo = int.Parse(lbl.Parent.Parent.Name);
  151. //MessageBox.Show(lbl.Name);
  152. UIM010071 dlg = new UIM010071(this, areaType, areaNo, yardCol);
  153. dlg.ShowDialog(this);
  154. }
  155. /// <summary>
  156. /// 查询区域中一行的垛位信息
  157. /// </summary>
  158. /// <param name="areayType"></param>
  159. /// <param name="areayNo"></param>
  160. /// <param name="yardCol"></param>
  161. internal void queryYardRows(int areaType,int areaNo, string yardCol)
  162. {
  163. this.dataSet3.Tables[0].Clear();
  164. CoreClientParam ccp = new CoreClientParam();
  165. ccp.ServerName = "UIM.UIM010070";
  166. ccp.MethodName = "queryYardRows";
  167. ccp.ServerParams = new object[] { areaType,areaNo, yardCol };
  168. ccp.SourceDataTable = this.dataSet3.Tables[0];
  169. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  170. }
  171. /// <summary>
  172. /// 查询区域中一行的垛位中钢卷信息
  173. /// </summary>
  174. /// <param name="areayType"></param>
  175. /// <param name="areayNo"></param>
  176. /// <param name="yardCol"></param>
  177. internal void queryYardRowCoils(int areaType,int areaNo, string yardCol)
  178. {
  179. this.dataSet2.Tables[0].Clear();
  180. CoreClientParam ccp = new CoreClientParam();
  181. ccp.ServerName = "UIM.UIM010070";
  182. ccp.MethodName = "queryYardRowCoils";
  183. ccp.ServerParams = new object[] { areaType,areaNo, yardCol };
  184. ccp.SourceDataTable = this.dataSet2.Tables[0];
  185. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  186. }
  187. internal int queryMinYardRow(int areaType, int areaNo, string yardCol)
  188. {
  189. int minRow = 1;
  190. CoreClientParam ccp = new CoreClientParam();
  191. ccp.ServerName = "UIM.UIM010070";
  192. ccp.MethodName = "queryMinYardRow";
  193. ccp.ServerParams = new object[] { areaType, areaNo, yardCol };
  194. ccp = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  195. if (ccp.ReturnObject != null)
  196. {
  197. minRow = int.Parse(ccp.ReturnObject.ToString());
  198. }
  199. return minRow;
  200. }
  201. }
  202. }