frmAdditStat.cs.svn-base 73 KB

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