frmAdditStat.cs 69 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504
  1. using System;
  2. using System.Data;
  3. using System.Drawing;
  4. using System.Collections;
  5. using System.ComponentModel;
  6. using System.Windows.Forms;
  7. using CoreFS.CA06;
  8. using System.Diagnostics;
  9. using Infragistics.Win.UltraWinMaskedEdit;
  10. using Infragistics.Win.UltraWinGrid;
  11. using Infragistics.Win;
  12. using System.IO;
  13. using Core.StlMes.Client.LgCommon;
  14. using Core.Mes.Client.Comm.Control;
  15. namespace Core.StlMes.Client.LgIntegrationQuery
  16. {
  17. /// <summary>
  18. /// FrmAdditStat 的摘要说明。
  19. /// </summary>
  20. public class frmAdditStat : frmStyleBase
  21. {
  22. #region " Construct "系统自动生成的 窗口结构代码
  23. private System.Windows.Forms.Panel panel1;
  24. private Infragistics.Win.Misc.UltraGroupBox ultraGroupBox1;
  25. private Infragistics.Win.UltraWinTabControl.UltraTabControl ultraTabControl1;
  26. private Infragistics.Win.UltraWinTabControl.UltraTabSharedControlsPage ultraTabSharedControlsPage1;
  27. private Infragistics.Win.UltraWinTabControl.UltraTabPageControl ultraTabPageControl1;
  28. private Infragistics.Win.UltraWinTabControl.UltraTabPageControl ultraTabPageControl2;
  29. private System.Windows.Forms.Label label2;
  30. private Infragistics.Win.UltraWinGrid.UltraGrid ultraGrid1;
  31. private Infragistics.Win.UltraWinGrid.UltraGrid ultraGrid2;
  32. private System.Windows.Forms.Label label6;
  33. private System.Windows.Forms.CheckBox chk_HeaNo;
  34. private System.Windows.Forms.CheckBox checkBox3;
  35. private System.Windows.Forms.CheckBox chk_Staticode;
  36. private Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter GridExcelExporter;
  37. private CheckBox chkSteel;
  38. private TextBox txtSteel;
  39. private Infragistics.Win.UltraWinEditors.UltraDateTimeEditor uldtEndTime;
  40. private Infragistics.Win.UltraWinEditors.UltraDateTimeEditor uldtBeginTime;
  41. private Infragistics.Win.UltraWinEditors.UltraComboEditor cboStaticode;
  42. private Infragistics.Win.UltraWinEditors.UltraComboEditor cboGW;
  43. private Infragistics.Win.UltraWinEditors.UltraComboEditor cboGWID;
  44. private Infragistics.Win.UltraWinEditors.UltraCheckEditor uCkEditorForFilter;
  45. private Label label1;
  46. private TextBox ultraMaskedEdit2;
  47. private TextBox ultraMaskedEdit1;
  48. private Label label3;
  49. private System.ComponentModel.IContainer components;
  50. public frmAdditStat()
  51. {
  52. //
  53. // Windows 窗体设计器支持所必需的
  54. //
  55. InitializeComponent();
  56. //
  57. // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
  58. //
  59. }
  60. /// <summary>
  61. /// 清理所有正在使用的资源。
  62. /// </summary>
  63. protected override void Dispose(bool disposing)
  64. {
  65. if (disposing)
  66. {
  67. if (components != null)
  68. {
  69. components.Dispose();
  70. }
  71. }
  72. base.Dispose(disposing);
  73. }
  74. #region Windows 窗体设计器生成的代码
  75. /// <summary>
  76. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  77. /// 此方法的内容。
  78. /// </summary>
  79. private void InitializeComponent()
  80. {
  81. this.components = new System.ComponentModel.Container();
  82. Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
  83. Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
  84. Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance();
  85. Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance();
  86. Infragistics.Win.Appearance appearance5 = new Infragistics.Win.Appearance();
  87. Infragistics.Win.Appearance appearance6 = new Infragistics.Win.Appearance();
  88. Infragistics.Win.Appearance appearance7 = new Infragistics.Win.Appearance();
  89. Infragistics.Win.Appearance appearance8 = new Infragistics.Win.Appearance();
  90. Infragistics.Win.Appearance appearance9 = new Infragistics.Win.Appearance();
  91. Infragistics.Win.Appearance appearance10 = new Infragistics.Win.Appearance();
  92. Infragistics.Win.Appearance appearance11 = new Infragistics.Win.Appearance();
  93. Infragistics.Win.Appearance appearance12 = new Infragistics.Win.Appearance();
  94. Infragistics.Win.Appearance appearance19 = new Infragistics.Win.Appearance();
  95. Infragistics.Win.UltraWinTabControl.UltraTab ultraTab1 = new Infragistics.Win.UltraWinTabControl.UltraTab();
  96. Infragistics.Win.UltraWinTabControl.UltraTab ultraTab2 = new Infragistics.Win.UltraWinTabControl.UltraTab();
  97. Infragistics.Win.Appearance appearance13 = new Infragistics.Win.Appearance();
  98. Infragistics.Win.Appearance appearance14 = new Infragistics.Win.Appearance();
  99. Infragistics.Win.Appearance appearance15 = new Infragistics.Win.Appearance();
  100. Infragistics.Win.ValueListItem valueListItem1 = new Infragistics.Win.ValueListItem();
  101. Infragistics.Win.ValueListItem valueListItem2 = new Infragistics.Win.ValueListItem();
  102. Infragistics.Win.ValueListItem valueListItem3 = new Infragistics.Win.ValueListItem();
  103. Infragistics.Win.ValueListItem valueListItem12 = new Infragistics.Win.ValueListItem();
  104. Infragistics.Win.Appearance appearance16 = new Infragistics.Win.Appearance();
  105. Infragistics.Win.ValueListItem valueListItem5 = new Infragistics.Win.ValueListItem();
  106. Infragistics.Win.ValueListItem valueListItem6 = new Infragistics.Win.ValueListItem();
  107. Infragistics.Win.ValueListItem valueListItem7 = new Infragistics.Win.ValueListItem();
  108. Infragistics.Win.ValueListItem valueListItem8 = new Infragistics.Win.ValueListItem();
  109. Infragistics.Win.ValueListItem valueListItem9 = new Infragistics.Win.ValueListItem();
  110. this.ultraTabPageControl1 = new Infragistics.Win.UltraWinTabControl.UltraTabPageControl();
  111. this.ultraGrid1 = new Infragistics.Win.UltraWinGrid.UltraGrid();
  112. this.ultraTabPageControl2 = new Infragistics.Win.UltraWinTabControl.UltraTabPageControl();
  113. this.ultraGrid2 = new Infragistics.Win.UltraWinGrid.UltraGrid();
  114. this.panel1 = new System.Windows.Forms.Panel();
  115. this.ultraTabControl1 = new Infragistics.Win.UltraWinTabControl.UltraTabControl();
  116. this.ultraTabSharedControlsPage1 = new Infragistics.Win.UltraWinTabControl.UltraTabSharedControlsPage();
  117. this.ultraGroupBox1 = new Infragistics.Win.Misc.UltraGroupBox();
  118. this.label3 = new System.Windows.Forms.Label();
  119. this.label1 = new System.Windows.Forms.Label();
  120. this.ultraMaskedEdit2 = new System.Windows.Forms.TextBox();
  121. this.ultraMaskedEdit1 = new System.Windows.Forms.TextBox();
  122. this.uCkEditorForFilter = new Infragistics.Win.UltraWinEditors.UltraCheckEditor();
  123. this.cboGWID = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
  124. this.cboGW = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
  125. this.cboStaticode = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
  126. this.uldtEndTime = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor();
  127. this.uldtBeginTime = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor();
  128. this.txtSteel = new System.Windows.Forms.TextBox();
  129. this.chkSteel = new System.Windows.Forms.CheckBox();
  130. this.chk_Staticode = new System.Windows.Forms.CheckBox();
  131. this.checkBox3 = new System.Windows.Forms.CheckBox();
  132. this.chk_HeaNo = new System.Windows.Forms.CheckBox();
  133. this.label6 = new System.Windows.Forms.Label();
  134. this.label2 = new System.Windows.Forms.Label();
  135. this.GridExcelExporter = new Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter(this.components);
  136. this.ultraTabPageControl1.SuspendLayout();
  137. ((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).BeginInit();
  138. this.ultraTabPageControl2.SuspendLayout();
  139. ((System.ComponentModel.ISupportInitialize)(this.ultraGrid2)).BeginInit();
  140. this.panel1.SuspendLayout();
  141. ((System.ComponentModel.ISupportInitialize)(this.ultraTabControl1)).BeginInit();
  142. this.ultraTabControl1.SuspendLayout();
  143. ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).BeginInit();
  144. this.ultraGroupBox1.SuspendLayout();
  145. ((System.ComponentModel.ISupportInitialize)(this.uCkEditorForFilter)).BeginInit();
  146. ((System.ComponentModel.ISupportInitialize)(this.cboGWID)).BeginInit();
  147. ((System.ComponentModel.ISupportInitialize)(this.cboGW)).BeginInit();
  148. ((System.ComponentModel.ISupportInitialize)(this.cboStaticode)).BeginInit();
  149. ((System.ComponentModel.ISupportInitialize)(this.uldtEndTime)).BeginInit();
  150. ((System.ComponentModel.ISupportInitialize)(this.uldtBeginTime)).BeginInit();
  151. this.SuspendLayout();
  152. //
  153. // ultraTabPageControl1
  154. //
  155. this.ultraTabPageControl1.Controls.Add(this.ultraGrid1);
  156. this.ultraTabPageControl1.Location = new System.Drawing.Point(2, 21);
  157. this.ultraTabPageControl1.Name = "ultraTabPageControl1";
  158. this.ultraTabPageControl1.Size = new System.Drawing.Size(900, 349);
  159. //
  160. // ultraGrid1
  161. //
  162. appearance1.TextHAlignAsString = "Left";
  163. this.ultraGrid1.DisplayLayout.CaptionAppearance = appearance1;
  164. appearance2.BackColor = System.Drawing.SystemColors.ActiveBorder;
  165. appearance2.BackColor2 = System.Drawing.SystemColors.ControlDark;
  166. appearance2.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical;
  167. appearance2.BorderColor = System.Drawing.SystemColors.Window;
  168. this.ultraGrid1.DisplayLayout.GroupByBox.Appearance = appearance2;
  169. appearance3.ForeColor = System.Drawing.SystemColors.GrayText;
  170. this.ultraGrid1.DisplayLayout.GroupByBox.BandLabelAppearance = appearance3;
  171. this.ultraGrid1.DisplayLayout.GroupByBox.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
  172. this.ultraGrid1.DisplayLayout.GroupByBox.Hidden = true;
  173. appearance4.BackColor = System.Drawing.SystemColors.ControlLightLight;
  174. appearance4.BackColor2 = System.Drawing.SystemColors.Control;
  175. appearance4.BackGradientStyle = Infragistics.Win.GradientStyle.Horizontal;
  176. appearance4.ForeColor = System.Drawing.SystemColors.GrayText;
  177. this.ultraGrid1.DisplayLayout.GroupByBox.PromptAppearance = appearance4;
  178. this.ultraGrid1.DisplayLayout.MaxColScrollRegions = 1;
  179. this.ultraGrid1.DisplayLayout.MaxRowScrollRegions = 1;
  180. appearance5.FontData.SizeInPoints = 10F;
  181. this.ultraGrid1.DisplayLayout.Override.CellAppearance = appearance5;
  182. this.ultraGrid1.DisplayLayout.Override.CellPadding = 0;
  183. appearance6.FontData.SizeInPoints = 9F;
  184. appearance6.TextHAlignAsString = "Center";
  185. this.ultraGrid1.DisplayLayout.Override.HeaderAppearance = appearance6;
  186. this.ultraGrid1.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti;
  187. this.ultraGrid1.DisplayLayout.Override.HeaderStyle = Infragistics.Win.HeaderStyle.Standard;
  188. this.ultraGrid1.DisplayLayout.Override.RowSelectorNumberStyle = Infragistics.Win.UltraWinGrid.RowSelectorNumberStyle.RowIndex;
  189. this.ultraGrid1.DisplayLayout.ScrollBounds = Infragistics.Win.UltraWinGrid.ScrollBounds.ScrollToFill;
  190. this.ultraGrid1.DisplayLayout.ScrollStyle = Infragistics.Win.UltraWinGrid.ScrollStyle.Immediate;
  191. this.ultraGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
  192. this.ultraGrid1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  193. this.ultraGrid1.Location = new System.Drawing.Point(0, 0);
  194. this.ultraGrid1.Name = "ultraGrid1";
  195. this.ultraGrid1.Size = new System.Drawing.Size(900, 349);
  196. this.ultraGrid1.TabIndex = 20;
  197. //
  198. // ultraTabPageControl2
  199. //
  200. this.ultraTabPageControl2.Controls.Add(this.ultraGrid2);
  201. this.ultraTabPageControl2.Location = new System.Drawing.Point(-10000, -10000);
  202. this.ultraTabPageControl2.Name = "ultraTabPageControl2";
  203. this.ultraTabPageControl2.Size = new System.Drawing.Size(900, 349);
  204. //
  205. // ultraGrid2
  206. //
  207. appearance7.TextHAlignAsString = "Left";
  208. this.ultraGrid2.DisplayLayout.CaptionAppearance = appearance7;
  209. appearance8.BackColor = System.Drawing.SystemColors.ActiveBorder;
  210. appearance8.BackColor2 = System.Drawing.SystemColors.ControlDark;
  211. appearance8.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical;
  212. appearance8.BorderColor = System.Drawing.SystemColors.Window;
  213. this.ultraGrid2.DisplayLayout.GroupByBox.Appearance = appearance8;
  214. appearance9.ForeColor = System.Drawing.SystemColors.GrayText;
  215. this.ultraGrid2.DisplayLayout.GroupByBox.BandLabelAppearance = appearance9;
  216. this.ultraGrid2.DisplayLayout.GroupByBox.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
  217. this.ultraGrid2.DisplayLayout.GroupByBox.Hidden = true;
  218. appearance10.BackColor = System.Drawing.SystemColors.ControlLightLight;
  219. appearance10.BackColor2 = System.Drawing.SystemColors.Control;
  220. appearance10.BackGradientStyle = Infragistics.Win.GradientStyle.Horizontal;
  221. appearance10.ForeColor = System.Drawing.SystemColors.GrayText;
  222. this.ultraGrid2.DisplayLayout.GroupByBox.PromptAppearance = appearance10;
  223. this.ultraGrid2.DisplayLayout.MaxColScrollRegions = 1;
  224. this.ultraGrid2.DisplayLayout.MaxRowScrollRegions = 1;
  225. appearance11.FontData.SizeInPoints = 10F;
  226. this.ultraGrid2.DisplayLayout.Override.CellAppearance = appearance11;
  227. this.ultraGrid2.DisplayLayout.Override.CellPadding = 0;
  228. appearance12.FontData.SizeInPoints = 9F;
  229. appearance12.TextHAlignAsString = "Center";
  230. this.ultraGrid2.DisplayLayout.Override.HeaderAppearance = appearance12;
  231. this.ultraGrid2.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti;
  232. this.ultraGrid2.DisplayLayout.Override.HeaderStyle = Infragistics.Win.HeaderStyle.Standard;
  233. this.ultraGrid2.DisplayLayout.Override.RowSelectorNumberStyle = Infragistics.Win.UltraWinGrid.RowSelectorNumberStyle.RowIndex;
  234. this.ultraGrid2.DisplayLayout.ScrollBounds = Infragistics.Win.UltraWinGrid.ScrollBounds.ScrollToFill;
  235. this.ultraGrid2.DisplayLayout.ScrollStyle = Infragistics.Win.UltraWinGrid.ScrollStyle.Immediate;
  236. this.ultraGrid2.Dock = System.Windows.Forms.DockStyle.Fill;
  237. this.ultraGrid2.Font = new System.Drawing.Font("宋体", 9F);
  238. this.ultraGrid2.Location = new System.Drawing.Point(0, 0);
  239. this.ultraGrid2.Name = "ultraGrid2";
  240. this.ultraGrid2.Size = new System.Drawing.Size(900, 349);
  241. this.ultraGrid2.TabIndex = 21;
  242. //
  243. // panel1
  244. //
  245. this.panel1.Controls.Add(this.ultraTabControl1);
  246. this.panel1.Controls.Add(this.ultraGroupBox1);
  247. this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
  248. this.panel1.Location = new System.Drawing.Point(0, 0);
  249. this.panel1.Name = "panel1";
  250. this.panel1.Size = new System.Drawing.Size(904, 437);
  251. this.panel1.TabIndex = 0;
  252. //
  253. // ultraTabControl1
  254. //
  255. appearance19.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(228)))), ((int)(((byte)(242)))));
  256. this.ultraTabControl1.Appearance = appearance19;
  257. this.ultraTabControl1.Controls.Add(this.ultraTabSharedControlsPage1);
  258. this.ultraTabControl1.Controls.Add(this.ultraTabPageControl1);
  259. this.ultraTabControl1.Controls.Add(this.ultraTabPageControl2);
  260. this.ultraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
  261. this.ultraTabControl1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  262. this.ultraTabControl1.Location = new System.Drawing.Point(0, 65);
  263. this.ultraTabControl1.MinTabWidth = 100;
  264. this.ultraTabControl1.Name = "ultraTabControl1";
  265. this.ultraTabControl1.SharedControlsPage = this.ultraTabSharedControlsPage1;
  266. this.ultraTabControl1.Size = new System.Drawing.Size(904, 372);
  267. this.ultraTabControl1.TabIndex = 5;
  268. ultraTab1.TabPage = this.ultraTabPageControl1;
  269. ultraTab1.Text = "金属料";
  270. ultraTab2.TabPage = this.ultraTabPageControl2;
  271. ultraTab2.Text = "辅料";
  272. this.ultraTabControl1.Tabs.AddRange(new Infragistics.Win.UltraWinTabControl.UltraTab[] {
  273. ultraTab1,
  274. ultraTab2});
  275. this.ultraTabControl1.ViewStyle = Infragistics.Win.UltraWinTabControl.ViewStyle.VisualStudio2005;
  276. this.ultraTabControl1.SelectedTabChanged += new Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventHandler(this.ultraTabControl1_SelectedTabChanged);
  277. //
  278. // ultraTabSharedControlsPage1
  279. //
  280. this.ultraTabSharedControlsPage1.Location = new System.Drawing.Point(-10000, -10000);
  281. this.ultraTabSharedControlsPage1.Name = "ultraTabSharedControlsPage1";
  282. this.ultraTabSharedControlsPage1.Size = new System.Drawing.Size(900, 349);
  283. //
  284. // ultraGroupBox1
  285. //
  286. this.ultraGroupBox1.Controls.Add(this.txtSteel);
  287. this.ultraGroupBox1.Controls.Add(this.label3);
  288. this.ultraGroupBox1.Controls.Add(this.label1);
  289. this.ultraGroupBox1.Controls.Add(this.ultraMaskedEdit2);
  290. this.ultraGroupBox1.Controls.Add(this.ultraMaskedEdit1);
  291. this.ultraGroupBox1.Controls.Add(this.uCkEditorForFilter);
  292. this.ultraGroupBox1.Controls.Add(this.cboGWID);
  293. this.ultraGroupBox1.Controls.Add(this.cboGW);
  294. this.ultraGroupBox1.Controls.Add(this.cboStaticode);
  295. this.ultraGroupBox1.Controls.Add(this.uldtEndTime);
  296. this.ultraGroupBox1.Controls.Add(this.uldtBeginTime);
  297. this.ultraGroupBox1.Controls.Add(this.chkSteel);
  298. this.ultraGroupBox1.Controls.Add(this.chk_Staticode);
  299. this.ultraGroupBox1.Controls.Add(this.checkBox3);
  300. this.ultraGroupBox1.Controls.Add(this.chk_HeaNo);
  301. this.ultraGroupBox1.Controls.Add(this.label6);
  302. this.ultraGroupBox1.Controls.Add(this.label2);
  303. this.ultraGroupBox1.Dock = System.Windows.Forms.DockStyle.Top;
  304. this.ultraGroupBox1.Location = new System.Drawing.Point(0, 0);
  305. this.ultraGroupBox1.Name = "ultraGroupBox1";
  306. this.ultraGroupBox1.Size = new System.Drawing.Size(904, 65);
  307. this.ultraGroupBox1.TabIndex = 4;
  308. //
  309. // label3
  310. //
  311. this.label3.AutoSize = true;
  312. this.label3.Location = new System.Drawing.Point(367, 15);
  313. this.label3.Name = "label3";
  314. this.label3.Size = new System.Drawing.Size(53, 12);
  315. this.label3.TabIndex = 296;
  316. this.label3.Text = " 岗 位";
  317. //
  318. // label1
  319. //
  320. this.label1.AutoSize = true;
  321. this.label1.Location = new System.Drawing.Point(21, 14);
  322. this.label1.Name = "label1";
  323. this.label1.Size = new System.Drawing.Size(41, 12);
  324. this.label1.TabIndex = 295;
  325. this.label1.Text = "时间从";
  326. //
  327. // ultraMaskedEdit2
  328. //
  329. this.ultraMaskedEdit2.Enabled = false;
  330. this.ultraMaskedEdit2.Location = new System.Drawing.Point(221, 37);
  331. this.ultraMaskedEdit2.MaxLength = 8;
  332. this.ultraMaskedEdit2.Name = "ultraMaskedEdit2";
  333. this.ultraMaskedEdit2.Size = new System.Drawing.Size(128, 21);
  334. this.ultraMaskedEdit2.TabIndex = 294;
  335. //
  336. // ultraMaskedEdit1
  337. //
  338. this.ultraMaskedEdit1.Enabled = false;
  339. this.ultraMaskedEdit1.Location = new System.Drawing.Point(91, 38);
  340. this.ultraMaskedEdit1.MaxLength = 8;
  341. this.ultraMaskedEdit1.Name = "ultraMaskedEdit1";
  342. this.ultraMaskedEdit1.Size = new System.Drawing.Size(104, 21);
  343. this.ultraMaskedEdit1.TabIndex = 293;
  344. //
  345. // uCkEditorForFilter
  346. //
  347. appearance13.BackColor = System.Drawing.Color.LimeGreen;
  348. appearance13.TextVAlignAsString = "Middle";
  349. this.uCkEditorForFilter.Appearance = appearance13;
  350. this.uCkEditorForFilter.BackColor = System.Drawing.Color.LimeGreen;
  351. this.uCkEditorForFilter.BackColorInternal = System.Drawing.Color.Transparent;
  352. this.uCkEditorForFilter.Location = new System.Drawing.Point(830, 7);
  353. this.uCkEditorForFilter.Name = "uCkEditorForFilter";
  354. this.uCkEditorForFilter.Size = new System.Drawing.Size(46, 20);
  355. this.uCkEditorForFilter.TabIndex = 292;
  356. this.uCkEditorForFilter.Text = "过滤";
  357. this.uCkEditorForFilter.Visible = false;
  358. this.uCkEditorForFilter.CheckedChanged += new System.EventHandler(this.uCkEditorForFilter_CheckedChanged);
  359. //
  360. // cboGWID
  361. //
  362. appearance14.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel;
  363. appearance14.BorderColor = System.Drawing.Color.Black;
  364. this.cboGWID.Appearance = appearance14;
  365. this.cboGWID.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
  366. this.cboGWID.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
  367. this.cboGWID.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  368. this.cboGWID.Location = new System.Drawing.Point(502, 11);
  369. this.cboGWID.Name = "cboGWID";
  370. this.cboGWID.Size = new System.Drawing.Size(146, 19);
  371. this.cboGWID.TabIndex = 285;
  372. this.cboGWID.UseFlatMode = Infragistics.Win.DefaultableBoolean.True;
  373. //
  374. // cboGW
  375. //
  376. appearance15.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel;
  377. appearance15.BorderColor = System.Drawing.Color.Black;
  378. this.cboGW.Appearance = appearance15;
  379. this.cboGW.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
  380. this.cboGW.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
  381. this.cboGW.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  382. valueListItem1.DataValue = "0";
  383. valueListItem1.DisplayText = "转炉";
  384. valueListItem2.DataValue = "1";
  385. valueListItem2.DisplayText = "吹氩站";
  386. valueListItem3.DataValue = "2";
  387. valueListItem3.DisplayText = "精炼炉";
  388. valueListItem12.DataValue = "6";
  389. valueListItem12.DisplayText = "连铸";
  390. this.cboGW.Items.AddRange(new Infragistics.Win.ValueListItem[] {
  391. valueListItem1,
  392. valueListItem2,
  393. valueListItem3,
  394. valueListItem12});
  395. this.cboGW.Location = new System.Drawing.Point(425, 10);
  396. this.cboGW.Name = "cboGW";
  397. this.cboGW.Size = new System.Drawing.Size(65, 19);
  398. this.cboGW.TabIndex = 284;
  399. this.cboGW.UseFlatMode = Infragistics.Win.DefaultableBoolean.True;
  400. this.cboGW.SelectionChanged += new System.EventHandler(this.cboGW_SelectionChanged);
  401. //
  402. // cboStaticode
  403. //
  404. appearance16.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel;
  405. appearance16.BorderColor = System.Drawing.Color.Black;
  406. this.cboStaticode.Appearance = appearance16;
  407. this.cboStaticode.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
  408. this.cboStaticode.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
  409. this.cboStaticode.Enabled = false;
  410. this.cboStaticode.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  411. valueListItem5.DataValue = "0";
  412. valueListItem5.DisplayText = "全部";
  413. valueListItem6.DataValue = "1";
  414. valueListItem6.DisplayText = "甲班";
  415. valueListItem7.DataValue = "2";
  416. valueListItem7.DisplayText = "乙班";
  417. valueListItem8.DataValue = "3";
  418. valueListItem8.DisplayText = "丙班";
  419. valueListItem9.DataValue = "4";
  420. valueListItem9.DisplayText = "丁班";
  421. this.cboStaticode.Items.AddRange(new Infragistics.Win.ValueListItem[] {
  422. valueListItem5,
  423. valueListItem6,
  424. valueListItem7,
  425. valueListItem8,
  426. valueListItem9});
  427. this.cboStaticode.Location = new System.Drawing.Point(725, 10);
  428. this.cboStaticode.Name = "cboStaticode";
  429. this.cboStaticode.Size = new System.Drawing.Size(65, 19);
  430. this.cboStaticode.TabIndex = 283;
  431. this.cboStaticode.UseFlatMode = Infragistics.Win.DefaultableBoolean.True;
  432. //
  433. // uldtEndTime
  434. //
  435. this.uldtEndTime.DateTime = new System.DateTime(2008, 11, 24, 0, 0, 0, 0);
  436. this.uldtEndTime.FormatProvider = new System.Globalization.CultureInfo("en-US");
  437. this.uldtEndTime.FormatString = "";
  438. this.uldtEndTime.Location = new System.Drawing.Point(221, 11);
  439. this.uldtEndTime.MaskInput = "yyyy-mm-dd hh:mm";
  440. this.uldtEndTime.Name = "uldtEndTime";
  441. this.uldtEndTime.Size = new System.Drawing.Size(128, 21);
  442. this.uldtEndTime.TabIndex = 282;
  443. this.uldtEndTime.Value = new System.DateTime(2008, 11, 24, 0, 0, 0, 0);
  444. //
  445. // uldtBeginTime
  446. //
  447. this.uldtBeginTime.DateTime = new System.DateTime(2008, 11, 24, 0, 0, 0, 0);
  448. this.uldtBeginTime.FormatProvider = new System.Globalization.CultureInfo("en-US");
  449. this.uldtBeginTime.FormatString = "";
  450. this.uldtBeginTime.Location = new System.Drawing.Point(68, 11);
  451. this.uldtBeginTime.MaskInput = "yyyy-mm-dd hh:mm";
  452. this.uldtBeginTime.Name = "uldtBeginTime";
  453. this.uldtBeginTime.Size = new System.Drawing.Size(128, 21);
  454. this.uldtBeginTime.TabIndex = 281;
  455. this.uldtBeginTime.Value = new System.DateTime(2008, 11, 24, 0, 0, 0, 0);
  456. //
  457. // txtSteel
  458. //
  459. this.txtSteel.Enabled = false;
  460. this.txtSteel.Location = new System.Drawing.Point(425, 35);
  461. this.txtSteel.MaxLength = 50;
  462. this.txtSteel.Name = "txtSteel";
  463. this.txtSteel.Size = new System.Drawing.Size(223, 21);
  464. this.txtSteel.TabIndex = 88;
  465. //
  466. // chkSteel
  467. //
  468. this.chkSteel.Font = new System.Drawing.Font("宋体", 9F);
  469. this.chkSteel.Location = new System.Drawing.Point(370, 34);
  470. this.chkSteel.Name = "chkSteel";
  471. this.chkSteel.Size = new System.Drawing.Size(66, 24);
  472. this.chkSteel.TabIndex = 87;
  473. this.chkSteel.Text = "牌 号";
  474. this.chkSteel.CheckedChanged += new System.EventHandler(this.chkSteel_CheckedChanged);
  475. //
  476. // chk_Staticode
  477. //
  478. this.chk_Staticode.Font = new System.Drawing.Font("宋体", 9F);
  479. this.chk_Staticode.Location = new System.Drawing.Point(664, 8);
  480. this.chk_Staticode.Name = "chk_Staticode";
  481. this.chk_Staticode.Size = new System.Drawing.Size(60, 24);
  482. this.chk_Staticode.TabIndex = 63;
  483. this.chk_Staticode.Text = " 班 组";
  484. this.chk_Staticode.CheckedChanged += new System.EventHandler(this.chk_Staticode_CheckedChanged);
  485. //
  486. // checkBox3
  487. //
  488. this.checkBox3.Enabled = false;
  489. this.checkBox3.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  490. this.checkBox3.Location = new System.Drawing.Point(852, 42);
  491. this.checkBox3.Name = "checkBox3";
  492. this.checkBox3.Size = new System.Drawing.Size(82, 24);
  493. this.checkBox3.TabIndex = 62;
  494. this.checkBox3.Text = "工序位置";
  495. this.checkBox3.Visible = false;
  496. this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged);
  497. //
  498. // chk_HeaNo
  499. //
  500. this.chk_HeaNo.Font = new System.Drawing.Font("宋体", 9F);
  501. this.chk_HeaNo.Location = new System.Drawing.Point(12, 35);
  502. this.chk_HeaNo.Name = "chk_HeaNo";
  503. this.chk_HeaNo.Size = new System.Drawing.Size(73, 24);
  504. this.chk_HeaNo.TabIndex = 60;
  505. this.chk_HeaNo.Text = "熔炼号从";
  506. this.chk_HeaNo.CheckedChanged += new System.EventHandler(this.chk_HeaNo_CheckedChanged);
  507. //
  508. // label6
  509. //
  510. this.label6.AutoSize = true;
  511. this.label6.Font = new System.Drawing.Font("宋体", 9F);
  512. this.label6.Location = new System.Drawing.Point(201, 14);
  513. this.label6.Name = "label6";
  514. this.label6.Size = new System.Drawing.Size(17, 12);
  515. this.label6.TabIndex = 59;
  516. this.label6.Text = "到";
  517. //
  518. // label2
  519. //
  520. this.label2.AutoSize = true;
  521. this.label2.Font = new System.Drawing.Font("宋体", 9F);
  522. this.label2.Location = new System.Drawing.Point(201, 42);
  523. this.label2.Name = "label2";
  524. this.label2.Size = new System.Drawing.Size(17, 12);
  525. this.label2.TabIndex = 50;
  526. this.label2.Text = "到";
  527. //
  528. // frmAdditStat
  529. //
  530. this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
  531. this.ClientSize = new System.Drawing.Size(904, 437);
  532. this.Controls.Add(this.panel1);
  533. this.Name = "frmAdditStat";
  534. this.Text = "物料消耗查询";
  535. this.Load += new System.EventHandler(this.frmAdditStat_Load);
  536. this.ultraTabPageControl1.ResumeLayout(false);
  537. ((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).EndInit();
  538. this.ultraTabPageControl2.ResumeLayout(false);
  539. ((System.ComponentModel.ISupportInitialize)(this.ultraGrid2)).EndInit();
  540. this.panel1.ResumeLayout(false);
  541. ((System.ComponentModel.ISupportInitialize)(this.ultraTabControl1)).EndInit();
  542. this.ultraTabControl1.ResumeLayout(false);
  543. ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).EndInit();
  544. this.ultraGroupBox1.ResumeLayout(false);
  545. this.ultraGroupBox1.PerformLayout();
  546. ((System.ComponentModel.ISupportInitialize)(this.uCkEditorForFilter)).EndInit();
  547. ((System.ComponentModel.ISupportInitialize)(this.cboGWID)).EndInit();
  548. ((System.ComponentModel.ISupportInitialize)(this.cboGW)).EndInit();
  549. ((System.ComponentModel.ISupportInitialize)(this.cboStaticode)).EndInit();
  550. ((System.ComponentModel.ISupportInitialize)(this.uldtEndTime)).EndInit();
  551. ((System.ComponentModel.ISupportInitialize)(this.uldtBeginTime)).EndInit();
  552. this.ResumeLayout(false);
  553. }
  554. #endregion
  555. #endregion
  556. private DataSet _dsHj = new DataSet();
  557. private DataSet _dsPL = new DataSet();
  558. private DataSet _dsFl = new DataSet();
  559. private Hashtable tabSteel = new Hashtable();
  560. public string _strWhere = " where to_char(jobtime, 'yyyy-MM-dd') = to_char(sysdate, 'yyyy-MM-dd')";
  561. public string _strCob1 = "";
  562. public string _strCob2 = "";
  563. private DataSet _dsGridInfo = new DataSet();
  564. private void frmAdditStat_Load(object sender, System.EventArgs e)
  565. {
  566. this.uldtBeginTime.Text = System.DateTime.Today.ToString("yyyy-MM-dd") + " 00:00:00";
  567. this.uldtEndTime.Text = System.DateTime.Today.ToString("yyyy-MM-dd") + " 23:59:59";
  568. initGW();
  569. initBZ();
  570. InitSteel();
  571. //GetGridInfo();
  572. }
  573. // 初始化Grind牌号
  574. /// <summary>
  575. /// 初始化Grind牌号
  576. /// </summary>
  577. private void InitSteel()
  578. {
  579. try
  580. {
  581. string strErr = "";
  582. ultraGrid1.DisplayLayout.ValueLists.Add("SteelCode");
  583. ultraGrid2.DisplayLayout.ValueLists.Add("SteelCode1");
  584. ArrayList arry = new ArrayList();
  585. arry.Add("ElementsSteel.Query");//此ID为XML文件ID
  586. CommonClientToServer cctos = new CommonClientToServer();
  587. cctos.ob = this.ob;
  588. DataSet dsSteel = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery",
  589. "doSimpleQuery", arry, out strErr);
  590. if (strErr == "" && dsSteel != null)
  591. {
  592. //初始经Grid牌号字段数据集
  593. for (int i = 0; i < dsSteel.Tables[0].Rows.Count; i++)
  594. {
  595. // ultraGrid1.DisplayLayout.ValueLists["SteelCode"].ValueListItems.Add(dsSteel.Tables[0].Rows[i]["SteelCode"].ToString(), dsSteel.Tables[0].Rows[i]["Steel"].ToString());
  596. // ultraGrid2.DisplayLayout.ValueLists["SteelCode1"].ValueListItems.Add(dsSteel.Tables[0].Rows[i]["SteelCode"].ToString(), dsSteel.Tables[0].Rows[i]["Steel"].ToString());
  597. tabSteel.Add(dsSteel.Tables[0].Rows[i]["SteelCode"].ToString(), dsSteel.Tables[0].Rows[i]["Steel"].ToString());
  598. }
  599. //绑定单位
  600. //ultraGrid1.DisplayLayout.Bands[0].Columns["STEEL"].ValueList = ultraGrid1.DisplayLayout.ValueLists["SteelCode"];
  601. //ultraGrid2.DisplayLayout.Bands[0].Columns["STEEL"].ValueList = ultraGrid2.DisplayLayout.ValueLists["SteelCode1"];
  602. }
  603. }
  604. catch { }
  605. }
  606. // 金属料初始化
  607. /// <summary>
  608. /// 金属料初始化
  609. /// </summary>
  610. private void InitData1()
  611. {
  612. try
  613. {
  614. UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[0];
  615. band.Columns[0].Header.Caption = "加热处理号";
  616. band.Columns[0].Width = 80;
  617. band.Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  618. band.Columns[0].Hidden = true;
  619. band.Columns[1].Header.Caption = "熔炼号";
  620. band.Columns[1].Width = 100;
  621. band.Columns[1].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
  622. band.Columns[2].Header.Caption = "牌号";
  623. band.Columns[2].Width = 100;
  624. band.Columns[2].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  625. band.Columns[3].Header.Caption = "设备号";
  626. band.Columns[3].Width = 60;
  627. band.Columns[3].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  628. //band.Columns[2].Hidden = true;
  629. band.Columns[4].Header.Caption = "班组";
  630. band.Columns[4].Width = 60;
  631. band.Columns[4].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  632. //band.Columns[2].Hidden = true;
  633. int intIronWsteel = 0;
  634. if (cboGW.Text == "转炉" && this.ultraTabControl1.Tabs[0].Selected == true)
  635. {
  636. band.Columns[5].Header.Caption = "铁水";
  637. band.Columns[5].Width = 60;
  638. band.Columns[5].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  639. band.Columns[6].Header.Caption = "生铁";
  640. band.Columns[6].Width = 60;
  641. band.Columns[6].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  642. band.Columns[7].Header.Caption = "废钢";
  643. band.Columns[7].Width = 60;
  644. band.Columns[7].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  645. intIronWsteel = 3;
  646. }
  647. string strSel = "";
  648. if (this.checkBox3.Checked)
  649. strSel = string.Format("MATERIELTYPE='HJ'"); ///, "BOF0" + Convert.ToString(this.cboGWID.SelectedIndex + 1));
  650. else
  651. strSel = "MATERIELTYPE='HJ'";
  652. DataRow[] drs = _dsGridInfo.Tables[0].Select(strSel);//, "wlbm ASC");
  653. int count = drs.Length;
  654. for (int i = 0; i < count; i++)
  655. {
  656. DataRow dr = drs[i];
  657. band.Columns[5 + intIronWsteel + i].Header.Caption = dr["materielforshort"].ToString();
  658. band.Columns[5 + intIronWsteel + i].Width = 70;
  659. band.Columns[5 + intIronWsteel + i].CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right;
  660. band.Columns[5 + intIronWsteel + i].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  661. band.Columns[5 + intIronWsteel + i].Format = "#########.00";
  662. }
  663. this.ultraGrid1.DisplayLayout.Override.RowSelectorNumberStyle = RowSelectorNumberStyle.RowIndex;
  664. if (band.Summaries.Count > 0 && band.Summaries.Count == count) return;
  665. band.Summaries.Clear();
  666. SummarySettings summary = band.Summaries.Add(SummaryType.Count, band.Columns[1]);
  667. summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn;
  668. summary.DisplayFormat = "合计:";
  669. summary = band.Summaries.Add(SummaryType.Count, band.Columns[1]);
  670. summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn;
  671. summary.DisplayFormat = "平均:";
  672. for (int i = 5; i < 5 + count + intIronWsteel; i++)
  673. {
  674. summary = band.Summaries.Add(SummaryType.Sum, band.Columns[i]);
  675. summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn;
  676. if (i > 4)
  677. summary.DisplayFormat = " {0:#####}";
  678. else
  679. summary.DisplayFormat = " {0:#####.000}";
  680. summary.Appearance.TextHAlign = HAlign.Right;
  681. summary.Appearance.ForeColor = Color.DarkBlue;
  682. summary.Appearance.BackColor = Color.White;
  683. summary = band.Summaries.Add(SummaryType.Average, band.Columns[i]);
  684. summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn;
  685. if (i > 4)
  686. summary.DisplayFormat = " {0:#####}";
  687. else
  688. summary.DisplayFormat = " {0:#####.000}";
  689. summary.Appearance.TextHAlign = HAlign.Right;
  690. summary.Appearance.ForeColor = Color.DarkBlue;
  691. summary.Appearance.BackColor = Color.White;
  692. }
  693. band.Override.SummaryFooterCaptionVisible = DefaultableBoolean.False;
  694. }
  695. catch
  696. { }
  697. }
  698. // 散装料初始化
  699. /// <summary>
  700. /// 散装料初始化
  701. /// </summary>
  702. private void InitData2()
  703. {
  704. try
  705. {
  706. UltraGridBand band = this.ultraGrid2.DisplayLayout.Bands[0];
  707. band.Columns[0].Header.Caption = "加热处理号";
  708. band.Columns[0].Width = 80;
  709. band.Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  710. band.Columns[0].Hidden = true;
  711. band.Columns[1].Header.Caption = "熔炼号";
  712. band.Columns[1].Width = 100;
  713. band.Columns[1].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  714. band.Columns[2].Header.Caption = "牌号";
  715. band.Columns[2].Width = 100;
  716. band.Columns[2].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  717. band.Columns[3].Header.Caption = "设备号";
  718. band.Columns[3].Width = 60;
  719. band.Columns[3].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  720. //band.Columns[2].Hidden = true;
  721. band.Columns[4].Header.Caption = "班组";
  722. band.Columns[4].Width = 60;
  723. band.Columns[4].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  724. //band.Columns[2].Hidden = true;
  725. string strSel = "";
  726. if (this.checkBox3.Checked)
  727. strSel = "MATERIELTYPE='FL'";
  728. else
  729. strSel = "MATERIELTYPE='FL'";
  730. DataRow[] drs = _dsGridInfo.Tables[0].Select(strSel);
  731. int count = drs.Length;
  732. for (int i = 0; i < count; i++)
  733. {
  734. DataRow dr = drs[i];
  735. band.Columns[5 + i].Header.Caption = dr["materielforshort"].ToString();
  736. band.Columns[5 + i].Width = 85;
  737. band.Columns[5 + i].CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right;
  738. band.Columns[5 + i].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  739. band.Columns[5 + i].Format = "#########.00";
  740. }
  741. this.ultraGrid2.DisplayLayout.Override.RowSelectorNumberStyle = RowSelectorNumberStyle.RowIndex;
  742. if (band.Summaries.Count > 0 && band.Summaries.Count == count) return;
  743. band.Summaries.Clear();
  744. SummarySettings summary = band.Summaries.Add(SummaryType.Count, band.Columns[1]);
  745. summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn;
  746. summary.DisplayFormat = "合计:";
  747. summary = band.Summaries.Add(SummaryType.Count, band.Columns[1]);
  748. summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn;
  749. summary.DisplayFormat = "平均:";
  750. for (int i = 5; i < 5 + count; i++)
  751. {
  752. summary = band.Summaries.Add(SummaryType.Sum, band.Columns[i]);
  753. summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn;
  754. if (i > 4)
  755. summary.DisplayFormat = " {0:#####}";
  756. else
  757. summary.DisplayFormat = " {0:#####.000}";
  758. summary.Appearance.TextHAlign = HAlign.Right;
  759. summary.Appearance.ForeColor = Color.DarkBlue;
  760. summary.Appearance.BackColor = Color.White;
  761. summary = band.Summaries.Add(SummaryType.Average, band.Columns[i]);
  762. summary.SummaryPosition = SummaryPosition.UseSummaryPositionColumn;
  763. if (i > 4)
  764. summary.DisplayFormat = " {0:#####}";
  765. else
  766. summary.DisplayFormat = " {0:#####.000}";
  767. summary.Appearance.TextHAlign = HAlign.Right;
  768. summary.Appearance.ForeColor = Color.DarkBlue;
  769. summary.Appearance.BackColor = Color.White;
  770. }
  771. band.Override.SummaryFooterCaptionVisible = DefaultableBoolean.False;
  772. }
  773. catch
  774. { }
  775. }
  776. // 初始化工位
  777. /// <summary>
  778. /// 初始化工位
  779. /// </summary>
  780. private void initGW()
  781. {
  782. cboGW.Items.Clear();
  783. //cboGW.Items.Add("SYGW", "所有工位");
  784. cboGW.Items.Add("HMP0", "脱硫站");
  785. cboGW.Items.Add("BOF0", "转炉");
  786. cboGW.Items.Add("CAS0", "吹氩站");
  787. cboGW.Items.Add("LFS0", "精炼炉");
  788. // cboGW.Items.Add("CCM0", "连铸机");
  789. cboGW.SelectedIndex = 0;
  790. }
  791. // 初始化班组
  792. /// <summary>
  793. /// 初始化班组
  794. /// </summary>
  795. private void initBZ()
  796. {
  797. cboStaticode.Items.Clear();
  798. cboStaticode.Items.Add("0", "所有");
  799. cboStaticode.Items.Add("1", "甲");
  800. cboStaticode.Items.Add("2", "乙");
  801. cboStaticode.Items.Add("3", "丙");
  802. cboStaticode.Items.Add("4", "丁");
  803. cboStaticode.SelectedIndex = 0;
  804. }
  805. #region " Control Events " 条件选择
  806. //private void ultraGrid2_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
  807. //{
  808. // UltraGridBand band = this.ultraGrid2.DisplayLayout.Bands[0];
  809. // if (this.ultraGrid2.Rows.Count < 1) return;
  810. // try
  811. // {
  812. // DateTime dtForeTime = Convert.ToDateTime(this.ultraGrid2.Rows[0].Cells[18].Value);
  813. // DateTime dtCurrTime = dtForeTime;
  814. // TimeSpan ts = new TimeSpan();
  815. // for (int i = 1; i < this.ultraGrid2.Rows.Count; i++)
  816. // {
  817. // dtCurrTime = Convert.ToDateTime(this.ultraGrid2.Rows[i].Cells[18].Value);
  818. // ts = dtCurrTime - dtForeTime;
  819. // if (ts.Minutes > 99 || ts.Minutes < 0)
  820. // this.ultraGrid2.Rows[i].Cells[20].Value = 0;
  821. // else
  822. // this.ultraGrid2.Rows[i].Cells[20].Value = ts.Minutes;
  823. // dtForeTime = dtCurrTime;
  824. // }
  825. // }
  826. // catch { }
  827. //}
  828. private void chk_HeaNo_CheckedChanged(object sender, EventArgs e)
  829. {
  830. this.ultraMaskedEdit1.Enabled = this.chk_HeaNo.Checked;
  831. this.ultraMaskedEdit2.Enabled = this.chk_HeaNo.Checked;
  832. if (!this.ultraMaskedEdit1.Enabled)
  833. {
  834. ultraMaskedEdit1.BackColor = Color.WhiteSmoke;
  835. }
  836. if (!this.ultraMaskedEdit2.Enabled)
  837. {
  838. ultraMaskedEdit2.BackColor = Color.WhiteSmoke;
  839. }
  840. }
  841. private void checkBox3_CheckedChanged(object sender, System.EventArgs e)
  842. {
  843. this.cboGWID.Enabled = this.checkBox3.Checked;
  844. this.cboGW.Enabled = this.checkBox3.Checked;
  845. }
  846. private void chk_Staticode_CheckedChanged(object sender, System.EventArgs e)
  847. {
  848. this.cboStaticode.Enabled = this.chk_Staticode.Checked;
  849. }
  850. #endregion
  851. //初始化物料信息列名
  852. /// <summary>
  853. /// 初始化物料信息列名
  854. /// </summary>
  855. private void GetGridInfo()
  856. {
  857. try
  858. {
  859. string strErr = "";
  860. string addTalbeName = "";
  861. string strWhere = "";
  862. string strgw = cboGW.Value.ToString();
  863. if (cboGW.SelectedIndex == -1)
  864. {
  865. strgw = "BOF0";
  866. }
  867. string strStartTime = "";
  868. string strEndTime = "";
  869. string strMType = "";
  870. string resTalbeName = TableName(strgw, out addTalbeName);
  871. if (Convert.ToDateTime(uldtBeginTime.Value) > Convert.ToDateTime(uldtEndTime.Value))
  872. {
  873. MessageBox.Show("时间条件的开始时间不能大于结束时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  874. return;
  875. }
  876. else
  877. {
  878. strStartTime = this.uldtBeginTime.DateTime.ToString("yyyy-MM-dd");
  879. strEndTime = this.uldtEndTime.DateTime.ToString("yyyy-MM-dd");
  880. }
  881. if (cboGWID.Value.ToString() != "0" ) //岗位
  882. strWhere += " and a.stationcode='" + addTalbeName + "0" + cboGWID.Value.ToString() + "'";
  883. else
  884. strWhere += " and a.stationcode like '" + addTalbeName + "%'";
  885. if (this.ultraTabControl1.Tabs[0].Selected == true)
  886. strMType = "HJ";
  887. else
  888. strMType = "FL";
  889. //定义一个ArrayList集合存储变量[参数]值
  890. string NowTime = DateTime.Now.ToString("yyyy-MM-dd");
  891. ArrayList arry = new ArrayList();
  892. arry.Add("frmAdditStat_Load.select");//此ID为XML文件ID
  893. arry.Add(strMType);
  894. arry.Add(strStartTime == "" ? NowTime : strStartTime);
  895. arry.Add(strEndTime == "" ? NowTime : strEndTime);
  896. CommonClientToServer cctos = new CommonClientToServer();
  897. cctos.ob = this.ob;
  898. DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery",
  899. "doSimpleQuery", arry, out strErr);
  900. _dsGridInfo = ds;
  901. }
  902. catch (Exception ex)
  903. {
  904. Console.WriteLine(ex.Message);
  905. }
  906. }
  907. // 获取物料信息
  908. /// <summary>
  909. /// 获取物料信息
  910. /// </summary>
  911. private void GetAdditStat()
  912. {
  913. string sqlstr;
  914. string addTalbeName = "";
  915. if (cboGW.Value == null) return;
  916. string strGw = cboGW.Value.ToString();
  917. string strGWID = cboGWID.Value.ToString();
  918. if (chk_HeaNo.Checked)
  919. {
  920. if (ultraMaskedEdit1.Text.Length == 0 && ultraMaskedEdit2.Text.Length == 0)
  921. {
  922. MessageBox.Show("炉号不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  923. ultraMaskedEdit1.Focus();
  924. return;
  925. }
  926. }
  927. if (chk_Staticode.Checked)
  928. {
  929. if (cboStaticode.SelectedIndex == -1)
  930. {
  931. MessageBox.Show("班组不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  932. cboStaticode.Focus();
  933. return;
  934. }
  935. }
  936. if (chkSteel.Checked)
  937. {
  938. if (txtSteel.Text.Length == 0)
  939. {
  940. MessageBox.Show("牌号不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  941. txtSteel.Focus();
  942. return;
  943. }
  944. }
  945. GetGridInfo(); //初始化物料信息列名
  946. if (this.ultraTabControl1.Tabs[0].Selected == true)
  947. sqlstr = BuildSql(strGWID, "HJ");
  948. else
  949. sqlstr = BuildSql(strGWID, "FL");
  950. try
  951. {
  952. string resTalbeName = TableName(strGw, out addTalbeName);
  953. string strIronWSteel = "";
  954. if (addTalbeName == "C")
  955. strIronWSteel = " ,IRONPOTWGT,PIGIRONWGT,WSTEELWGT ";
  956. string strWhereB = "";
  957. if (addTalbeName == "B")
  958. strWhereB = " where a.heatno =b.heatno and '" + addTalbeName + "'|| a.EQUIPMENTNO = b.stationcode ";
  959. else
  960. strWhereB = " where a.heatno =b.heatno and '" + addTalbeName + "'|| a.stationcode = b.stationcode and a.disposaltime = b.disposaltime ";
  961. //定义一个ArrayList集合存储变量[参数]值
  962. ArrayList arry = new ArrayList();
  963. ArrayList sqlList = new ArrayList();
  964. arry.Add("frmAdditStat_Query.select");//此ID为XML文件ID
  965. sqlList.Add(strIronWSteel);
  966. sqlList.Add(strIronWSteel);
  967. sqlList.Add(resTalbeName);
  968. sqlList.Add(resTalbeName);
  969. sqlList.Add(strWhereB);
  970. sqlList.Add(sqlstr);
  971. //调用服务端方法
  972. CoreClientParam CCP_AStat = new CoreClientParam();
  973. DataTable dt = new DataTable();
  974. CCP_AStat.ServerName = "Core.LgMes.Server.Common.ComDBQuery";
  975. CCP_AStat.MethodName = "doQuery";
  976. CCP_AStat.ServerParams = new object[] { arry, sqlList };
  977. CCP_AStat.SourceDataTable = dt;
  978. this.ExecuteSortResultByQueryToDataTable(CCP_AStat, CoreInvokeType.Internal);
  979. DataTable dtHj = new DataTable();
  980. DataTable dtFl = new DataTable();
  981. _dsPL.Tables.Clear();
  982. _dsHj.Tables.Clear();
  983. if (dt.Rows.Count > 0)
  984. {
  985. if (this.ultraTabControl1.Tabs[0].Selected == true)
  986. {
  987. _dsHj.Tables.Add(dt);
  988. dtHj = FormatData(_dsHj, "HJ");
  989. this.ultraGrid1.DataSource = dtHj;
  990. InitData1();
  991. PublicMethod.RefreshAndAutoSize(ultraGrid1);
  992. }
  993. else
  994. {
  995. _dsPL.Tables.Add(dt);
  996. dtFl = FormatData(_dsPL, "FL");
  997. this.ultraGrid2.DataSource = dtFl;
  998. InitData2();
  999. PublicMethod.RefreshAndAutoSize(ultraGrid2);
  1000. }
  1001. }
  1002. else
  1003. {
  1004. ultraGrid1.DataSource = null;
  1005. ultraGrid2.DataSource = null;
  1006. dtHj.Clear();
  1007. dtFl.Clear();
  1008. }
  1009. }
  1010. catch (Exception ex)
  1011. {
  1012. Console.WriteLine(ex.Message);
  1013. }
  1014. }
  1015. // 将获取的数据序列化
  1016. /// <summary>
  1017. /// 将获取的数据序列化
  1018. /// </summary>
  1019. /// <param name="_dsFl"></param>
  1020. /// <returns></returns>
  1021. private DataTable FormatData(DataSet _dsFl, string Type)
  1022. {
  1023. DataTable dtFl = new DataTable();
  1024. dtFl.Columns.Add("heatprocessno");
  1025. dtFl.Columns.Add("heatno");
  1026. dtFl.Columns.Add("STEEL");
  1027. dtFl.Columns.Add("STATIONCODE");
  1028. dtFl.Columns.Add("SHIFTCODE");
  1029. if (cboGW.Text == "转炉" && Type == "HJ")
  1030. {
  1031. dtFl.Columns.Add("IRONPOTWGT"); //铁水
  1032. dtFl.Columns.Add("PIGIRONWGT"); //生铁
  1033. dtFl.Columns.Add("WSTEELWGT"); //废钢
  1034. }
  1035. string strSel = "";
  1036. strSel = "MATERIELTYPE='" + Type + "'";
  1037. DataRow[] drs = _dsGridInfo.Tables[0].Select(strSel);
  1038. int count = drs.Length;
  1039. for (int i = 0; i < count; i++)
  1040. {
  1041. DataRow dr = drs[i];
  1042. dtFl.Columns.Add(dr[2].ToString());
  1043. }
  1044. dtFl.Columns.Add("OPTDATE");
  1045. dtFl.Columns["OPTDATE"].Caption = "操作时间";
  1046. bool bolIs = false;
  1047. foreach (DataRow drfl in _dsFl.Tables[0].Rows)
  1048. {
  1049. foreach (DataRow Isdrfl in dtFl.Rows)
  1050. {
  1051. if (drfl["heatprocessno"].ToString() == Isdrfl["heatprocessno"].ToString())
  1052. {
  1053. bolIs = true;
  1054. break;
  1055. }
  1056. }
  1057. if (!bolIs)
  1058. {
  1059. DataRow drFL = dtFl.NewRow();
  1060. drFL["heatprocessno"] = drfl["heatprocessno"].ToString();
  1061. drFL["heatno"] = drfl["heatno"].ToString();
  1062. drFL["STEEL"] = tabSteel[drfl["STEEL"].ToString()].ToString();
  1063. drFL["STATIONCODE"] = drfl["WSID"].ToString() + GetGW(drfl["STATIONCODE"].ToString());
  1064. drFL["OPTDATE"] = Convert.ToDateTime(drfl["OPTDATE"].ToString()).ToString("yyyy-MM-dd HH:mm:ss");
  1065. if (drfl["SHIFTCODE"].ToString().Length > 1)
  1066. {
  1067. drFL["SHIFTCODE"] = GetBZ(drfl["SHIFTCODE"].ToString().Substring(1, 1));
  1068. }
  1069. else
  1070. {
  1071. drFL["SHIFTCODE"] = "未知";
  1072. }
  1073. if (cboGW.Text == "转炉" && Type == "HJ")
  1074. {
  1075. drFL["IRONPOTWGT"] = drfl["IRONPOTWGT"].ToString();//铁水
  1076. drFL["PIGIRONWGT"] = drfl["PIGIRONWGT"].ToString();//废钢
  1077. drFL["WSTEELWGT"] = drfl["WSTEELWGT"].ToString();//废钢
  1078. }
  1079. foreach (DataColumn dcfl in dtFl.Columns)
  1080. {
  1081. if (dcfl.ColumnName.ToString() == drfl["MATERIELNAME"].ToString())
  1082. {
  1083. drFL[dcfl.ColumnName.ToString()] = drfl["JMWGT"].ToString();
  1084. }
  1085. }
  1086. dtFl.Rows.Add(drFL);
  1087. bolIs = false;
  1088. }
  1089. else
  1090. {
  1091. foreach (DataRow drFlvalue in dtFl.Rows)
  1092. {
  1093. if (drFlvalue["heatprocessno"].ToString() == drfl["heatprocessno"].ToString())
  1094. {
  1095. foreach (DataColumn dcfl in dtFl.Columns)
  1096. {
  1097. if (dcfl.ColumnName.ToString() == drfl["MATERIELNAME"].ToString())
  1098. {
  1099. drFlvalue[dcfl.ColumnName.ToString()] = drfl["JMWGT"].ToString();
  1100. }
  1101. }
  1102. bolIs = false;
  1103. }
  1104. }
  1105. }
  1106. }
  1107. return dtFl;
  1108. }
  1109. // 查询条件
  1110. /// <summary>
  1111. /// 查询条件
  1112. /// </summary>
  1113. /// <returns>返回查询条件</returns>
  1114. private string BuildSql(string wsid, string WlType)
  1115. {
  1116. string sqlstr = "";
  1117. //时间
  1118. sqlstr = " and a.optdate>=to_date('" + uldtBeginTime.Value.ToString() + "','yyyy-MM-dd HH24:mi:ss') " +
  1119. " and a.optdate<=to_date('" + uldtEndTime.Value.ToString() + "','yyyy-MM-dd HH24:mi:ss') ";
  1120. //熔炼号
  1121. if (chk_HeaNo.Checked)
  1122. {
  1123. if (!string.IsNullOrEmpty(ultraMaskedEdit1.Text) && !string.IsNullOrEmpty(ultraMaskedEdit2.Text))
  1124. {
  1125. if (string.Compare(ultraMaskedEdit1.Text.Trim(), ultraMaskedEdit2.Text.Trim()) != 1)
  1126. //sqlstr += " and a.heatno>='" + ultraMaskedEdit1.Text.ToString() + "' and a.heatno<='" + ultraMaskedEdit2.Text.ToString() + "'";
  1127. sqlstr += " and a.heatno between'" + ultraMaskedEdit1.Text.ToString() + "' and '" + ultraMaskedEdit2.Text.ToString() + "'";
  1128. else
  1129. MessageBox.Show("结束熔炼号不能大于开始熔炼号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  1130. }
  1131. else if (!string.IsNullOrEmpty(ultraMaskedEdit1.Text) && string.IsNullOrEmpty(ultraMaskedEdit2.Text))
  1132. sqlstr += " and a.heatno like '" + ultraMaskedEdit1.Text.ToString() + "%'";
  1133. else if (string.IsNullOrEmpty(ultraMaskedEdit1.Text) && !string.IsNullOrEmpty(ultraMaskedEdit2.Text))
  1134. sqlstr += " and a.heatno like '" + ultraMaskedEdit2.Text.ToString() + "%'";
  1135. }
  1136. //岗位
  1137. if (wsid != "0")
  1138. sqlstr += " and a.stationcode='0" + wsid + "'";
  1139. //班组
  1140. if (chk_Staticode.Checked && this.cboStaticode.Value.ToString()!="0")
  1141. sqlstr += " and substr(SHIFTCODE,2,1)='" + cboStaticode.Value.ToString() + "'";
  1142. //钢种
  1143. if (chkSteel.Checked && txtSteel.Text.Trim().Length > 0)
  1144. {
  1145. string strSteeAll = "", str = "";
  1146. string[] strSteel = txtSteel.Text.Split(',');
  1147. for (int i = 0; i < strSteel.Length; i++)
  1148. {
  1149. if (!string.IsNullOrEmpty(strSteel[i]))
  1150. strSteeAll = strSteeAll + "'" + strSteel[i].ToUpper().Trim() + "'" + ",";
  1151. }
  1152. str = strSteeAll.Substring(0, strSteeAll.Length - 1);
  1153. //sqlstr += " and a.plansteel in ('" + str + "')";
  1154. sqlstr += string.Format(" and UPPER(a.plansteel) in ({0})", str); // lower(b.jhgz)
  1155. }
  1156. sqlstr += " and b.MATERIELTYPE='" + WlType + "'"; //物料类型(合金、辅料)
  1157. return sqlstr;
  1158. }
  1159. private void ultraMaskedEdit1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  1160. {
  1161. UltraMaskedEdit ume = (UltraMaskedEdit)sender;
  1162. switch (e.Button.Key)
  1163. {
  1164. //case "edit":
  1165. // frmNumberWriter frm = new frmNumberWriter();
  1166. // frm._strText = ume.Text.Trim();
  1167. // frm.Location = GetChildWindowLocation(frm.Size);
  1168. // frm.ShowDialog();
  1169. // ume.Text = frm._strText;
  1170. // break;
  1171. case "clear":
  1172. if (ume.Text.Trim().Length > 0)
  1173. {
  1174. ume.Tag = ume.Text.Trim();
  1175. ume.Text = "";
  1176. }
  1177. else
  1178. {
  1179. if (ume.Tag != null)
  1180. ume.Text = ume.Tag.ToString();
  1181. }
  1182. break;
  1183. }
  1184. }
  1185. private void cboGW_SelectedIndexChanged(object sender, EventArgs e)
  1186. {
  1187. cboGWID.Items.Clear();
  1188. //cboGWID.Items.Add(GetCWIDItems(cboGW.SelectedIndex));
  1189. cboGWID.SelectedIndex = 0;
  1190. }
  1191. public string GetBZ(string str)
  1192. {
  1193. switch (str)
  1194. {
  1195. case "1":
  1196. return "甲班";
  1197. case "2":
  1198. return "乙班";
  1199. case "3":
  1200. return "丙班";
  1201. case "4":
  1202. return "丁班";
  1203. default:
  1204. return "";
  1205. }
  1206. }
  1207. // 岗位名称
  1208. /// <summary>
  1209. /// 岗位名称
  1210. /// </summary>
  1211. /// <param name="index"></param>
  1212. /// <returns></returns>
  1213. private string GetGW(string GwID)
  1214. {
  1215. switch (GwID)
  1216. {
  1217. case "BOF0":
  1218. return "#转炉";
  1219. case "CAS0":
  1220. return "#吹氩";
  1221. case "LFS0":
  1222. return "#钢包";
  1223. case "HMP0":
  1224. return "脱硫";
  1225. default:
  1226. return "";
  1227. }
  1228. }
  1229. // 根据岗位获取表名
  1230. /// <summary>
  1231. /// 根据岗位获取表名
  1232. /// </summary>
  1233. /// <param name="GWID">岗位</param>
  1234. /// <param name="addTableName">物料表</param>
  1235. /// <returns>返回实绩信息表</returns>
  1236. private string TableName(string GWID, out string addTableName)
  1237. {
  1238. string resTableName = "";
  1239. string addtableName = "";
  1240. switch (GWID)
  1241. {
  1242. case "HMP0":
  1243. resTableName = "STL_HMP_Optinfo";
  1244. addtableName = "B";
  1245. break;
  1246. case "BOF0":
  1247. resTableName = "STL_BOF_Optinfo";
  1248. addtableName = "C";
  1249. break;
  1250. case "CAS0":
  1251. resTableName = "STL_CAS_Optinfo";
  1252. addtableName = "D";
  1253. break;
  1254. case "RHS0":
  1255. resTableName = "STL_RHS_Optinfo";
  1256. addtableName = "F";
  1257. break;
  1258. case "LFS0":
  1259. resTableName = "STL_LFS_Optinfo";
  1260. addtableName = "E";
  1261. break;
  1262. default:
  1263. resTableName = "STL_CCM_Optinfo";
  1264. addtableName = "G";
  1265. break;
  1266. }
  1267. addTableName = addtableName;
  1268. return resTableName;
  1269. }
  1270. private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  1271. {
  1272. GetAdditStat();
  1273. }
  1274. private void chkSteel_CheckedChanged(object sender, EventArgs e)
  1275. {
  1276. txtSteel.Enabled = chkSteel.Checked;
  1277. if (!chkSteel.Checked)
  1278. {
  1279. txtSteel.BackColor = Color.WhiteSmoke;
  1280. }
  1281. }
  1282. /// <summary>
  1283. /// 系统功能
  1284. /// </summary>
  1285. public override void ToolBar_Click(object sender, string ToolbarKey)
  1286. {
  1287. switch (ToolbarKey)
  1288. {
  1289. case "Query":
  1290. GetAdditStat();
  1291. break;
  1292. case "Export":
  1293. try
  1294. {
  1295. if (ultraTabControl1.SelectedTab.Text == "金属料")
  1296. {
  1297. //Core.Mes.Client.Common.Globals.ulGridToExcel(ultraGrid1, Text + "_金属料");
  1298. GridHelper.ulGridToExcel(ultraGrid1, Text + "_金属料");
  1299. }
  1300. if (ultraTabControl1.SelectedTab.Text == "辅料")
  1301. {
  1302. //Core.Mes.Client.Common.Globals.ulGridToExcel(ultraGrid2, Text + "_辅料");
  1303. GridHelper.ulGridToExcel(ultraGrid2, Text + "_辅料");
  1304. }
  1305. }
  1306. catch (Exception ex)
  1307. {
  1308. MessageBox.Show(ex.Message);
  1309. }
  1310. break;
  1311. case "Exit":
  1312. this.Close();
  1313. break;
  1314. default:
  1315. break;
  1316. }
  1317. }
  1318. // 工序位置选择
  1319. /// <summary>
  1320. /// 工序位置选择
  1321. /// </summary>
  1322. private void cboGW_SelectionChanged(object sender, EventArgs e)
  1323. {
  1324. cboGWID.Items.Clear();
  1325. string gw = cboGW.Value.ToString();
  1326. switch (gw)
  1327. {
  1328. case "BOF0":
  1329. cboGWID.Items.Add("0", "所有");
  1330. cboGWID.Items.Add("1", "1#转炉");
  1331. cboGWID.Items.Add("2", "2#转炉");
  1332. cboGWID.Items.Add("3", "3#转炉");
  1333. cboGWID.Items.Add("4", "4#转炉");
  1334. //cboGWID.Items.Add("5", "5#转炉");
  1335. break;
  1336. case "CAS0":
  1337. cboGWID.Items.Add("0", "所有");
  1338. cboGWID.Items.Add("1", "1#吹氩站");
  1339. cboGWID.Items.Add("2", "2#吹氩站");
  1340. cboGWID.Items.Add("3", "3#吹氩站");
  1341. cboGWID.Items.Add("4", "4#吹氩站");
  1342. //cboGWID.Items.Add("5", "5#吹氩站");
  1343. break;
  1344. case "LFS0":
  1345. cboGWID.Items.Add("0", "所有");
  1346. cboGWID.Items.Add("1", "1#精炼炉");
  1347. cboGWID.Items.Add("2", "2#精炼炉");
  1348. //cboGWID.Items.Add("3", "3#精炼炉");
  1349. break;
  1350. case "CCM0":
  1351. cboGWID.Items.Add("0", "所有");
  1352. cboGWID.Items.Add("1", "1#连铸");
  1353. cboGWID.Items.Add("2", "2#连铸");
  1354. cboGWID.Items.Add("3", "3#连铸");
  1355. cboGWID.Items.Add("4", "2#连铸");
  1356. cboGWID.Items.Add("5", "3#连铸");
  1357. break;
  1358. case "HMP0":
  1359. cboGWID.Items.Add("0", "所有");
  1360. cboGWID.Items.Add("1", "1#脱硫");
  1361. cboGWID.Items.Add("2", "2#脱硫");
  1362. break;
  1363. case "SYGW":
  1364. cboGWID.Items.Add("0", "所有岗位");
  1365. break;
  1366. default:
  1367. cboGWID.Items.Add("0", "所有岗位");
  1368. break;
  1369. }
  1370. cboGWID.SelectedIndex = 0;
  1371. }
  1372. private void uCkEditorForFilter_CheckedChanged(object sender, EventArgs e)
  1373. {
  1374. ClsControlPack.SetUltraGridRowFilter(ref this.ultraGrid1, uCkEditorForFilter.Checked);
  1375. ClsControlPack.SetUltraGridRowFilter(ref this.ultraGrid2, uCkEditorForFilter.Checked);
  1376. }
  1377. }
  1378. }