frmLgEleConfig.cs.svn-base 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using System.Data;
  7. using CoreFS.CA06;
  8. using Infragistics.Win;
  9. using Infragistics.Win.UltraWinGrid;
  10. namespace Core.LgMes.Client.LgIntegrationQuery
  11. {
  12. /// <summary>
  13. /// ElementsForm 的摘要说明。
  14. /// </summary>
  15. public class frmLgEleConfig : Core.Mes.Client.Common.frmStyleBase
  16. {
  17. private System.Data.DataSet dataSet1;
  18. private System.Data.DataTable dataTable1;
  19. private System.Data.DataColumn dataColumn1;
  20. private System.Data.DataColumn dataColumn2;
  21. private System.Data.DataColumn dataColumn3;
  22. private System.ComponentModel.IContainer components;
  23. public static string StrHic;
  24. public static string StrT;
  25. private UltraGrid ultraGrid1;
  26. private string m_szGW = "";
  27. public static string szEleStd = "";
  28. private Infragistics.Win.Misc.UltraGroupBox ultraGroupBox1;
  29. private Label lblSteel;
  30. private Label lblHeatID;
  31. private Label label2;
  32. private Label label1;
  33. private DataColumn dataColumn4; //化学成分标准列名
  34. public static string strSteelCode = "";
  35. public string Hic
  36. {
  37. get
  38. {
  39. return StrHic;
  40. }
  41. set
  42. {
  43. StrHic=value;
  44. }
  45. }
  46. public string Bzhi
  47. {
  48. get
  49. {
  50. return StrT;
  51. }
  52. set
  53. {
  54. StrT=value;
  55. }
  56. }
  57. public frmLgEleConfig( string StrHic, string StrT, string szGW)
  58. {
  59. //
  60. // Windows 窗体设计器支持所必需的
  61. //
  62. InitializeComponent();
  63. //this.Remoting =Remotingh;
  64. this.Hic=StrHic;
  65. this.Bzhi=StrT;
  66. m_szGW = szGW;
  67. }
  68. /// <summary>
  69. /// 清理所有正在使用的资源。
  70. /// </summary>
  71. protected override void Dispose( bool disposing )
  72. {
  73. if( disposing )
  74. {
  75. if(components != null)
  76. {
  77. components.Dispose();
  78. }
  79. }
  80. base.Dispose( disposing );
  81. }
  82. #region Windows 窗体设计器生成的代码
  83. /// <summary>
  84. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  85. /// 此方法的内容。
  86. /// </summary>
  87. private void InitializeComponent()
  88. {
  89. Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
  90. Infragistics.Win.UltraWinGrid.UltraGridBand ultraGridBand1 = new Infragistics.Win.UltraWinGrid.UltraGridBand("Table1", -1);
  91. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn1 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("序号");
  92. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn2 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("项目名称");
  93. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn3 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("标准范围");
  94. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn4 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("std_dc");
  95. this.dataSet1 = new System.Data.DataSet();
  96. this.dataTable1 = new System.Data.DataTable();
  97. this.dataColumn1 = new System.Data.DataColumn();
  98. this.dataColumn2 = new System.Data.DataColumn();
  99. this.dataColumn3 = new System.Data.DataColumn();
  100. this.dataColumn4 = new System.Data.DataColumn();
  101. this.ultraGrid1 = new Infragistics.Win.UltraWinGrid.UltraGrid();
  102. this.ultraGroupBox1 = new Infragistics.Win.Misc.UltraGroupBox();
  103. this.lblSteel = new System.Windows.Forms.Label();
  104. this.lblHeatID = new System.Windows.Forms.Label();
  105. this.label2 = new System.Windows.Forms.Label();
  106. this.label1 = new System.Windows.Forms.Label();
  107. ((System.ComponentModel.ISupportInitialize)(this.dataSet1)).BeginInit();
  108. ((System.ComponentModel.ISupportInitialize)(this.dataTable1)).BeginInit();
  109. ((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).BeginInit();
  110. ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).BeginInit();
  111. this.ultraGroupBox1.SuspendLayout();
  112. this.SuspendLayout();
  113. //
  114. // dataSet1
  115. //
  116. this.dataSet1.DataSetName = "NewDataSet";
  117. this.dataSet1.Locale = new System.Globalization.CultureInfo("zh-CN");
  118. this.dataSet1.Tables.AddRange(new System.Data.DataTable[] {
  119. this.dataTable1});
  120. //
  121. // dataTable1
  122. //
  123. this.dataTable1.Columns.AddRange(new System.Data.DataColumn[] {
  124. this.dataColumn1,
  125. this.dataColumn2,
  126. this.dataColumn3,
  127. this.dataColumn4});
  128. this.dataTable1.TableName = "Table1";
  129. //
  130. // dataColumn1
  131. //
  132. this.dataColumn1.ColumnName = "序号";
  133. //
  134. // dataColumn2
  135. //
  136. this.dataColumn2.ColumnName = "项目名称";
  137. //
  138. // dataColumn3
  139. //
  140. this.dataColumn3.ColumnName = "标准范围";
  141. //
  142. // dataColumn4
  143. //
  144. this.dataColumn4.Caption = "标准类型";
  145. this.dataColumn4.ColumnName = "std_dc";
  146. //
  147. // ultraGrid1
  148. //
  149. this.ultraGrid1.DataMember = "Table1";
  150. this.ultraGrid1.DataSource = this.dataSet1;
  151. appearance1.BackGradientStyle = Infragistics.Win.GradientStyle.None;
  152. this.ultraGrid1.DisplayLayout.Appearance = appearance1;
  153. ultraGridColumn1.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  154. ultraGridColumn1.Header.VisiblePosition = 0;
  155. ultraGridColumn1.Hidden = true;
  156. ultraGridColumn1.Width = 42;
  157. ultraGridColumn2.Header.VisiblePosition = 1;
  158. ultraGridColumn2.RowLayoutColumnInfo.PreferredCellSize = new System.Drawing.Size(60, 0);
  159. ultraGridColumn3.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  160. ultraGridColumn3.Header.VisiblePosition = 2;
  161. ultraGridColumn3.RowLayoutColumnInfo.PreferredCellSize = new System.Drawing.Size(103, 0);
  162. ultraGridColumn3.Width = 117;
  163. ultraGridColumn4.Header.VisiblePosition = 3;
  164. ultraGridColumn4.RowLayoutColumnInfo.PreferredCellSize = new System.Drawing.Size(74, 0);
  165. ultraGridBand1.Columns.AddRange(new object[] {
  166. ultraGridColumn1,
  167. ultraGridColumn2,
  168. ultraGridColumn3,
  169. ultraGridColumn4});
  170. ultraGridBand1.RowLayoutStyle = Infragistics.Win.UltraWinGrid.RowLayoutStyle.ColumnLayout;
  171. this.ultraGrid1.DisplayLayout.BandsSerializer.Add(ultraGridBand1);
  172. this.ultraGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
  173. this.ultraGrid1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  174. this.ultraGrid1.Location = new System.Drawing.Point(0, 49);
  175. this.ultraGrid1.Name = "ultraGrid1";
  176. this.ultraGrid1.Size = new System.Drawing.Size(298, 304);
  177. this.ultraGrid1.TabIndex = 6;
  178. //
  179. // ultraGroupBox1
  180. //
  181. this.ultraGroupBox1.Controls.Add(this.lblSteel);
  182. this.ultraGroupBox1.Controls.Add(this.lblHeatID);
  183. this.ultraGroupBox1.Controls.Add(this.label2);
  184. this.ultraGroupBox1.Controls.Add(this.label1);
  185. this.ultraGroupBox1.Dock = System.Windows.Forms.DockStyle.Top;
  186. this.ultraGroupBox1.Location = new System.Drawing.Point(0, 0);
  187. this.ultraGroupBox1.Name = "ultraGroupBox1";
  188. this.ultraGroupBox1.Size = new System.Drawing.Size(298, 49);
  189. this.ultraGroupBox1.TabIndex = 7;
  190. //
  191. // lblSteel
  192. //
  193. this.lblSteel.AutoSize = true;
  194. this.lblSteel.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  195. this.lblSteel.ForeColor = System.Drawing.Color.Blue;
  196. this.lblSteel.Location = new System.Drawing.Point(191, 18);
  197. this.lblSteel.Name = "lblSteel";
  198. this.lblSteel.Size = new System.Drawing.Size(0, 12);
  199. this.lblSteel.TabIndex = 3;
  200. //
  201. // lblHeatID
  202. //
  203. this.lblHeatID.AutoSize = true;
  204. this.lblHeatID.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  205. this.lblHeatID.ForeColor = System.Drawing.Color.Blue;
  206. this.lblHeatID.Location = new System.Drawing.Point(63, 18);
  207. this.lblHeatID.Name = "lblHeatID";
  208. this.lblHeatID.Size = new System.Drawing.Size(0, 12);
  209. this.lblHeatID.TabIndex = 2;
  210. //
  211. // label2
  212. //
  213. this.label2.AutoSize = true;
  214. this.label2.Location = new System.Drawing.Point(150, 18);
  215. this.label2.Name = "label2";
  216. this.label2.Size = new System.Drawing.Size(41, 12);
  217. this.label2.TabIndex = 1;
  218. this.label2.Text = "钢种:";
  219. //
  220. // label1
  221. //
  222. this.label1.AutoSize = true;
  223. this.label1.Location = new System.Drawing.Point(21, 18);
  224. this.label1.Name = "label1";
  225. this.label1.Size = new System.Drawing.Size(41, 12);
  226. this.label1.TabIndex = 0;
  227. this.label1.Text = "炉号:";
  228. //
  229. // frmLgEleConfig
  230. //
  231. this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
  232. this.ClientSize = new System.Drawing.Size(298, 353);
  233. this.Controls.Add(this.ultraGrid1);
  234. this.Controls.Add(this.ultraGroupBox1);
  235. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
  236. this.MaximizeBox = false;
  237. this.MinimizeBox = false;
  238. this.Name = "frmLgEleConfig";
  239. this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
  240. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  241. this.Text = "成分标准";
  242. this.Load += new System.EventHandler(this.ElementsForm_Load);
  243. ((System.ComponentModel.ISupportInitialize)(this.dataSet1)).EndInit();
  244. ((System.ComponentModel.ISupportInitialize)(this.dataTable1)).EndInit();
  245. ((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).EndInit();
  246. ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).EndInit();
  247. this.ultraGroupBox1.ResumeLayout(false);
  248. this.ultraGroupBox1.PerformLayout();
  249. this.ResumeLayout(false);
  250. }
  251. #endregion
  252. private void ElementsForm_Load(object sender, System.EventArgs e)
  253. {
  254. lblHeatID.Text = StrHic.Substring(0, 10);
  255. lblSteel.Text = strSteelCode;
  256. //this.RemotingHelp =Remoting;
  257. GetTAM_StandardElement();
  258. //ElementsForm.ActiveForm .WindowState =0;
  259. //ElementsForm.ActiveForm.StartPosition =System.Windows .Forms .FormStartPosition.CenterParent;
  260. // ElementsForm.ActiveForm.Width =224;
  261. // ElementsForm.ActiveForm.Height =360;
  262. }
  263. public void GetTAM_StandardElement()/// 查询判定牌号成分
  264. {
  265. string err = "";
  266. string szWhere = "";
  267. object obj = new object();
  268. szWhere = Hic.Substring(0, 10); //条件
  269. string szCrfStd = "('L02001','L02005') ";
  270. if (!string.IsNullOrEmpty(szEleStd))
  271. {
  272. szEleStd = "('" + szEleStd.Substring(3, szEleStd.Length - 3) + "')";
  273. //获取成分标准
  274. obj = null;//hengxing ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt",
  275. // "Core.LgMes.Server.lgJobMgt.classCommonModule",
  276. // "GetProcStandardValue", new object[] { szWhere, szEleStd, szCrfStd }, out err);
  277. }
  278. if (err != "")
  279. {
  280. MessageBox.Show(err);
  281. }
  282. else if (obj != null)
  283. {
  284. ArrayList ar = new ArrayList();
  285. ar = obj as ArrayList;
  286. DataSet dsStandard = ar[0] as DataSet;
  287. if (dsStandard.Tables[0].Rows.Count > 0)
  288. {
  289. int RowId = 1;
  290. DataRow newRow = null;//dataTable1.NewRow();
  291. foreach (DataRow Drow in dsStandard.Tables[0].Rows)
  292. {
  293. newRow = dataTable1.NewRow();
  294. newRow[0] = RowId;
  295. newRow[1] = Drow["basename"].ToString();
  296. if (Drow["ITEM1MIN"].ToString() != "" && Drow["ITEM1MAX"].ToString() != "")
  297. newRow[2] = Drow["ITEM1MIN"].ToString() + " - " + Drow["ITEM1MAX"].ToString();
  298. else if (Drow["ITEM1MIN"].ToString() != "" && Drow["ITEM1MAX"].ToString() == "")
  299. newRow[2] = "> " + Drow["ITEM1MIN"].ToString();
  300. else if (Drow["ITEM1MIN"].ToString() == "" && Drow["ITEM1MAX"].ToString() != "")
  301. newRow[2] = "≤ " + Drow["ITEM1MAX"].ToString();
  302. newRow[3] = Drow["std_dc"].ToString() == "1" ? "国标" : "内控";
  303. dataTable1.Rows.Add(newRow);
  304. RowId++;
  305. }
  306. }
  307. }
  308. }
  309. private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
  310. {
  311. ultraGrid1.DisplayLayout .Bands [0].Columns [0].Width =30;
  312. ultraGrid1.DisplayLayout .Bands [0].Columns [1].Width =40;
  313. ultraGrid1.DisplayLayout .Bands [0].Columns [2].Width =120;
  314. }
  315. }
  316. }