frmAdditStat.cs 73 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616
  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. if (uldtEndTime.DateTime.Date.Subtract(uldtBeginTime.DateTime.Date).Days > 180)
  900. {
  901. MessageBox.Show("查询时间不可超过6个月。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  902. return;
  903. }
  904. if (uldtBeginTime.DateTime > uldtEndTime.DateTime)
  905. {
  906. MessageBox.Show("查询起始时间不能大于结束时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  907. return;
  908. }
  909. string strErr = "";
  910. string addTalbeName = "";
  911. string strWhere = "";
  912. string strgw = Convert.ToString(GetGW(this.cboGW.SelectedIndex));
  913. if (cboGW.SelectedIndex == -1)
  914. {
  915. strgw = "BOF0";
  916. }
  917. string strStartTime = "";
  918. string strEndTime = "";
  919. string strMType = "";
  920. string resTalbeName = TableName(strgw, out addTalbeName);
  921. if (chk_Date.Checked == true)
  922. {
  923. if (Convert.ToDateTime(uldtBeginTime.Value) > Convert.ToDateTime(uldtEndTime.Value))
  924. {
  925. MessageBox.Show("时间条件的开始时间不能大于结束时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  926. return;
  927. }
  928. else
  929. {
  930. strStartTime = this.uldtBeginTime.DateTime.ToString("yyyy-MM-dd");
  931. strEndTime = this.uldtEndTime.DateTime.ToString("yyyy-MM-dd");
  932. }
  933. }
  934. if (Convert.ToString(Convert.ToString(this.cboGWID.SelectedIndex)) != "0" && Convert.ToString(Convert.ToString(this.cboGWID.SelectedIndex)) != "-1") //岗位
  935. strWhere += " and a.stationcode='" + addTalbeName + "0" + Convert.ToString(Convert.ToString(this.cboGWID.SelectedIndex)) + "'";
  936. else
  937. strWhere += " and a.stationcode like '" + addTalbeName + "%'";
  938. if (this.ultraTabControl1.Tabs[0].Selected == true)
  939. strMType = "HJ";
  940. else
  941. strMType = "FL";
  942. //定义一个ArrayList集合存储变量[参数]值
  943. string NowTime = DateTime.Now.ToString("yyyy-MM-dd");
  944. ArrayList arry = new ArrayList();
  945. arry.Add("frmAdditStat_Load.select");//此ID为XML文件ID
  946. arry.Add(strMType);
  947. arry.Add(strStartTime == "" ? NowTime : strStartTime);
  948. arry.Add(strEndTime == "" ? NowTime : strEndTime);
  949. CommonClientToServer cctos = new CommonClientToServer();
  950. cctos.ob = this.ob;
  951. DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery",
  952. "doSimpleQuery", arry, out strErr);
  953. _dsGridInfo = ds;
  954. }
  955. catch (Exception ex)
  956. {
  957. Console.WriteLine(ex.Message);
  958. }
  959. }
  960. private string GetSqlWhere2()
  961. {
  962. string str = "";
  963. if (this.chk_Staticode.Checked)
  964. {
  965. str = string.Format(" where substr(bc,2,1)='{0}' ", this.cboStaticode.SelectedIndex + 1);
  966. }
  967. return str;
  968. }
  969. private string GetSqlWhere1()
  970. {
  971. string str = " where 1=1 ";
  972. if (this.chk_HeaNo.Checked)
  973. {
  974. str += string.Format(" and (lh >= '{0}' and lh <= '{1}') ",
  975. this.ultraMaskedEdit1.Text.Trim(), this.ultraMaskedEdit2.Text.Trim());
  976. }
  977. if (this.chk_Date.Checked)
  978. {
  979. str += string.Format(" and (jlsk >= to_date('{0}','yyyy-MM-dd HH24:mi:ss') "
  980. + " and jlsk <= to_date('{1}','yyyy-MM-dd HH24:mi:ss')) ",
  981. this.uldtBeginTime.Text, this.uldtEndTime.Text);
  982. }
  983. return str;
  984. }
  985. /// <summary>
  986. /// 获取物料信息
  987. /// </summary>
  988. private void GetAdditStat()
  989. {
  990. string sqlstr;
  991. string addTalbeName = "";
  992. string strGw = Convert.ToString(GetGW(this.cboGW.SelectedIndex));
  993. string strGWID = Convert.ToString(this.cboGWID.SelectedIndex);
  994. GetGridInfo(); //初始化物料信息列名
  995. if (this.ultraTabControl1.Tabs[0].Selected == true)
  996. sqlstr = BuildSql(Convert.ToString(Convert.ToString(this.cboGWID.SelectedIndex)), "HJ");
  997. else
  998. sqlstr = BuildSql(Convert.ToString(Convert.ToString(this.cboGWID.SelectedIndex)), "FL");
  999. try
  1000. {
  1001. string resTalbeName = TableName(strGw, out addTalbeName);
  1002. string strIronWSteel = "";
  1003. if (addTalbeName == "C")
  1004. strIronWSteel = " ,IRONPOTWGT,PIGIRONWGT,WSTEELWGT ";
  1005. string strWhereB = "";
  1006. if (addTalbeName == "B")
  1007. strWhereB = " where a.hudwid =b.heatno and '" + addTalbeName + "'|| a.EQUIPMENTNO = b.stationcode ";
  1008. else
  1009. strWhereB = " where a.heatno =b.heatno and '" + addTalbeName + "'|| a.stationcode = b.stationcode and a.disposaltime = b.disposaltime ";
  1010. //定义一个ArrayList集合存储变量[参数]值
  1011. ArrayList arry = new ArrayList();
  1012. ArrayList sqlList = new ArrayList();
  1013. arry.Add("frmAdditStat_Query.select");//此ID为XML文件ID
  1014. sqlList.Add(strIronWSteel);
  1015. sqlList.Add(strIronWSteel);
  1016. sqlList.Add(resTalbeName);
  1017. sqlList.Add(resTalbeName);
  1018. sqlList.Add(strWhereB);
  1019. sqlList.Add(sqlstr);
  1020. //调用服务端方法
  1021. CoreClientParam CCP_AStat = new CoreClientParam();
  1022. DataTable dt = new DataTable();
  1023. CCP_AStat.ServerName = "Core.LgMes.Server.Common.ComDBQuery";
  1024. CCP_AStat.MethodName = "doQuery";
  1025. CCP_AStat.ServerParams = new object[] { arry, sqlList };
  1026. CCP_AStat.SourceDataTable = dt;
  1027. this.ExecuteQueryToDataTable(CCP_AStat, CoreInvokeType.Internal);
  1028. DataTable dtHj = new DataTable();
  1029. DataTable dtFl = new DataTable();
  1030. _dsPL.Tables.Clear();
  1031. _dsHj.Tables.Clear();
  1032. if (dt.Rows.Count > 0)
  1033. {
  1034. if (this.ultraTabControl1.Tabs[0].Selected == true)
  1035. {
  1036. _dsHj.Tables.Add(dt);
  1037. dtHj = FormatData(_dsHj, "HJ");
  1038. this.ultraGrid1.DataSource = dtHj;
  1039. InitData1();
  1040. }
  1041. else
  1042. {
  1043. _dsPL.Tables.Add(dt);
  1044. dtFl = FormatData(_dsPL, "FL");
  1045. this.ultraGrid2.DataSource = dtFl;
  1046. InitData2();
  1047. }
  1048. }
  1049. else
  1050. {
  1051. ultraGrid1.DataSource = null;
  1052. dtHj.Clear();
  1053. dtFl.Clear();
  1054. }
  1055. }
  1056. catch (Exception ex)
  1057. {
  1058. Console.WriteLine(ex.Message);
  1059. }
  1060. }
  1061. /// <summary>
  1062. /// 将获取的数据序列化
  1063. /// </summary>
  1064. /// <param name="_dsFl"></param>
  1065. /// <returns></returns>
  1066. private DataTable FormatData(DataSet _dsFl, string Type)
  1067. {
  1068. DataTable dtFl = new DataTable();
  1069. dtFl.Columns.Add("heatprocessno");
  1070. dtFl.Columns.Add("heatno");
  1071. dtFl.Columns.Add("STEEL");
  1072. dtFl.Columns.Add("STATIONCODE");
  1073. dtFl.Columns.Add("SHIFTCODE");
  1074. if (cboGW.Text == "转炉" && Type == "HJ")
  1075. {
  1076. dtFl.Columns.Add("IRONPOTWGT"); //铁水
  1077. dtFl.Columns.Add("PIGIRONWGT"); //生铁
  1078. dtFl.Columns.Add("WSTEELWGT"); //废钢
  1079. }
  1080. string strSel = "";
  1081. if (this.checkBox3.Checked)
  1082. strSel = "MATERIELTYPE='" + Type + "'";
  1083. else
  1084. strSel = "MATERIELTYPE='" + Type + "'";
  1085. DataRow[] drs = _dsGridInfo.Tables[0].Select(strSel);
  1086. int count = drs.Length;
  1087. for (int i = 0; i < count; i++)
  1088. {
  1089. DataRow dr = drs[i];
  1090. dtFl.Columns.Add(dr[2].ToString());
  1091. }
  1092. bool bolIs = false;
  1093. foreach (DataRow drfl in _dsFl.Tables[0].Rows)
  1094. {
  1095. foreach (DataRow Isdrfl in dtFl.Rows)
  1096. {
  1097. if (drfl["heatprocessno"].ToString() == Isdrfl["heatprocessno"].ToString())
  1098. {
  1099. bolIs = true;
  1100. break;
  1101. }
  1102. }
  1103. if (!bolIs)
  1104. {
  1105. DataRow drFL = dtFl.NewRow();
  1106. drFL["heatprocessno"] = drfl["heatprocessno"].ToString();
  1107. drFL["heatno"] = drfl["heatno"].ToString();
  1108. drFL["STEEL"] = drfl["STEEL"].ToString();
  1109. drFL["STATIONCODE"] = drfl["WSID"].ToString() + GetGW(drfl["STATIONCODE"].ToString());
  1110. drFL["SHIFTCODE"] = GetBC(drfl["SHIFTCODE"].ToString());
  1111. if (cboGW.Text == "转炉" && Type == "HJ")
  1112. {
  1113. drFL["IRONPOTWGT"] = drfl["IRONPOTWGT"].ToString();//铁水
  1114. drFL["PIGIRONWGT"] = drfl["PIGIRONWGT"].ToString();//废钢
  1115. drFL["WSTEELWGT"] = drfl["WSTEELWGT"].ToString();//废钢
  1116. }
  1117. foreach (DataColumn dcfl in dtFl.Columns)
  1118. {
  1119. if (dcfl.ColumnName.ToString() == drfl["MATERIELCODE"].ToString())
  1120. {
  1121. drFL[dcfl.ColumnName.ToString()] = drfl["JMWGT"].ToString();
  1122. }
  1123. }
  1124. dtFl.Rows.Add(drFL);
  1125. bolIs = false;
  1126. }
  1127. else
  1128. {
  1129. foreach (DataRow drFlvalue in dtFl.Rows)
  1130. {
  1131. if (drFlvalue["heatprocessno"].ToString() == drfl["heatprocessno"].ToString())
  1132. {
  1133. foreach (DataColumn dcfl in dtFl.Columns)
  1134. {
  1135. if (dcfl.ColumnName.ToString() == drfl["MATERIELCODE"].ToString())
  1136. {
  1137. drFlvalue[dcfl.ColumnName.ToString()] = drfl["JMWGT"].ToString();
  1138. }
  1139. }
  1140. bolIs = false;
  1141. }
  1142. }
  1143. }
  1144. }
  1145. return dtFl;
  1146. }
  1147. private string BuildSql(string wsid, string WlType)
  1148. {
  1149. string sqlstr = "";
  1150. if (chk_Date.Checked) //时间
  1151. sqlstr = " and a.optdate>=to_date('" + uldtBeginTime.Value.ToString() + "','yyyy-MM-dd HH24:mi:ss') " +
  1152. " and a.optdate<=to_date('" + uldtEndTime.Value.ToString() + "','yyyy-MM-dd HH24:mi:ss') ";
  1153. if (chk_HeaNo.Checked) //熔炼号
  1154. {
  1155. if (!string.IsNullOrEmpty(ultraMaskedEdit1.Text) && !string.IsNullOrEmpty(ultraMaskedEdit2.Text))
  1156. {
  1157. if (string.Compare(ultraMaskedEdit1.Text.Trim(), ultraMaskedEdit2.Text.Trim()) != 1)
  1158. //sqlstr += " and a.heatno>='" + ultraMaskedEdit1.Text.ToString() + "' and a.heatno<='" + ultraMaskedEdit2.Text.ToString() + "'";
  1159. sqlstr += " and a.heatno between'" + ultraMaskedEdit1.Text.ToString() + "' and '" + ultraMaskedEdit2.Text.ToString() + "'";
  1160. else
  1161. MessageBox.Show("结束熔炼号不能大于开始熔炼号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  1162. }
  1163. else if (!string.IsNullOrEmpty(ultraMaskedEdit1.Text) && string.IsNullOrEmpty(ultraMaskedEdit2.Text))
  1164. sqlstr += " and a.heatno='" + ultraMaskedEdit1.Text.ToString() + "'";
  1165. else if (string.IsNullOrEmpty(ultraMaskedEdit1.Text) && !string.IsNullOrEmpty(ultraMaskedEdit2.Text))
  1166. sqlstr += " and a.heatno='" + ultraMaskedEdit2.Text.ToString() + "'";
  1167. }
  1168. if (wsid != "0" && wsid != "-1") //岗位
  1169. sqlstr += " and a.stationcode='0" + wsid + "'";
  1170. if (chk_Staticode.Checked && this.cboStaticode.SelectedIndex != 0)
  1171. sqlstr += " and substr(SHIFTCODE,2,1)='" + cboStaticode.SelectedIndex + "'";
  1172. //钢种
  1173. if (chkSteel.Checked && txtSteel.Text.Trim().Length > 0)
  1174. {
  1175. string strSteeAll = "", str = "";
  1176. string[] strSteel = txtSteel.Text.Split(',');
  1177. for (int i = 0; i < strSteel.Length; i++)
  1178. {
  1179. if (!string.IsNullOrEmpty(strSteel[i]))
  1180. // strSteeAll = "'"+"strSteeAll+strSteel[i]+"'",";
  1181. strSteeAll = strSteeAll + "'" + strSteel[i] + "'" + ",";
  1182. }
  1183. str = strSteeAll.Substring(0, strSteeAll.Length - 1);
  1184. //sqlstr += " and a.plansteel in ('" + str + "')";
  1185. sqlstr += string.Format(" and UPPER(a.plansteel) in (UPPER({0}))", str); // lower(b.jhgz)
  1186. }
  1187. sqlstr += " and b.MATERIELTYPE='" + WlType + "'"; //物料类型(合金、辅料)
  1188. return sqlstr;
  1189. }
  1190. #endregion
  1191. private void ultraMaskedEdit1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  1192. {
  1193. UltraMaskedEdit ume = (UltraMaskedEdit)sender;
  1194. switch (e.Button.Key)
  1195. {
  1196. case "edit":
  1197. frmNumberWriter frm = new frmNumberWriter();
  1198. frm._strText = ume.Text.Trim();
  1199. frm.Location = GetChildWindowLocation(frm.Size);
  1200. frm.ShowDialog();
  1201. ume.Text = frm._strText;
  1202. break;
  1203. case "clear":
  1204. if (ume.Text.Trim().Length > 0)
  1205. {
  1206. ume.Tag = ume.Text.Trim();
  1207. ume.Text = "";
  1208. }
  1209. else
  1210. {
  1211. if (ume.Tag != null)
  1212. ume.Text = ume.Tag.ToString();
  1213. }
  1214. break;
  1215. }
  1216. }
  1217. private void cboGW_SelectedIndexChanged(object sender, EventArgs e)
  1218. {
  1219. cboGWID.Items.Clear();
  1220. cboGWID.Items.Add(GetCWIDItems(cboGW.SelectedIndex));
  1221. cboGWID.SelectedIndex = 0;
  1222. }
  1223. /// <summary>
  1224. /// 初始化工位
  1225. /// </summary>
  1226. /// <param name="index"></param>
  1227. /// <returns></returns>
  1228. private object[] GetCWIDItems(int index)
  1229. {
  1230. switch (index)
  1231. {
  1232. case 0:
  1233. return new object[] { "所有", "1#转炉", "2#转炉", "3#转炉" };
  1234. case 1:
  1235. return new object[] { "所有", "1#吹氩站", "2#吹氩站", "3#吹氩站" };
  1236. case 2:
  1237. return new object[] { "所有", "1#精炼炉", "2#精炼炉" };
  1238. case 3:
  1239. return new object[] { "所有", "1#RH炉" };
  1240. case 4:
  1241. return new object[] { "所有", "1#VD炉" };
  1242. case 5:
  1243. return new object[] { "所有", "1#脱硫", "2#脱硫" };
  1244. default:
  1245. return new object[] { "所有岗位" };
  1246. }
  1247. }
  1248. /// <summary>
  1249. /// 岗位编码
  1250. /// </summary>
  1251. /// <param name="index"></param>
  1252. /// <returns></returns>
  1253. private string GetGW(int index)
  1254. {
  1255. switch (index)
  1256. {
  1257. case 0:
  1258. return "BOF0";
  1259. case 1:
  1260. return "CAS0";
  1261. case 2:
  1262. return "LFS0";
  1263. case 3:
  1264. return "RHS0";
  1265. case 4:
  1266. return "VDS0";
  1267. case 5:
  1268. return "HMP0";
  1269. default:
  1270. return "0";
  1271. }
  1272. }
  1273. /// <summary>
  1274. /// 岗位名称
  1275. /// </summary>
  1276. /// <param name="index"></param>
  1277. /// <returns></returns>
  1278. private string GetGW(string GwID)
  1279. {
  1280. switch (GwID)
  1281. {
  1282. case "BOF0":
  1283. return "#转炉";
  1284. case "CAS0":
  1285. return "#吹氩";
  1286. case "LFS0":
  1287. return "#钢包";
  1288. case "RHS0":
  1289. return "RH炉";
  1290. case "VDS0":
  1291. return "VD炉";
  1292. case "HMP0":
  1293. return "脱硫";
  1294. default:
  1295. return "";
  1296. }
  1297. }
  1298. /// <summary>
  1299. /// 班别
  1300. /// </summary>
  1301. /// <param name="index"></param>
  1302. /// <returns></returns>
  1303. private string GetBC(string bcID)
  1304. {
  1305. string bb = "";
  1306. if (bcID.Length > 1) bb = bcID.Substring(1, 1);
  1307. switch (bb)
  1308. {
  1309. case "1":
  1310. return "甲";
  1311. case "2":
  1312. return "乙";
  1313. case "3":
  1314. return "丙";
  1315. case "4":
  1316. return "丁";
  1317. default:
  1318. return "";
  1319. }
  1320. }
  1321. /// <summary>
  1322. /// 根据岗位获取表名
  1323. /// </summary>
  1324. /// <param name="GWID">岗位</param>
  1325. /// <param name="addTableName">物料表</param>
  1326. /// <returns>返回实绩信息表</returns>
  1327. private string TableName(string GWID, out string addTableName)
  1328. {
  1329. string resTableName = "";
  1330. string addtableName = "";
  1331. switch (GWID)
  1332. {
  1333. case "BOF0":
  1334. resTableName = "STL_BOF_Optinfo";
  1335. addtableName = "C";
  1336. break;
  1337. case "CAS0":
  1338. resTableName = "STL_CAS_Optinfo";
  1339. addtableName = "D";
  1340. break;
  1341. case "RHS0":
  1342. resTableName = "STL_RHS_Optinfo";
  1343. addtableName = "F";
  1344. break;
  1345. case "LFS0":
  1346. resTableName = "STL_LFS_Optinfo";
  1347. addtableName = "E";
  1348. break;
  1349. case "VDS0":
  1350. resTableName = "STL_VDS_Optinfo";
  1351. addtableName = "I";
  1352. break;
  1353. case "HMP0":
  1354. resTableName = "STL_HMP_Optinfo";
  1355. addtableName = "B";
  1356. break;
  1357. default:
  1358. resTableName = "STL_CCM_Optinfo";
  1359. addtableName = "G";
  1360. break;
  1361. }
  1362. addTableName = addtableName;
  1363. return resTableName;
  1364. }
  1365. private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  1366. {
  1367. //GetAdditStat();
  1368. }
  1369. private void ExportExcel()
  1370. {
  1371. try
  1372. {
  1373. string StrfileName = System.Windows.Forms.Application.StartupPath + "\\Report\\物料消耗明细.xls";
  1374. if (ultraTabControl1.SelectedTab.Index == 0)
  1375. this.GridExcelExporter.Export(this.ultraGrid1, StrfileName);
  1376. else
  1377. this.GridExcelExporter.Export(this.ultraGrid2, StrfileName);
  1378. ProcessStartInfo p = new ProcessStartInfo(StrfileName);
  1379. p.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
  1380. p.WorkingDirectory = Path.GetDirectoryName(StrfileName);
  1381. Process.Start(p);
  1382. }
  1383. catch (Exception ex)
  1384. {
  1385. MessageBox.Show(ex.Message + "\n处理方法:查看(" + System.Windows.Forms.Application.StartupPath + ")目录下是否有[ Report文件夹 ],如果没有请手动创建!");
  1386. }
  1387. }
  1388. private void chkSteel_CheckedChanged(object sender, EventArgs e)
  1389. {
  1390. txtSteel.Enabled = chkSteel.Checked;
  1391. if (!chkSteel.Checked)
  1392. {
  1393. txtSteel.BackColor = Color.WhiteSmoke;//(224, 224, 224);
  1394. }
  1395. }
  1396. public override void ToolBar_Click(object sender, string ToolbarKey)
  1397. {
  1398. switch (ToolbarKey)
  1399. {
  1400. case "Query":
  1401. GetAdditStat();
  1402. break;
  1403. case "Export":
  1404. ExportExcel();
  1405. break;
  1406. case "Exit":
  1407. this.Close();
  1408. break;
  1409. default:
  1410. break;
  1411. }
  1412. }
  1413. private void cboGW_SelectionChanged(object sender, EventArgs e)
  1414. {
  1415. cboGWID.Items.Clear();
  1416. int index;
  1417. index = cboGW.SelectedIndex;
  1418. //cboGWID.Items.Add(GetCWIDItems(cboGW.SelectedIndex));
  1419. switch (index)
  1420. {
  1421. case 0:
  1422. cboGWID.Items.Add(0, "所有");
  1423. cboGWID.Items.Add(1, "1#转炉");
  1424. cboGWID.Items.Add(2, "2#转炉");
  1425. break;
  1426. case 1:
  1427. cboGWID.Items.Add(0, "所有");
  1428. cboGWID.Items.Add(1, "1#吹氩站");
  1429. cboGWID.Items.Add(2, "2#吹氩站");
  1430. break;
  1431. case 2:
  1432. cboGWID.Items.Add(0, "所有");
  1433. cboGWID.Items.Add(1, "1#精炼炉");
  1434. cboGWID.Items.Add(2, "2#精炼炉");
  1435. break;
  1436. case 3:
  1437. cboGWID.Items.Add(0, "所有");
  1438. cboGWID.Items.Add(1, "1#RH炉");
  1439. break; ;
  1440. case 4:
  1441. cboGWID.Items.Add(0, "所有");
  1442. cboGWID.Items.Add(1, "1#VD炉");
  1443. break;
  1444. case 5:
  1445. cboGWID.Items.Add(0, "所有铁水");
  1446. break;
  1447. case 6:
  1448. cboGWID.Items.Add(0, "所有");
  1449. cboGWID.Items.Add(1, "1#连铸");
  1450. cboGWID.Items.Add(2, "2#连铸");
  1451. cboGWID.Items.Add(3, "3#连铸");
  1452. break;
  1453. default:
  1454. cboGWID.Items.Add(0, "所有岗位");
  1455. break;
  1456. }
  1457. cboGWID.SelectedIndex = 0;
  1458. }
  1459. private void uCkEditorForFilter_CheckedChanged(object sender, EventArgs e)
  1460. {
  1461. JJBStaticFunction.SetGridRowFilter(ref this.ultraGrid1, uCkEditorForFilter.Checked);
  1462. JJBStaticFunction.SetGridRowFilter(ref this.ultraGrid2, uCkEditorForFilter.Checked);
  1463. }
  1464. }
  1465. }