| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Xml;
- using CoreFS.CA06;
- namespace Core.LZMes.Client.UIM
- {
- public partial class UIM010150 : FrmBase
- {
- private int areaType = 2;//中间库
- public UIM010150()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Exit":
- this.Close();
- break;
- }
- }
- private void DoQuery()
- {
- CoreClientParam ccp1 = new CoreClientParam();
- ccp1.ServerName = "UIM.UIM010150";
- ccp1.MethodName = "queryCoilCount";
- ccp1.ServerParams = new object[] { areaType };
- ccp1 = this.ExecuteQuery(ccp1, CoreInvokeType.Internal);
- if (null != ccp1.ReturnObject && !"".Equals(ccp1.ReturnObject))
- {
- Hashtable ht = (Hashtable)(((ArrayList)ccp1.ReturnObject)[0]);
- this.textBox1.Text = ((Hashtable)ht["COIL_COUNT"])["value"].ToString();
- this.textBox2.Text = ((Hashtable)ht["TOT_COUNT"])["value"].ToString();
- }
- this.dataSet1.Tables[0].Clear();
- CoreClientParam ccp2 = new CoreClientParam();
- ccp2.ServerName = "UIM.UIM010150";
- ccp2.MethodName = "queryColCoils";
- ccp2.ServerParams = new object[] { areaType };
- ccp2.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal);
- DataRowCollection drs = this.dataSet1.Tables[0].Rows;
- for (int i = panel5.Controls.Count - 1; i >= 0 ; i--)
- {
- if (null != panel5.Controls[i])
- {
- for (int j = panel5.Controls[i].Controls.Count - 1; j >= 0; j--)
- {
- if (null != panel5.Controls[i].Controls[j])
- {
- for (int l = 0; l < drs.Count; l++)
- {
- if (panel5.Controls[i].Controls[j].Controls[1].Name.Contains(drs[l]["row_name"].ToString().Trim()))
- {
- panel5.Controls[i].Controls[j].Controls[1].Text = drs[l]["row_count"].ToString().Trim();
- break ;
- }
- }
- }
- }
- }
- }
- }
- private void UIM010150_Load(object sender, EventArgs e)
- {
- //query
- string xmlStr = queryAreaInfo();
- if (null != xmlStr)
- {
- Infragistics.Win.Misc.UltraGroupBox ultraGroupBox = null;
- //parse xmls
- XmlDocument xmldoc = new XmlDocument();
- xmldoc.LoadXml(xmlStr);
- XmlNodeList nodeList = xmldoc.SelectSingleNode("areas").ChildNodes;
- for (int i = nodeList.Count - 1; i >= 0; i--)
- {
- XmlNode node = nodeList[i];
- //create ultraGroupBox
- ultraGroupBox = new Infragistics.Win.Misc.UltraGroupBox();
- ultraGroupBox.Text = node.Attributes["name"].Value.Trim();
- ultraGroupBox.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- ultraGroupBox.Name = node.Attributes["name"].Value.Trim();
- ultraGroupBox.Height = 80;
- ultraGroupBox.ViewStyle = Infragistics.Win.Misc.GroupBoxViewStyle.Office2003;
- ultraGroupBox.Dock = DockStyle.Top;
- XmlNodeList rowList = node.ChildNodes;
- //create panel
- Panel panel = null;
- for (int j = rowList.Count - 1; j >= 0; j--)
- {
- XmlNode rowNode = rowList[j];
- panel = new Panel();
- panel.Dock = DockStyle.Left;
- panel.Width = 80;
- Label lbl1 = new Label();
- lbl1.Text = rowNode.Attributes["name"].Value.Trim().Split(new Char[] { '_' })[0];
- lbl1.Height = 30;
- lbl1.Width = 80;
- lbl1.TextAlign = ContentAlignment.MiddleCenter;
- lbl1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- lbl1.Location = new Point(0, 0);
- lbl1.Cursor = System.Windows.Forms.Cursors.Hand;
- lbl1.Name = "lbl1_" + rowNode.Attributes["name"].Value.Trim();
- lbl1.BackColor = System.Drawing.Color.FromArgb(220, 229, 236);
- lbl1.BorderStyle = BorderStyle.FixedSingle;
- lbl1.DoubleClick += new EventHandler(lbl_Click);
- Label lbl2 = new Label();
- lbl2.Height = 30;
- lbl2.Width = 80;
- lbl2.TextAlign = ContentAlignment.MiddleCenter;
- lbl2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- lbl2.Location = new Point(0,26);
- lbl2.Name = "lbl2_" + rowNode.Attributes["name"].Value.Trim();
- lbl2.Cursor = System.Windows.Forms.Cursors.Hand;
- lbl2.BackColor = Color.White;
- lbl2.ForeColor = Color.Blue;
- lbl2.BorderStyle = BorderStyle.FixedSingle;
- lbl2.DoubleClick += new EventHandler(lbl_Click);
- panel.Controls.Add(lbl1);
- panel.Controls.Add(lbl2);
- ultraGroupBox.Controls.Add(panel);
- }
- panel5.Controls.Add(ultraGroupBox);
- }
- }
- }
- /// <summary>
- /// 查询区域信息
- /// </summary>
- private string queryAreaInfo()
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIM.UIM010150";
- ccp.MethodName = "queryYardArea";
- ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- string xmlStr = null != ccp.ReturnObject ? ccp.ReturnObject.ToString() : null;
- return xmlStr;
- }
- private void lbl_Click(object sender, EventArgs e)
- {
- Label lbl = (Label)sender;
- string str = lbl.Name;
- string yardRow = str.Split(new char[]{'_'})[1].Trim();
- //MessageBox.Show(lbl.Name);
- UIM010151 dlg = new UIM010151(this, areaType, yardRow);
- dlg.ShowDialog(this);
- }
- /// <summary>
- /// 查询区域中一列的垛位信息
- /// </summary>
- /// <param name="areayType"></param>
- /// <param name="yardRow"></param>
- internal void queryYardCols(int areaType, string yardRow)
- {
- this.dataSet3.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIM.UIM010150";
- ccp.MethodName = "queryYardCols";
- ccp.ServerParams = new object[] { areaType, yardRow };
- ccp.SourceDataTable = this.dataSet3.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- /// <summary>
- /// 查询区域中一列的垛位中钢卷信息
- /// </summary>
- /// <param name="areayType"></param>
- /// <param name="yardRow"></param>
- internal void queryYardColCoils(int areaType, string yardRow)
- {
- this.dataSet2.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIM.UIM010150";
- ccp.MethodName = "queryYardColCoils";
- ccp.ServerParams = new object[] { areaType, yardRow };
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- internal int queryMinYardCol(int areaType, string yardRow)
- {
- int minRow = 1;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIM.UIM010150";
- ccp.MethodName = "queryMinYardCol";
- ccp.ServerParams = new object[] { areaType, yardRow };
- ccp = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnObject != null)
- {
- minRow = int.Parse(ccp.ReturnObject.ToString());
- }
- return minRow;
- }
- }
- }
|