frmLgElementsHis.cs 100 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342
  1. using System;
  2. using System.IO;
  3. using System.Drawing;
  4. using System.Collections;
  5. using System.Diagnostics;
  6. using System.ComponentModel;
  7. using System.Windows.Forms;
  8. using System.Data;
  9. using System.Threading;
  10. using CoreFS.CA06;
  11. using Infragistics.Win.UltraWinMaskedEdit;
  12. using Infragistics.Win.UltraWinGrid;
  13. using Infragistics.Win;
  14. namespace Core.LgMes.Client.LgIntegrationQuery
  15. {
  16. /// <summary>
  17. /// ELEMENTS 的摘要说明。
  18. /// </summary>
  19. public class frmLgElementsHis : Core.Mes.Client.Common.frmStyleBase
  20. {
  21. #region " Construct "
  22. private Infragistics.Win.Misc.UltraGroupBox ultraGroupBox1;
  23. private System.Windows.Forms.Label label1;
  24. private System.Windows.Forms.Label label2;
  25. private System.ComponentModel.IContainer components;
  26. private System.Windows.Forms.Label label3;
  27. private System.Windows.Forms.Panel panel1;
  28. private System.Windows.Forms.Label label4;
  29. private System.Windows.Forms.Label label5;
  30. private System.Windows.Forms.Label label6;
  31. private System.Windows.Forms.TextBox textBox1;
  32. private System.Windows.Forms.Button button1;
  33. private System.Windows.Forms.Button button2;
  34. private System.Windows.Forms.Button button3;
  35. private System.Windows.Forms.ComboBox comboBox1;
  36. private System.Windows.Forms.ComboBox comboBox2;
  37. private System.Windows.Forms.Label label7;
  38. private System.Windows.Forms.ComboBox comboBox3;
  39. private System.Windows.Forms.Label label8;
  40. private System.Windows.Forms.CheckBox checkBox1;
  41. private System.Windows.Forms.Label label9;
  42. public string StrPost = "0";
  43. private Label label11;
  44. private Label label10;
  45. private Infragistics.Win.UltraWinEditors.UltraDateTimeEditor dateTimePicker1;
  46. private Infragistics.Win.UltraWinEditors.UltraDateTimeEditor dateTimePicker2;
  47. private UltraMaskedEdit ultraMaskedEdit1;
  48. private UltraMaskedEdit ultraMaskedEdit2;
  49. private Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter GridExcelExporter;
  50. private Infragistics.Win.UltraWinToolbars.UltraToolbarsManager ultraToolbarsManager1;
  51. private UltraGrid EMGrid;
  52. private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Left;
  53. private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Right;
  54. private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Top;
  55. private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Bottom;
  56. private string m_szEntry = "";
  57. private DataSet dataSet1;
  58. private DataTable dataTable1;
  59. private DataColumn dataColumn7;
  60. private DataColumn dataColumn8;
  61. private DataColumn dataColumn9;
  62. private DataColumn dataColumn84;
  63. private DataColumn dataColumn85;
  64. string[] strERow;
  65. private TextBox txtSteel;
  66. private CheckBox chkGasSample; //化学成份列名
  67. string[] strRowName = new string[] { "C", "Si", "Mn", "P", "S", "Als", "V", "Nb", "Ti", "Asn", "Sn", "Cu", "Sb", "Alt", "O", "N", "H" };
  68. private DataColumn dataColumn1;
  69. Int32 intSelectedIndex = -1; //选择的岗位
  70. public frmLgElementsHis(string szPost)
  71. {
  72. InitializeComponent();
  73. this._devPos = szPost;
  74. }
  75. public frmLgElementsHis()
  76. {
  77. //
  78. // Windows 窗体设计器支持所必需的
  79. //
  80. InitializeComponent();
  81. this._devPos = StrPost;
  82. }
  83. public frmLgElementsHis(string szEntry, string szLH)
  84. {
  85. InitializeComponent();
  86. this._devPos = StrPost;
  87. this.m_szEntry = szEntry;
  88. this.ultraMaskedEdit1.Text = szLH;
  89. }
  90. /// <summary>
  91. /// 清理所有正在使用的资源。
  92. /// </summary>
  93. protected override void Dispose(bool disposing)
  94. {
  95. try
  96. {
  97. if (_getDataThread != null)
  98. _getDataThread.Abort();
  99. }
  100. catch { }
  101. if (disposing)
  102. {
  103. if (components != null)
  104. {
  105. components.Dispose();
  106. }
  107. }
  108. base.Dispose(disposing);
  109. }
  110. #region Windows 窗体设计器生成的代码
  111. /// <summary>
  112. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  113. /// 此方法的内容。
  114. /// </summary>
  115. private void InitializeComponent()
  116. {
  117. this.components = new System.ComponentModel.Container();
  118. Infragistics.Win.UltraWinEditors.EditorButton editorButton1 = new Infragistics.Win.UltraWinEditors.EditorButton("edit");
  119. Infragistics.Win.UltraWinEditors.EditorButton editorButton2 = new Infragistics.Win.UltraWinEditors.EditorButton("clear");
  120. Infragistics.Win.UltraWinEditors.EditorButton editorButton3 = new Infragistics.Win.UltraWinEditors.EditorButton("edit");
  121. Infragistics.Win.UltraWinEditors.EditorButton editorButton4 = new Infragistics.Win.UltraWinEditors.EditorButton("clear");
  122. Infragistics.Win.UltraWinGrid.UltraGridBand ultraGridBand1 = new Infragistics.Win.UltraWinGrid.UltraGridBand("Table1", -1);
  123. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn1 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("序号");
  124. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn2 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("熔炼号");
  125. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn3 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("计划牌号");
  126. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn4 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("化验时间");
  127. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn5 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("JHGZ");
  128. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn6 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("shiftcode", -1, 7905313);
  129. Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
  130. Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
  131. Infragistics.Win.ValueList valueList1 = new Infragistics.Win.ValueList(7905313);
  132. Infragistics.Win.ValueListItem valueListItem1 = new Infragistics.Win.ValueListItem();
  133. Infragistics.Win.ValueListItem valueListItem2 = new Infragistics.Win.ValueListItem();
  134. Infragistics.Win.ValueListItem valueListItem3 = new Infragistics.Win.ValueListItem();
  135. Infragistics.Win.ValueListItem valueListItem4 = new Infragistics.Win.ValueListItem();
  136. Infragistics.Win.ValueListItem valueListItem5 = new Infragistics.Win.ValueListItem();
  137. Infragistics.Win.ValueListItem valueListItem6 = new Infragistics.Win.ValueListItem();
  138. Infragistics.Win.ValueListItem valueListItem7 = new Infragistics.Win.ValueListItem();
  139. Infragistics.Win.ValueListItem valueListItem8 = new Infragistics.Win.ValueListItem();
  140. Infragistics.Win.ValueListItem valueListItem9 = new Infragistics.Win.ValueListItem();
  141. Infragistics.Win.ValueListItem valueListItem10 = new Infragistics.Win.ValueListItem();
  142. Infragistics.Win.ValueListItem valueListItem11 = new Infragistics.Win.ValueListItem();
  143. Infragistics.Win.ValueListItem valueListItem12 = new Infragistics.Win.ValueListItem();
  144. Infragistics.Win.UltraWinToolbars.UltraToolbar ultraToolbar1 = new Infragistics.Win.UltraWinToolbars.UltraToolbar("UltraToolbar1");
  145. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool1 = new Infragistics.Win.UltraWinToolbars.ButtonTool("query");
  146. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool2 = new Infragistics.Win.UltraWinToolbars.ButtonTool("set");
  147. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool3 = new Infragistics.Win.UltraWinToolbars.ButtonTool("excel");
  148. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool4 = new Infragistics.Win.UltraWinToolbars.ButtonTool("SRow");
  149. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool5 = new Infragistics.Win.UltraWinToolbars.ButtonTool("query");
  150. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool6 = new Infragistics.Win.UltraWinToolbars.ButtonTool("set");
  151. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool7 = new Infragistics.Win.UltraWinToolbars.ButtonTool("excel");
  152. Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool8 = new Infragistics.Win.UltraWinToolbars.ButtonTool("SRow");
  153. this.ultraGroupBox1 = new Infragistics.Win.Misc.UltraGroupBox();
  154. this.chkGasSample = new System.Windows.Forms.CheckBox();
  155. this.txtSteel = new System.Windows.Forms.TextBox();
  156. this.ultraMaskedEdit2 = new Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit();
  157. this.ultraMaskedEdit1 = new Infragistics.Win.UltraWinMaskedEdit.UltraMaskedEdit();
  158. this.dateTimePicker2 = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor();
  159. this.dateTimePicker1 = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor();
  160. this.label11 = new System.Windows.Forms.Label();
  161. this.label10 = new System.Windows.Forms.Label();
  162. this.label9 = new System.Windows.Forms.Label();
  163. this.checkBox1 = new System.Windows.Forms.CheckBox();
  164. this.comboBox3 = new System.Windows.Forms.ComboBox();
  165. this.comboBox1 = new System.Windows.Forms.ComboBox();
  166. this.label8 = new System.Windows.Forms.Label();
  167. this.label7 = new System.Windows.Forms.Label();
  168. this.comboBox2 = new System.Windows.Forms.ComboBox();
  169. this.button3 = new System.Windows.Forms.Button();
  170. this.button2 = new System.Windows.Forms.Button();
  171. this.button1 = new System.Windows.Forms.Button();
  172. this.textBox1 = new System.Windows.Forms.TextBox();
  173. this.label6 = new System.Windows.Forms.Label();
  174. this.label5 = new System.Windows.Forms.Label();
  175. this.label4 = new System.Windows.Forms.Label();
  176. this.label1 = new System.Windows.Forms.Label();
  177. this.panel1 = new System.Windows.Forms.Panel();
  178. this.label3 = new System.Windows.Forms.Label();
  179. this.label2 = new System.Windows.Forms.Label();
  180. this.EMGrid = new Infragistics.Win.UltraWinGrid.UltraGrid();
  181. this.dataSet1 = new System.Data.DataSet();
  182. this.dataTable1 = new System.Data.DataTable();
  183. this.dataColumn7 = new System.Data.DataColumn();
  184. this.dataColumn8 = new System.Data.DataColumn();
  185. this.dataColumn9 = new System.Data.DataColumn();
  186. this.dataColumn84 = new System.Data.DataColumn();
  187. this.dataColumn85 = new System.Data.DataColumn();
  188. this.dataColumn1 = new System.Data.DataColumn();
  189. this._panel1_Toolbars_Dock_Area_Left = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
  190. this.ultraToolbarsManager1 = new Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(this.components);
  191. this._panel1_Toolbars_Dock_Area_Right = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
  192. this._panel1_Toolbars_Dock_Area_Top = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
  193. this._panel1_Toolbars_Dock_Area_Bottom = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
  194. this.GridExcelExporter = new Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter(this.components);
  195. ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).BeginInit();
  196. this.ultraGroupBox1.SuspendLayout();
  197. ((System.ComponentModel.ISupportInitialize)(this.dateTimePicker2)).BeginInit();
  198. ((System.ComponentModel.ISupportInitialize)(this.dateTimePicker1)).BeginInit();
  199. this.panel1.SuspendLayout();
  200. ((System.ComponentModel.ISupportInitialize)(this.EMGrid)).BeginInit();
  201. ((System.ComponentModel.ISupportInitialize)(this.dataSet1)).BeginInit();
  202. ((System.ComponentModel.ISupportInitialize)(this.dataTable1)).BeginInit();
  203. ((System.ComponentModel.ISupportInitialize)(this.ultraToolbarsManager1)).BeginInit();
  204. this.SuspendLayout();
  205. //
  206. // ultraGroupBox1
  207. //
  208. this.ultraGroupBox1.Controls.Add(this.chkGasSample);
  209. this.ultraGroupBox1.Controls.Add(this.txtSteel);
  210. this.ultraGroupBox1.Controls.Add(this.ultraMaskedEdit2);
  211. this.ultraGroupBox1.Controls.Add(this.ultraMaskedEdit1);
  212. this.ultraGroupBox1.Controls.Add(this.dateTimePicker2);
  213. this.ultraGroupBox1.Controls.Add(this.dateTimePicker1);
  214. this.ultraGroupBox1.Controls.Add(this.label11);
  215. this.ultraGroupBox1.Controls.Add(this.label10);
  216. this.ultraGroupBox1.Controls.Add(this.label9);
  217. this.ultraGroupBox1.Controls.Add(this.checkBox1);
  218. this.ultraGroupBox1.Controls.Add(this.comboBox3);
  219. this.ultraGroupBox1.Controls.Add(this.comboBox1);
  220. this.ultraGroupBox1.Controls.Add(this.label8);
  221. this.ultraGroupBox1.Controls.Add(this.label7);
  222. this.ultraGroupBox1.Controls.Add(this.comboBox2);
  223. this.ultraGroupBox1.Controls.Add(this.button3);
  224. this.ultraGroupBox1.Controls.Add(this.button2);
  225. this.ultraGroupBox1.Controls.Add(this.button1);
  226. this.ultraGroupBox1.Controls.Add(this.textBox1);
  227. this.ultraGroupBox1.Controls.Add(this.label6);
  228. this.ultraGroupBox1.Controls.Add(this.label5);
  229. this.ultraGroupBox1.Controls.Add(this.label4);
  230. this.ultraGroupBox1.Controls.Add(this.label1);
  231. this.ultraGroupBox1.Dock = System.Windows.Forms.DockStyle.Top;
  232. this.ultraGroupBox1.Location = new System.Drawing.Point(0, 28);
  233. this.ultraGroupBox1.Name = "ultraGroupBox1";
  234. this.ultraGroupBox1.Size = new System.Drawing.Size(1008, 77);
  235. this.ultraGroupBox1.TabIndex = 3;
  236. //
  237. // chkGasSample
  238. //
  239. this.chkGasSample.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  240. this.chkGasSample.Location = new System.Drawing.Point(656, 44);
  241. this.chkGasSample.Name = "chkGasSample";
  242. this.chkGasSample.Size = new System.Drawing.Size(82, 24);
  243. this.chkGasSample.TabIndex = 85;
  244. this.chkGasSample.Text = "气体样";
  245. //
  246. // txtSteel
  247. //
  248. this.txtSteel.Location = new System.Drawing.Point(553, 46);
  249. this.txtSteel.Name = "txtSteel";
  250. this.txtSteel.Size = new System.Drawing.Size(87, 21);
  251. this.txtSteel.TabIndex = 84;
  252. //
  253. // ultraMaskedEdit2
  254. //
  255. editorButton1.Key = "edit";
  256. editorButton1.Text = "";
  257. editorButton2.Key = "clear";
  258. this.ultraMaskedEdit2.ButtonsRight.Add(editorButton1);
  259. this.ultraMaskedEdit2.ButtonsRight.Add(editorButton2);
  260. this.ultraMaskedEdit2.EditAs = Infragistics.Win.UltraWinMaskedEdit.EditAsType.String;
  261. this.ultraMaskedEdit2.Location = new System.Drawing.Point(239, 46);
  262. this.ultraMaskedEdit2.Name = "ultraMaskedEdit2";
  263. this.ultraMaskedEdit2.PromptChar = ' ';
  264. this.ultraMaskedEdit2.Size = new System.Drawing.Size(126, 21);
  265. this.ultraMaskedEdit2.TabIndex = 83;
  266. this.ultraMaskedEdit2.EditorButtonClick += new Infragistics.Win.UltraWinEditors.EditorButtonEventHandler(this.EditorButtonClick);
  267. //
  268. // ultraMaskedEdit1
  269. //
  270. editorButton3.Key = "edit";
  271. editorButton4.Key = "clear";
  272. this.ultraMaskedEdit1.ButtonsRight.Add(editorButton3);
  273. this.ultraMaskedEdit1.ButtonsRight.Add(editorButton4);
  274. this.ultraMaskedEdit1.EditAs = Infragistics.Win.UltraWinMaskedEdit.EditAsType.String;
  275. this.ultraMaskedEdit1.Location = new System.Drawing.Point(84, 46);
  276. this.ultraMaskedEdit1.Name = "ultraMaskedEdit1";
  277. this.ultraMaskedEdit1.PromptChar = ' ';
  278. this.ultraMaskedEdit1.Size = new System.Drawing.Size(126, 21);
  279. this.ultraMaskedEdit1.TabIndex = 82;
  280. this.ultraMaskedEdit1.EditorButtonClick += new Infragistics.Win.UltraWinEditors.EditorButtonEventHandler(this.EditorButtonClick);
  281. //
  282. // dateTimePicker2
  283. //
  284. this.dateTimePicker2.FormatProvider = new System.Globalization.CultureInfo("en-US");
  285. this.dateTimePicker2.FormatString = "yyyy-MM-dd HH:mm";
  286. this.dateTimePicker2.Location = new System.Drawing.Point(239, 15);
  287. this.dateTimePicker2.MaskInput = "yyyy-mm-dd hh:mm";
  288. this.dateTimePicker2.Name = "dateTimePicker2";
  289. this.dateTimePicker2.Size = new System.Drawing.Size(126, 21);
  290. this.dateTimePicker2.TabIndex = 80;
  291. //
  292. // dateTimePicker1
  293. //
  294. this.dateTimePicker1.FormatProvider = new System.Globalization.CultureInfo("en-US");
  295. this.dateTimePicker1.FormatString = "yyyy-MM-dd HH:mm";
  296. this.dateTimePicker1.Location = new System.Drawing.Point(84, 15);
  297. this.dateTimePicker1.MaskInput = "yyyy-mm-dd hh:mm";
  298. this.dateTimePicker1.Name = "dateTimePicker1";
  299. this.dateTimePicker1.Size = new System.Drawing.Size(126, 21);
  300. this.dateTimePicker1.TabIndex = 79;
  301. //
  302. // label11
  303. //
  304. this.label11.AutoSize = true;
  305. this.label11.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  306. this.label11.Location = new System.Drawing.Point(214, 49);
  307. this.label11.Name = "label11";
  308. this.label11.Size = new System.Drawing.Size(21, 14);
  309. this.label11.TabIndex = 78;
  310. this.label11.Text = "到";
  311. //
  312. // label10
  313. //
  314. this.label10.AutoSize = true;
  315. this.label10.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  316. this.label10.Location = new System.Drawing.Point(214, 18);
  317. this.label10.Name = "label10";
  318. this.label10.Size = new System.Drawing.Size(21, 14);
  319. this.label10.TabIndex = 77;
  320. this.label10.Text = "到";
  321. //
  322. // label9
  323. //
  324. this.label9.AutoSize = true;
  325. this.label9.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  326. this.label9.Location = new System.Drawing.Point(518, 49);
  327. this.label9.Name = "label9";
  328. this.label9.Size = new System.Drawing.Size(35, 14);
  329. this.label9.TabIndex = 72;
  330. this.label9.Text = "牌号";
  331. //
  332. // checkBox1
  333. //
  334. this.checkBox1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  335. this.checkBox1.Location = new System.Drawing.Point(656, 13);
  336. this.checkBox1.Name = "checkBox1";
  337. this.checkBox1.Size = new System.Drawing.Size(82, 24);
  338. this.checkBox1.TabIndex = 71;
  339. this.checkBox1.Text = "自动刷新";
  340. this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
  341. //
  342. // comboBox3
  343. //
  344. this.comboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  345. this.comboBox3.Items.AddRange(new object[] {
  346. "全部",
  347. "甲",
  348. "乙",
  349. "丙",
  350. "丁"});
  351. this.comboBox3.Location = new System.Drawing.Point(445, 46);
  352. this.comboBox3.Name = "comboBox3";
  353. this.comboBox3.Size = new System.Drawing.Size(70, 20);
  354. this.comboBox3.TabIndex = 69;
  355. //
  356. // comboBox1
  357. //
  358. this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  359. this.comboBox1.Items.AddRange(new object[] {
  360. "铁水",
  361. "转炉",
  362. "吹氩站",
  363. "精炼炉",
  364. "RH炉",
  365. "连铸"});
  366. this.comboBox1.Location = new System.Drawing.Point(445, 15);
  367. this.comboBox1.Name = "comboBox1";
  368. this.comboBox1.Size = new System.Drawing.Size(71, 20);
  369. this.comboBox1.TabIndex = 64;
  370. this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
  371. //
  372. // label8
  373. //
  374. this.label8.AutoSize = true;
  375. this.label8.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  376. this.label8.Location = new System.Drawing.Point(375, 49);
  377. this.label8.Name = "label8";
  378. this.label8.Size = new System.Drawing.Size(70, 14);
  379. this.label8.TabIndex = 70;
  380. this.label8.Text = "选择班组:";
  381. //
  382. // label7
  383. //
  384. this.label7.AutoSize = true;
  385. this.label7.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  386. this.label7.Location = new System.Drawing.Point(375, 18);
  387. this.label7.Name = "label7";
  388. this.label7.Size = new System.Drawing.Size(70, 14);
  389. this.label7.TabIndex = 68;
  390. this.label7.Text = "工序位置:";
  391. //
  392. // comboBox2
  393. //
  394. this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  395. this.comboBox2.Location = new System.Drawing.Point(528, 15);
  396. this.comboBox2.Name = "comboBox2";
  397. this.comboBox2.Size = new System.Drawing.Size(112, 20);
  398. this.comboBox2.TabIndex = 65;
  399. //
  400. // button3
  401. //
  402. this.button3.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  403. this.button3.Location = new System.Drawing.Point(900, 45);
  404. this.button3.Name = "button3";
  405. this.button3.Size = new System.Drawing.Size(72, 23);
  406. this.button3.TabIndex = 58;
  407. this.button3.Text = "全部显示";
  408. this.button3.UseVisualStyleBackColor = false;
  409. this.button3.Click += new System.EventHandler(this.button3_Click);
  410. //
  411. // button2
  412. //
  413. this.button2.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  414. this.button2.Location = new System.Drawing.Point(852, 45);
  415. this.button2.Name = "button2";
  416. this.button2.Size = new System.Drawing.Size(40, 23);
  417. this.button2.TabIndex = 57;
  418. this.button2.Text = ">>";
  419. this.button2.Click += new System.EventHandler(this.button2_Click);
  420. //
  421. // button1
  422. //
  423. this.button1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  424. this.button1.Location = new System.Drawing.Point(748, 45);
  425. this.button1.Name = "button1";
  426. this.button1.Size = new System.Drawing.Size(40, 23);
  427. this.button1.TabIndex = 56;
  428. this.button1.Text = "<<";
  429. this.button1.Click += new System.EventHandler(this.button1_Click);
  430. //
  431. // textBox1
  432. //
  433. this.textBox1.Location = new System.Drawing.Point(788, 46);
  434. this.textBox1.Name = "textBox1";
  435. this.textBox1.Size = new System.Drawing.Size(64, 21);
  436. this.textBox1.TabIndex = 55;
  437. this.textBox1.Text = "20";
  438. //
  439. // label6
  440. //
  441. this.label6.AutoSize = true;
  442. this.label6.ForeColor = System.Drawing.Color.Red;
  443. this.label6.Location = new System.Drawing.Point(842, 19);
  444. this.label6.Name = "label6";
  445. this.label6.Size = new System.Drawing.Size(0, 12);
  446. this.label6.TabIndex = 54;
  447. //
  448. // label5
  449. //
  450. this.label5.AutoSize = true;
  451. this.label5.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  452. this.label5.Location = new System.Drawing.Point(746, 18);
  453. this.label5.Name = "label5";
  454. this.label5.Size = new System.Drawing.Size(98, 14);
  455. this.label5.TabIndex = 52;
  456. this.label5.Text = "当前数据显示:";
  457. //
  458. // label4
  459. //
  460. this.label4.AutoSize = true;
  461. this.label4.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  462. this.label4.Location = new System.Drawing.Point(21, 49);
  463. this.label4.Name = "label4";
  464. this.label4.Size = new System.Drawing.Size(63, 14);
  465. this.label4.TabIndex = 48;
  466. this.label4.Text = "熔炼号从";
  467. //
  468. // label1
  469. //
  470. this.label1.AutoSize = true;
  471. this.label1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  472. this.label1.Location = new System.Drawing.Point(7, 18);
  473. this.label1.Name = "label1";
  474. this.label1.Size = new System.Drawing.Size(77, 14);
  475. this.label1.TabIndex = 15;
  476. this.label1.Text = "化验时间从";
  477. //
  478. // panel1
  479. //
  480. this.panel1.Controls.Add(this.label3);
  481. this.panel1.Controls.Add(this.label2);
  482. this.panel1.Controls.Add(this.EMGrid);
  483. this.panel1.Controls.Add(this.ultraGroupBox1);
  484. this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Left);
  485. this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Right);
  486. this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Top);
  487. this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Bottom);
  488. this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
  489. this.panel1.Location = new System.Drawing.Point(0, 0);
  490. this.panel1.Name = "panel1";
  491. this.panel1.Size = new System.Drawing.Size(1008, 653);
  492. this.panel1.TabIndex = 12;
  493. //
  494. // label3
  495. //
  496. this.label3.BackColor = System.Drawing.Color.Blue;
  497. this.label3.ForeColor = System.Drawing.SystemColors.ControlText;
  498. this.label3.Location = new System.Drawing.Point(564, 271);
  499. this.label3.Name = "label3";
  500. this.label3.Size = new System.Drawing.Size(100, 23);
  501. this.label3.TabIndex = 11;
  502. this.label3.Text = "label3";
  503. this.label3.Visible = false;
  504. //
  505. // label2
  506. //
  507. this.label2.BackColor = System.Drawing.Color.Red;
  508. this.label2.Location = new System.Drawing.Point(458, 230);
  509. this.label2.Name = "label2";
  510. this.label2.Size = new System.Drawing.Size(100, 23);
  511. this.label2.TabIndex = 6;
  512. this.label2.Text = "label2";
  513. this.label2.Visible = false;
  514. //
  515. // EMGrid
  516. //
  517. this.EMGrid.DataMember = "Table1";
  518. this.EMGrid.DataSource = this.dataSet1;
  519. ultraGridColumn1.Header.VisiblePosition = 0;
  520. ultraGridColumn1.Hidden = true;
  521. ultraGridColumn1.Width = 54;
  522. ultraGridColumn2.Header.Caption = "炉号";
  523. ultraGridColumn2.Header.VisiblePosition = 1;
  524. ultraGridColumn2.Width = 132;
  525. ultraGridColumn3.Header.VisiblePosition = 2;
  526. ultraGridColumn3.Width = 76;
  527. ultraGridColumn4.Header.VisiblePosition = 3;
  528. ultraGridColumn4.Width = 148;
  529. ultraGridColumn5.Header.VisiblePosition = 4;
  530. ultraGridColumn5.Hidden = true;
  531. ultraGridColumn6.Header.VisiblePosition = 5;
  532. ultraGridColumn6.Width = 53;
  533. ultraGridBand1.Columns.AddRange(new object[] {
  534. ultraGridColumn1,
  535. ultraGridColumn2,
  536. ultraGridColumn3,
  537. ultraGridColumn4,
  538. ultraGridColumn5,
  539. ultraGridColumn6});
  540. this.EMGrid.DisplayLayout.BandsSerializer.Add(ultraGridBand1);
  541. appearance1.FontData.BoldAsString = "True";
  542. appearance1.FontData.SizeInPoints = 10F;
  543. this.EMGrid.DisplayLayout.Override.CellAppearance = appearance1;
  544. appearance2.FontData.BoldAsString = "True";
  545. this.EMGrid.DisplayLayout.Override.HeaderAppearance = appearance2;
  546. valueListItem1.DataValue = "11";
  547. valueListItem1.DisplayText = "白-甲";
  548. valueListItem2.DataValue = "12";
  549. valueListItem2.DisplayText = "白-乙";
  550. valueListItem3.DataValue = "13";
  551. valueListItem3.DisplayText = "白-丙";
  552. valueListItem4.DataValue = "14";
  553. valueListItem4.DisplayText = "白-丁";
  554. valueListItem5.DataValue = "21";
  555. valueListItem5.DisplayText = "中-甲";
  556. valueListItem6.DataValue = "22";
  557. valueListItem6.DisplayText = "中-乙";
  558. valueListItem7.DataValue = "23";
  559. valueListItem7.DisplayText = "中-丙";
  560. valueListItem8.DataValue = "24";
  561. valueListItem8.DisplayText = "中-丁";
  562. valueListItem9.DataValue = "31";
  563. valueListItem9.DisplayText = "夜-甲";
  564. valueListItem10.DataValue = "32";
  565. valueListItem10.DisplayText = "夜-乙";
  566. valueListItem11.DataValue = "33";
  567. valueListItem11.DisplayText = "夜-丙";
  568. valueListItem12.DataValue = "34";
  569. valueListItem12.DisplayText = "夜-丁";
  570. valueList1.ValueListItems.AddRange(new Infragistics.Win.ValueListItem[] {
  571. valueListItem1,
  572. valueListItem2,
  573. valueListItem3,
  574. valueListItem4,
  575. valueListItem5,
  576. valueListItem6,
  577. valueListItem7,
  578. valueListItem8,
  579. valueListItem9,
  580. valueListItem10,
  581. valueListItem11,
  582. valueListItem12});
  583. this.EMGrid.DisplayLayout.ValueLists.AddRange(new Infragistics.Win.ValueList[] {
  584. valueList1});
  585. this.EMGrid.Dock = System.Windows.Forms.DockStyle.Fill;
  586. this.EMGrid.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  587. this.EMGrid.Location = new System.Drawing.Point(0, 105);
  588. this.EMGrid.Name = "EMGrid";
  589. this.EMGrid.Size = new System.Drawing.Size(1008, 548);
  590. this.EMGrid.TabIndex = 6;
  591. this.EMGrid.DoubleClickRow += new Infragistics.Win.UltraWinGrid.DoubleClickRowEventHandler(this.EMGrid_DoubleClickRow);
  592. this.EMGrid.Click += new System.EventHandler(this.EMGrid_Click);
  593. //
  594. // dataSet1
  595. //
  596. this.dataSet1.DataSetName = "NewDataSet";
  597. this.dataSet1.Locale = new System.Globalization.CultureInfo("zh-CN");
  598. this.dataSet1.Tables.AddRange(new System.Data.DataTable[] {
  599. this.dataTable1});
  600. //
  601. // dataTable1
  602. //
  603. this.dataTable1.Columns.AddRange(new System.Data.DataColumn[] {
  604. this.dataColumn7,
  605. this.dataColumn8,
  606. this.dataColumn9,
  607. this.dataColumn84,
  608. this.dataColumn85,
  609. this.dataColumn1});
  610. this.dataTable1.TableName = "Table1";
  611. //
  612. // dataColumn7
  613. //
  614. this.dataColumn7.ColumnName = "序号";
  615. //
  616. // dataColumn8
  617. //
  618. this.dataColumn8.ColumnName = "熔炼号";
  619. //
  620. // dataColumn9
  621. //
  622. this.dataColumn9.ColumnName = "计划牌号";
  623. //
  624. // dataColumn84
  625. //
  626. this.dataColumn84.ColumnName = "化验时间";
  627. //
  628. // dataColumn85
  629. //
  630. this.dataColumn85.Caption = "牌号编码";
  631. this.dataColumn85.ColumnName = "JHGZ";
  632. //
  633. // dataColumn1
  634. //
  635. this.dataColumn1.Caption = "班别";
  636. this.dataColumn1.ColumnName = "shiftcode";
  637. //
  638. // _panel1_Toolbars_Dock_Area_Left
  639. //
  640. this._panel1_Toolbars_Dock_Area_Left.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
  641. this._panel1_Toolbars_Dock_Area_Left.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(229)))), ((int)(((byte)(215)))));
  642. this._panel1_Toolbars_Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Left;
  643. this._panel1_Toolbars_Dock_Area_Left.ForeColor = System.Drawing.SystemColors.ControlText;
  644. this._panel1_Toolbars_Dock_Area_Left.Location = new System.Drawing.Point(0, 28);
  645. this._panel1_Toolbars_Dock_Area_Left.Name = "_panel1_Toolbars_Dock_Area_Left";
  646. this._panel1_Toolbars_Dock_Area_Left.Size = new System.Drawing.Size(0, 625);
  647. this._panel1_Toolbars_Dock_Area_Left.ToolbarsManager = this.ultraToolbarsManager1;
  648. //
  649. // ultraToolbarsManager1
  650. //
  651. this.ultraToolbarsManager1.DesignerFlags = 1;
  652. this.ultraToolbarsManager1.DockWithinContainer = this.panel1;
  653. this.ultraToolbarsManager1.LockToolbars = true;
  654. this.ultraToolbarsManager1.ShowFullMenusDelay = 500;
  655. this.ultraToolbarsManager1.ShowQuickCustomizeButton = false;
  656. this.ultraToolbarsManager1.Style = Infragistics.Win.UltraWinToolbars.ToolbarStyle.VisualStudio2005;
  657. ultraToolbar1.DockedColumn = 0;
  658. ultraToolbar1.DockedRow = 0;
  659. buttonTool1.InstanceProps.IsFirstInGroup = true;
  660. buttonTool2.InstanceProps.IsFirstInGroup = true;
  661. buttonTool3.InstanceProps.IsFirstInGroup = true;
  662. buttonTool4.InstanceProps.IsFirstInGroup = true;
  663. ultraToolbar1.NonInheritedTools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
  664. buttonTool1,
  665. buttonTool2,
  666. buttonTool3,
  667. buttonTool4});
  668. ultraToolbar1.Text = "UltraToolbar1";
  669. this.ultraToolbarsManager1.Toolbars.AddRange(new Infragistics.Win.UltraWinToolbars.UltraToolbar[] {
  670. ultraToolbar1});
  671. buttonTool5.SharedPropsInternal.Caption = "查询";
  672. buttonTool5.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  673. buttonTool6.SharedPropsInternal.Caption = "设置样点";
  674. buttonTool6.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  675. buttonTool7.SharedPropsInternal.Caption = "导Excel";
  676. buttonTool7.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  677. buttonTool8.SharedPropsInternal.Caption = "设置列";
  678. buttonTool8.SharedPropsInternal.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
  679. this.ultraToolbarsManager1.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
  680. buttonTool5,
  681. buttonTool6,
  682. buttonTool7,
  683. buttonTool8});
  684. this.ultraToolbarsManager1.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.ultraToolbarsManager1_ToolClick);
  685. //
  686. // _panel1_Toolbars_Dock_Area_Right
  687. //
  688. this._panel1_Toolbars_Dock_Area_Right.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
  689. this._panel1_Toolbars_Dock_Area_Right.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(229)))), ((int)(((byte)(215)))));
  690. this._panel1_Toolbars_Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Right;
  691. this._panel1_Toolbars_Dock_Area_Right.ForeColor = System.Drawing.SystemColors.ControlText;
  692. this._panel1_Toolbars_Dock_Area_Right.Location = new System.Drawing.Point(1008, 28);
  693. this._panel1_Toolbars_Dock_Area_Right.Name = "_panel1_Toolbars_Dock_Area_Right";
  694. this._panel1_Toolbars_Dock_Area_Right.Size = new System.Drawing.Size(0, 625);
  695. this._panel1_Toolbars_Dock_Area_Right.ToolbarsManager = this.ultraToolbarsManager1;
  696. //
  697. // _panel1_Toolbars_Dock_Area_Top
  698. //
  699. this._panel1_Toolbars_Dock_Area_Top.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
  700. this._panel1_Toolbars_Dock_Area_Top.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(229)))), ((int)(((byte)(215)))));
  701. this._panel1_Toolbars_Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top;
  702. this._panel1_Toolbars_Dock_Area_Top.ForeColor = System.Drawing.SystemColors.ControlText;
  703. this._panel1_Toolbars_Dock_Area_Top.Location = new System.Drawing.Point(0, 0);
  704. this._panel1_Toolbars_Dock_Area_Top.Name = "_panel1_Toolbars_Dock_Area_Top";
  705. this._panel1_Toolbars_Dock_Area_Top.Size = new System.Drawing.Size(1008, 28);
  706. this._panel1_Toolbars_Dock_Area_Top.ToolbarsManager = this.ultraToolbarsManager1;
  707. //
  708. // _panel1_Toolbars_Dock_Area_Bottom
  709. //
  710. this._panel1_Toolbars_Dock_Area_Bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
  711. this._panel1_Toolbars_Dock_Area_Bottom.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(229)))), ((int)(((byte)(215)))));
  712. this._panel1_Toolbars_Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Bottom;
  713. this._panel1_Toolbars_Dock_Area_Bottom.ForeColor = System.Drawing.SystemColors.ControlText;
  714. this._panel1_Toolbars_Dock_Area_Bottom.Location = new System.Drawing.Point(0, 653);
  715. this._panel1_Toolbars_Dock_Area_Bottom.Name = "_panel1_Toolbars_Dock_Area_Bottom";
  716. this._panel1_Toolbars_Dock_Area_Bottom.Size = new System.Drawing.Size(1008, 0);
  717. this._panel1_Toolbars_Dock_Area_Bottom.ToolbarsManager = this.ultraToolbarsManager1;
  718. //
  719. // frmLgElementsHis
  720. //
  721. this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
  722. this.ClientSize = new System.Drawing.Size(1008, 653);
  723. this.Controls.Add(this.panel1);
  724. this.Name = "frmLgElementsHis";
  725. this.Text = "历史化学成分查询";
  726. this.Load += new System.EventHandler(this.ELEMENTS_Load);
  727. ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).EndInit();
  728. this.ultraGroupBox1.ResumeLayout(false);
  729. this.ultraGroupBox1.PerformLayout();
  730. ((System.ComponentModel.ISupportInitialize)(this.dateTimePicker2)).EndInit();
  731. ((System.ComponentModel.ISupportInitialize)(this.dateTimePicker1)).EndInit();
  732. this.panel1.ResumeLayout(false);
  733. ((System.ComponentModel.ISupportInitialize)(this.EMGrid)).EndInit();
  734. ((System.ComponentModel.ISupportInitialize)(this.dataSet1)).EndInit();
  735. ((System.ComponentModel.ISupportInitialize)(this.dataTable1)).EndInit();
  736. ((System.ComponentModel.ISupportInitialize)(this.ultraToolbarsManager1)).EndInit();
  737. this.ResumeLayout(false);
  738. }
  739. #endregion
  740. #endregion
  741. public int sValue(string Svalue, string SCHvalue)
  742. {
  743. if (SCHvalue.Length < 1)
  744. {
  745. return 0;
  746. }
  747. if (Svalue.Length > 0)
  748. {
  749. string BValue = "-1";
  750. string EValue = "-1";
  751. if (Svalue.IndexOf("~") > 0)
  752. {
  753. BValue = Svalue.Substring(0, Svalue.IndexOf("~"));
  754. EValue = Svalue.Substring(Svalue.IndexOf("~") + 1, Svalue.Length - Svalue.IndexOf("~") - 1);
  755. if (double.Parse(SCHvalue) >= double.Parse(BValue) && double.Parse(SCHvalue) <= double.Parse(EValue))
  756. {
  757. return 0; //正确
  758. }
  759. else
  760. {
  761. return -1;
  762. }
  763. }
  764. else
  765. {
  766. if (Svalue.IndexOf("<=") > -1)
  767. {
  768. EValue = Svalue.Substring(Svalue.IndexOf("<=") + 2, Svalue.Length - Svalue.IndexOf("<=") - 2);
  769. if (double.Parse(SCHvalue) <= double.Parse(EValue))
  770. {
  771. return 0; //正确
  772. }
  773. else
  774. {
  775. return -1;
  776. }
  777. }
  778. else
  779. {
  780. if (Svalue.IndexOf("<") > -1 && Svalue.IndexOf("=") == -1)
  781. {
  782. EValue = Svalue.Substring(Svalue.IndexOf("<") + 1, Svalue.Length - Svalue.IndexOf("<") - 1);
  783. if (double.Parse(SCHvalue) < double.Parse(EValue))
  784. {
  785. return 0; //正确
  786. }
  787. else
  788. {
  789. return -1;
  790. }
  791. }
  792. else
  793. {
  794. if (Svalue.IndexOf(">=") > -1)
  795. {
  796. EValue = Svalue.Substring(Svalue.IndexOf(">=") + 1, Svalue.Length - Svalue.IndexOf(">=") - 1);
  797. if (double.Parse(SCHvalue) >= double.Parse(EValue))
  798. {
  799. return 0; //正确
  800. }
  801. else
  802. {
  803. return -1;
  804. }
  805. }
  806. else
  807. {
  808. if (Svalue.IndexOf(">") > -1 && Svalue.IndexOf("=") == -1)
  809. {
  810. EValue = Svalue.Substring(Svalue.IndexOf(">") + 1, Svalue.Length - Svalue.IndexOf(">") - 1);
  811. if (double.Parse(SCHvalue) > double.Parse(EValue))
  812. {
  813. return 0; //正确
  814. }
  815. else
  816. {
  817. return -1;
  818. }
  819. }
  820. else
  821. {
  822. EValue = Svalue;
  823. try
  824. {
  825. if (double.Parse(SCHvalue) == double.Parse(EValue))
  826. {
  827. return 0; //正确
  828. }
  829. }
  830. catch { }
  831. return -1;
  832. }
  833. }
  834. }
  835. }
  836. }
  837. }
  838. return 0;
  839. }
  840. public void GetTAM_StandardElement()/// 查询判定牌号成分
  841. {
  842. try
  843. {
  844. //
  845. string strForeSmeltingId = "", strSme = "";
  846. Color tmpC = c1;
  847. string szJHGZ = "", strErr = "", szWhere = "", szQJ = "", szJYH = "";
  848. object obj = null;
  849. for (int j = 0; j < EMGrid.Rows.Count; j++)
  850. {
  851. for (int i = 0; i < EMGrid.DisplayLayout.Bands[0].Columns.Count; i++)
  852. {
  853. EMGrid.Rows[j].Cells[i].Appearance.ForeColor = Color.Black;
  854. }
  855. if (j == 0)
  856. {
  857. EMGrid.Rows[j].Appearance.BackColor = tmpC;
  858. //if (this.comboBox1.SelectedIndex == 0)
  859. if (intSelectedIndex == 0)
  860. strForeSmeltingId = EMGrid.Rows[j].Cells[1].Value.ToString().Substring(0, EMGrid.Rows[j].Cells[1].Value.ToString().IndexOf("-"));
  861. else
  862. {
  863. if (EMGrid.Rows[j].Cells[1].Value.ToString().Length >= 9)
  864. strForeSmeltingId = EMGrid.Rows[j].Cells[1].Value.ToString().Substring(0, 9);
  865. }
  866. }
  867. else
  868. {
  869. //if (this.comboBox1.SelectedIndex == 0)
  870. if (intSelectedIndex == 0)
  871. strSme = EMGrid.Rows[j].Cells[1].Value.ToString().Substring(0, EMGrid.Rows[j].Cells[1].Value.ToString().IndexOf("-"));
  872. else
  873. {
  874. if (EMGrid.Rows[j].Cells[1].Value.ToString().Length >= 9)
  875. strSme = EMGrid.Rows[j].Cells[1].Value.ToString().Substring(0, 9);
  876. }
  877. if (strForeSmeltingId == strSme)
  878. {
  879. tmpC = SetRowBackColor(EMGrid.Rows[j], tmpC, true);
  880. }
  881. else
  882. {
  883. tmpC = SetRowBackColor(EMGrid.Rows[j], tmpC, false);
  884. strForeSmeltingId = strSme;
  885. }
  886. }
  887. // string StrHic=EMGrid.Rows[j].Cells ["dataColumn30"].Value .ToString ().Trim ();
  888. // string StrT="02";
  889. //if (this.comboBox1.SelectedIndex == 0)
  890. if (intSelectedIndex == 0)
  891. continue;
  892. szJHGZ = EMGrid.Rows[j].Cells["JHGZ"].Value.ToString();
  893. szJYH = EMGrid.Rows[j].Cells[1].Value.ToString().Substring(0, 9);
  894. strErr = "";
  895. //if (!string.IsNullOrEmpty(szJYH))
  896. // szDev = szJYH.Substring(szJYH.IndexOf("_") + 1, 1);
  897. string[] ArrayId = new string[strERow.Length];
  898. szWhere = " and t.STEELCODE='" + szJHGZ +
  899. "' and t.stationcode=(select ccm_ID from bsa_istlsch where heat_id='" + szJYH + "')"; //条件
  900. string szEleStd = "";// "('C','Si','Mn','P','S','Als','Al','Cr','Mo','Ti','Nb','B','V','Cu','Ca') ";
  901. string szCrfStd = "('L02001','L02005') ";
  902. int id = 0;
  903. for (int i = 6; i < EMGrid.DisplayLayout.Bands[0].Columns.Count; i++)
  904. {
  905. if (EMGrid.Rows[j].Cells[i].Appearance.ForeColor == Color.Red || EMGrid.Rows[j].Cells[i].Appearance.ForeColor == Color.FromArgb(204, 153, 0))
  906. EMGrid.Rows[j].Cells[i].Appearance.ForeColor = Color.Black;
  907. }
  908. //铁样与转炉样不判定
  909. if (EMGrid.Rows[j].Cells["熔炼号"].Value.ToString().IndexOf('A') == -1 &&
  910. EMGrid.Rows[j].Cells["熔炼号"].Value.ToString().IndexOf('B') == -1 &&
  911. EMGrid.Rows[j].Cells["熔炼号"].Value.ToString().IndexOf('C') == -1 &&
  912. EMGrid.Rows[j].Cells["熔炼号"].Value.ToString().Substring(11, 1) != "3" &&
  913. EMGrid.Rows[j].Cells["熔炼号"].Value.ToString().Substring(11, 1) != "4")
  914. {
  915. //设置要获取的化学成分标准
  916. for (int i = 6; i < EMGrid.DisplayLayout.Bands[0].Columns.Count; i++)
  917. {
  918. if (EMGrid.DisplayLayout.Bands[0].Columns[i].Hidden == false)
  919. {
  920. szEleStd = szEleStd + "','" + EMGrid.DisplayLayout.Bands[0].Columns[i].Header.Caption;
  921. ArrayId[id] = EMGrid.DisplayLayout.Bands[0].Columns[i].Header.Caption;
  922. id++;
  923. }
  924. }
  925. if (!string.IsNullOrEmpty(szEleStd))
  926. {
  927. szEleStd = "('" + szEleStd.Substring(3, szEleStd.Length - 3) + "')";
  928. //获取成分标准
  929. obj = null;//hengxing ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt",
  930. // "Core.LgMes.Server.lgJobMgt.classCommonModule",
  931. // "GetProcStandardValue", new object[] { szWhere, szEleStd, szCrfStd }, out strErr);
  932. }
  933. else
  934. continue;
  935. if (strErr != "")
  936. {
  937. continue;
  938. // MessageBox.Show(strErr);
  939. }
  940. else if (obj != null)
  941. {
  942. ArrayList ar = obj as ArrayList;
  943. DataSet dsStandard = (ar[0] as DataSet);
  944. if (dsStandard.Tables[0].Rows.Count == 0)
  945. {
  946. for (int i = 3; i < 18; i++)
  947. {
  948. if (EMGrid.Rows[j].Cells[i].Appearance.ForeColor == Color.Red)
  949. EMGrid.Rows[j].Cells[i].Appearance.ForeColor = Color.Black;
  950. }
  951. continue;
  952. }
  953. //DataSet dsCraft = ar[1] as DataSet;
  954. // string [] ArrayId={"","","","02001","02002","02003","02004","02005","02016","02026","02010",
  955. // "02007","02006","02008","02009","02011","02012","02013","02014",
  956. // "02015","02017","02018","02019","02020","02021","02022","02023",
  957. // "02024","02025","02027","02028","02029","02030","02031","02032","2033","2034","2035"};
  958. //string[] ArrayId ={ "", "", "", "C", "Si", "Mn", "P", "S", "Als", "Al", "Cr", "Mo", "Ti", "Nb", "B", "V", "Cu", "Ca" };
  959. foreach (DataRow Drow in dsStandard.Tables[0].Rows)
  960. {
  961. for (int i = 0; i < ArrayId.Length; i++)
  962. {
  963. // if (EMGrid.Rows[j].Cells[i + 6].Value.ToString().Length > 0)
  964. if (EMGrid.Rows[j].Cells[Drow["BASENAME"].ToString()].Value.ToString().Length > 0)
  965. {
  966. if (Drow["BASENAME"].ToString() == ArrayId[i])
  967. {
  968. int reP = 0;
  969. try
  970. {
  971. if (reP == 0)
  972. {
  973. if (Drow["ITEM1MIN"].ToString() != "" && Drow["ITEM1MAX"].ToString() != "")
  974. szQJ = Drow["ITEM1MIN"].ToString() + "~" + Drow["ITEM1MAX"].ToString();
  975. else if (Drow["ITEM1MIN"].ToString() != "" && Drow["ITEM1MAX"].ToString() == "")
  976. szQJ = "> " + Drow["ITEM1MIN"].ToString();
  977. else if (Drow["ITEM1MIN"].ToString() == "" && Drow["ITEM1MAX"].ToString() != "")
  978. szQJ = "<= " + Drow["ITEM1MAX"].ToString();
  979. reP = sValue(szQJ, EMGrid.Rows[j].Cells[Drow["BASENAME"].ToString()].Value.ToString());
  980. }
  981. }
  982. catch (Exception ex)
  983. {
  984. Console.WriteLine(ex.Message);
  985. }
  986. if (reP == -1 && Drow["std_dc"].ToString() == "2")
  987. {
  988. EMGrid.Rows[j].Cells[Drow["BASENAME"].ToString()].Appearance.ForeColor = Color.FromArgb(204, 153, 0);// Color.Yellow;
  989. }
  990. else if (reP == -1 && Drow["std_dc"].ToString() == "1" && EMGrid.Rows[j].Cells[Drow["BASENAME"].ToString()].Appearance.ForeColor == Color.FromArgb(204, 153, 0))
  991. {
  992. EMGrid.Rows[j].Cells[Drow["BASENAME"].ToString()].Appearance.ForeColor = Color.Red;
  993. }
  994. else if (EMGrid.Rows[j].Cells[Drow["BASENAME"].ToString()].Appearance.ForeColor != Color.FromArgb(204, 153, 0))
  995. {
  996. EMGrid.Rows[j].Cells[Drow["BASENAME"].ToString()].Appearance.ForeColor = Color.Black;
  997. }
  998. break;
  999. }
  1000. }
  1001. }
  1002. }
  1003. }
  1004. }
  1005. }
  1006. }
  1007. catch
  1008. {
  1009. }
  1010. }
  1011. public void GetId(int RowId, Infragistics.Win.UltraWinGrid.UltraGrid GRID)
  1012. {
  1013. int i = RowId;
  1014. if (GRID.Rows[i].Cells[1].Value.ToString().Length > 0)
  1015. {
  1016. if (GRID.Rows[i].Cells[0].Value.ToString().IndexOf("√") < 0)
  1017. {
  1018. GRID.Rows[i].Cells[0].Value = GRID.Rows[i].Cells[0].Value + "√";
  1019. //GRID.Rows [i].Appearance.ForeColor =label3.BackColor ;
  1020. }
  1021. else
  1022. {
  1023. GRID.Rows[i].Cells[0].Value = GRID.Rows[i].Cells[0].Value.ToString().Substring(0, GRID.Rows[i].Cells[0].Value.ToString().IndexOf("√"));
  1024. //GRID.Rows [i].Appearance .ForeColor =label3.ForeColor ;
  1025. }
  1026. }
  1027. }
  1028. private void EMGrid_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
  1029. {
  1030. GetId(e.Row.Index, EMGrid);
  1031. if (EMGrid.Rows[e.Row.Index].Cells[0].Value.ToString().IndexOf("√") > 0)
  1032. {
  1033. frmLgEleConfig.StrT = "02";
  1034. frmLgEleConfig.StrHic = EMGrid.Rows[e.Row.Index].Cells[1].Text.Trim().ToString();
  1035. string szLH = EMGrid.Rows[e.Row.Index].Cells["熔炼号"].Value.ToString();
  1036. string[] szAr = szLH.Split('-');
  1037. szLH = szAr[0];// + szAr[1];
  1038. if (szLH.Length < 9)
  1039. return;
  1040. frmLgEleConfig.strSteelCode = EMGrid.Rows[e.Row.Index].Cells["JHGZ"].Text.Trim().ToString();
  1041. string szJYH = EMGrid.ActiveRow.Cells[1].Value.ToString();
  1042. string szEleStd = "";
  1043. //设置要获取的化学成分标准
  1044. for (int i = 5; i < EMGrid.DisplayLayout.Bands[0].Columns.Count; i++)
  1045. {
  1046. if (EMGrid.DisplayLayout.Bands[0].Columns[i].Hidden == false)
  1047. {
  1048. szEleStd = szEleStd + "','" + EMGrid.DisplayLayout.Bands[0].Columns[i].Header.Caption;
  1049. }
  1050. }
  1051. frmLgEleConfig.szEleStd = szEleStd;
  1052. frmLgEleConfig Azhupi = new frmLgEleConfig( frmLgEleConfig.StrHic, frmLgEleConfig.StrT, szJYH.Substring(9, 1)); // _devPos.Substring(0, 3)
  1053. //frmLgEleConfig WinPlan = new frmLgEleConfig();
  1054. Azhupi.ShowDialog(this);
  1055. }
  1056. }
  1057. private void EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  1058. {
  1059. UltraMaskedEdit ume = (UltraMaskedEdit)sender;
  1060. switch (e.Button.Key)
  1061. {
  1062. case "edit":
  1063. frmNumberWriter frm = new frmNumberWriter();
  1064. frm._strText = ume.Text.Trim();
  1065. frm.Location = GetChildWindowLocation(frm.Size);
  1066. frm.ShowDialog();
  1067. ume.Text = frm._strText;
  1068. break;
  1069. case "clear":
  1070. if (ume.Text.Trim().Length > 0)
  1071. {
  1072. ume.Tag = ume.Text.Trim();
  1073. ume.Text = "";
  1074. }
  1075. else
  1076. {
  1077. if (ume.Tag != null)
  1078. ume.Text = ume.Tag.ToString();
  1079. }
  1080. break;
  1081. }
  1082. }
  1083. /// <summary>
  1084. /// 获取子窗体弹出的位置坐标
  1085. /// </summary>
  1086. /// <param name="ChildWindowSize"></param>
  1087. /// <returns></returns>
  1088. private Point GetChildWindowLocation(Size ChildWindowSize)
  1089. {
  1090. int width = Cursor.Position.X + ChildWindowSize.Width - Screen.PrimaryScreen.Bounds.Width;
  1091. int height = Cursor.Position.Y + ChildWindowSize.Height - Screen.PrimaryScreen.Bounds.Height + 30;
  1092. if (width > 0)
  1093. width = Cursor.Position.X - width;
  1094. else
  1095. width = Cursor.Position.X;
  1096. if (height > 0)
  1097. height = Cursor.Position.Y - height + 10;
  1098. else
  1099. height = Cursor.Position.Y + 10;
  1100. return new Point(width, height);
  1101. }
  1102. #region " Main Code "
  1103. //增加分页显示功能
  1104. private DataSet _dsAll = new DataSet();
  1105. private DataSet _dsSet;
  1106. private int _intBegin = 0;
  1107. private int _intEnd = 20;
  1108. private string _strDuty = "0";
  1109. private string _dvRowFilter = "";
  1110. private string _strWhere1 = "";
  1111. private string _strWhere2 = "";
  1112. private string _szTableName = "";
  1113. public string _devPos = "";
  1114. private Color c1 = Color.PaleGreen;
  1115. private Color c2 = Color.White;
  1116. private void button1_Click(object sender, System.EventArgs e)
  1117. {
  1118. int step = 20;
  1119. try
  1120. {
  1121. step = Convert.ToInt32(this.textBox1.Text.Trim());
  1122. if (step < 1)
  1123. throw new Exception();
  1124. }
  1125. catch
  1126. {
  1127. MessageBox.Show("请输入正确的显示行数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1128. return;
  1129. }
  1130. this.Cursor = Cursors.WaitCursor;
  1131. dataTable1.Clear();
  1132. if (_dsAll.Tables.Count <= 0)
  1133. return;
  1134. int count = _dsAll.Tables[0].DefaultView.Count;
  1135. if (_intBegin < step)
  1136. {
  1137. _intEnd = _intBegin;
  1138. _intBegin = 0;
  1139. }
  1140. else
  1141. {
  1142. _intEnd = _intBegin;
  1143. _intBegin -= step;
  1144. }
  1145. if (_intBegin > 0) this.button1.Enabled = true;
  1146. else button1.Enabled = false;
  1147. if (_intEnd < count) this.button2.Enabled = true;
  1148. else button2.Enabled = false;
  1149. this.label6.Text = String.Format("第 {0} 行到第 {1} 行, 共 {2} 行", _intBegin + 1, _intEnd, count);
  1150. SetEachRowData();
  1151. #region Display Splash widow
  1152. // Update UI
  1153. // UpdateUI(false);
  1154. //
  1155. // //显示提示对话框
  1156. // frmSplash = new SplashForm(this);
  1157. // frmSplash.Show();
  1158. #endregion
  1159. //数据获取启动线程。执行完后关闭
  1160. Thread t = new Thread(new ThreadStart(DoStandFetchReady));
  1161. t.IsBackground = true;
  1162. t.Start();
  1163. }
  1164. private void DoStandFetchReady()
  1165. {
  1166. GetTAM_StandardElement();
  1167. try
  1168. {
  1169. this.Cursor = Cursors.Default;
  1170. }
  1171. catch { }
  1172. //关闭正在取数据的对话框
  1173. // Invoke(new UpdateUIDelegate(UpdateUI), new object[] { true });
  1174. }
  1175. private void button2_Click(object sender, System.EventArgs e)
  1176. {
  1177. int step = 20;
  1178. try
  1179. {
  1180. step = Convert.ToInt32(this.textBox1.Text.Trim());
  1181. if (step < 1)
  1182. throw new Exception();
  1183. }
  1184. catch
  1185. {
  1186. MessageBox.Show("请输入正确的显示行数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1187. return;
  1188. }
  1189. this.Cursor = Cursors.WaitCursor;
  1190. dataTable1.Clear();
  1191. if (_dsAll.Tables.Count <= 0)
  1192. return;
  1193. int count = _dsAll.Tables[0].DefaultView.Count;
  1194. this._intBegin = this._intEnd;
  1195. this._intEnd += step;
  1196. if (_intEnd > count) _intEnd = count;
  1197. if (_intBegin > 0) this.button1.Enabled = true;
  1198. else button1.Enabled = false;
  1199. if (_intEnd < count) this.button2.Enabled = true;
  1200. else button2.Enabled = false;
  1201. this.label6.Text = String.Format("第 {0} 行到第 {1} 行, 共 {2} 行", _intBegin + 1, _intEnd, count);
  1202. SetEachRowData();
  1203. #region Display Splash widow
  1204. // // Update UI
  1205. // UpdateUI(false);
  1206. //
  1207. // //显示提示对话框
  1208. // frmSplash = new SplashForm(this);
  1209. // frmSplash.Show();
  1210. //
  1211. #endregion
  1212. //数据获取启动线程。执行完后关闭
  1213. Thread t = new Thread(new ThreadStart(DoStandFetchReady));
  1214. t.IsBackground = true;
  1215. t.Start();
  1216. this.Cursor = Cursors.Default;
  1217. }
  1218. private void button3_Click(object sender, System.EventArgs e)
  1219. {
  1220. try
  1221. {
  1222. if (_dsAll == null || _dsAll.Tables.Count <= 0)
  1223. return;
  1224. int count = _dsAll.Tables[0].DefaultView.Count;
  1225. if (this.button3.Text == "全部显示")
  1226. {
  1227. this._intBegin = 0;
  1228. this.button3.Text = "分页显示";
  1229. this.button1.Enabled = false;
  1230. this.button2.Enabled = false;
  1231. if (_intEnd == count)
  1232. return;
  1233. else
  1234. this._intEnd = count;
  1235. }
  1236. else
  1237. {
  1238. int step = 20;
  1239. try
  1240. {
  1241. step = Convert.ToInt32(this.textBox1.Text.Trim());
  1242. if (step < 1)
  1243. throw new Exception();
  1244. }
  1245. catch
  1246. {
  1247. MessageBox.Show("请输入正确的显示行数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1248. return;
  1249. }
  1250. this._intBegin = 0;
  1251. if (step < count)
  1252. {
  1253. this._intEnd = step;
  1254. this.button1.Enabled = false;
  1255. this.button2.Enabled = true;
  1256. }
  1257. else
  1258. {
  1259. this._intEnd = count;
  1260. this.button1.Enabled = false;
  1261. this.button2.Enabled = false;
  1262. this.button3.Text = "全部显示";
  1263. return;
  1264. }
  1265. this.button3.Text = "全部显示";
  1266. }
  1267. this.Cursor = Cursors.WaitCursor;
  1268. if (count == 0)
  1269. {
  1270. this.label6.Text = "无数据";
  1271. this.Cursor = Cursors.Default;
  1272. return;
  1273. }
  1274. else
  1275. this.label6.Text = String.Format("第 {0} 行到第 {1} 行, 共 {2} 行", _intBegin, _intEnd, count);
  1276. button3.Enabled = false;
  1277. SetEachRowData();
  1278. button3.Enabled = true;
  1279. #region Display Splash widow
  1280. // Update UI
  1281. // UpdateUI(false);
  1282. //
  1283. // //显示提示对话框
  1284. // frmSplash = new SplashForm(this);
  1285. // frmSplash.Show();
  1286. #endregion
  1287. //数据获取启动线程。执行完后关闭
  1288. Thread t = new Thread(new ThreadStart(DoStandFetchReady));
  1289. t.IsBackground = true;
  1290. t.Start();
  1291. }
  1292. catch
  1293. {
  1294. button3.Enabled = true;
  1295. }
  1296. //GetTAM_StandardElement();
  1297. //this.Cursor = Cursors.Default;
  1298. }
  1299. #region " Delete Code "
  1300. //SplashForm frmSplash = null;
  1301. /// <summary>
  1302. /// Updates the UI.
  1303. /// </summary>
  1304. //private void UpdateUI(bool IsDataLoaded)
  1305. //{
  1306. // if ( IsDataLoaded )
  1307. // {
  1308. // //this.statusBar1.Text = "Done.";
  1309. // //关闭展现的对话框
  1310. // if (this.frmSplash != null)
  1311. // {
  1312. // frmSplash.Reset();
  1313. // frmSplash.Close();
  1314. // }
  1315. // }
  1316. // else
  1317. // {
  1318. // this.BackColor = SystemColors.Control;
  1319. // }
  1320. //}
  1321. #endregion
  1322. #region " Init "
  1323. private void ELEMENTS_Load(object sender, System.EventArgs e)
  1324. {
  1325. EMGrid.Font = new System.Drawing.Font("Tahoma", 9F);
  1326. string strErr = "";
  1327. //获取所有化学成份列名
  1328. DataSet dsElements = null;//hengxing (DataSet)ClientCommon._RemotingHelp.ExecuteMethod(
  1329. // "lgIntegrationQuery",
  1330. // "Core.LgMes.Server.lgIntegrationQuery.LgGeneralInfo",
  1331. // "GetElementRow", null, out strErr);
  1332. if (strErr=="" && dsElements != null)
  1333. {
  1334. foreach (DataRow dr in dsElements.Tables[0].Rows)
  1335. {
  1336. dataTable1.Columns.Add(dr["BaseName"].ToString(), typeof(System.Decimal)); //添加列
  1337. }
  1338. }
  1339. string strElementsRow = ElementsConfig.GetElementsRow(); //调用函数获取要显示的列名
  1340. strERow = strElementsRow.Split('*');
  1341. GetCurrDuty();
  1342. // GetSteelCode();
  1343. dateTimePicker1.Value = DateTime.Today.ToString("yyyy-MM-dd") + " 00:00";
  1344. dateTimePicker2.Value = DateTime.Today.ToString("yyyy-MM-dd") + " 23:59";
  1345. if (_devPos == "0")
  1346. {
  1347. this.comboBox1.SelectedIndex = 1;
  1348. }
  1349. else
  1350. {
  1351. int intIndex = 1;
  1352. switch (_devPos.Substring(0, 3))
  1353. {
  1354. case "HMP":
  1355. intIndex = 0;
  1356. break;
  1357. case "BOF":
  1358. intIndex = 1;
  1359. break;
  1360. case "CAS":
  1361. intIndex = 2;
  1362. break;
  1363. case "LFS":
  1364. intIndex = 3;
  1365. break;
  1366. case "RHS":
  1367. intIndex = 4;
  1368. break;
  1369. case "CCM":
  1370. intIndex = 5;
  1371. break;
  1372. default:
  1373. break;
  1374. }
  1375. comboBox1.SelectedIndex = intIndex;
  1376. }
  1377. this.SetDuty();
  1378. GetDataFromAll();
  1379. StartGetDataThread();
  1380. }
  1381. // private void DoDataFetchCurr()
  1382. // {
  1383. // GetDataFromCurr();
  1384. // //关闭正在取数据的对话框
  1385. //// Invoke(new UpdateUIDelegate(UpdateUI), new object[] { true });
  1386. // }
  1387. // private void DoDataFetchReady()
  1388. // {
  1389. // this.GetDataFromAll();
  1390. // //关闭正在取数据的对话框
  1391. //// Invoke(new UpdateUIDelegate(UpdateUI), new object[] { true });
  1392. // }
  1393. //private string strQualityLH = "";
  1394. private void DoDataFetchQalityReady()
  1395. {
  1396. //this.GetQualityInfo(strQualityLH);
  1397. //关闭正在取数据的对话框
  1398. // Invoke(new UpdateUIDelegate(UpdateUI), new object[] { true });
  1399. }
  1400. // delegate for the UI updater
  1401. public delegate void UpdateUIDelegate(bool IsDataLoaded);
  1402. public void GetQualityInfo(string szLH)
  1403. {
  1404. try
  1405. {
  1406. this.ultraMaskedEdit1.Text = szLH;
  1407. _strWhere1 = String.Format(" where lh like '%{0}%' ", this.ultraMaskedEdit1.Text.Trim());
  1408. object obj = null;//hengxing ClientCommon._RemotingHelp.ExecuteMethod(
  1409. // "lgIntegrationQuery",
  1410. // "Core.LgMes.Server.lgIntegrationQuery.LgGeneralInfo",
  1411. // "SetQualityBackward",
  1412. // new object[] { _strWhere1 }, out strErr);
  1413. _dsAll = obj as DataSet;
  1414. _dsAll.Tables[0].DefaultView.RowFilter = _dvRowFilter;
  1415. SetDataToGrid();
  1416. }
  1417. catch (Exception ex)
  1418. {
  1419. string Msg = ex.Message;
  1420. }
  1421. }
  1422. /// <summary>
  1423. /// 将数据装载到DATASET
  1424. /// </summary>
  1425. private void SetEachRowData()
  1426. {
  1427. try
  1428. {
  1429. DataRow newRow = dataTable1.NewRow();
  1430. DataRow Drow;
  1431. dataTable1.Clear();
  1432. int RowId = this._intBegin + 1;
  1433. for (int i = this._intBegin; i < this._intEnd; i++)
  1434. {
  1435. newRow = dataTable1.NewRow();
  1436. Drow = _dsAll.Tables[0].DefaultView[i].Row;
  1437. newRow[0] = RowId++;
  1438. newRow[1] = Drow["HEATNO"].ToString() + "-" + Drow["ASSAYTYPECODE"].ToString();
  1439. //newRow[2] = Drow["JHGZ"].ToString();
  1440. newRow[2] = Drow["gzbm"].ToString();
  1441. if (Drow["ASSAYDATE"].ToString() != "")
  1442. newRow[3] = Convert.ToDateTime(Drow["ASSAYDATE"]).ToString("yy-MM-dd HH:mm:ss");
  1443. newRow[4] = Drow["GZBM"].ToString();
  1444. newRow[5] = Drow["shiftcode"].ToString();
  1445. foreach (DataColumn dc in _dsAll.Tables[0].Columns)
  1446. {
  1447. foreach (DataColumn dc1 in dataTable1.Columns)
  1448. {
  1449. if (dc1.ColumnName.ToUpper() == dc.ColumnName.ToUpper())
  1450. {
  1451. if (Drow[dc].ToString() != "")
  1452. newRow[dc1] = Drow[dc].ToString();
  1453. break;
  1454. }
  1455. }
  1456. }
  1457. dataTable1.Rows.Add(newRow);
  1458. }
  1459. SetGridRowHidden();
  1460. }
  1461. catch
  1462. {
  1463. }
  1464. }
  1465. /// <summary>
  1466. /// 根据设置隐藏不要显示的列
  1467. /// </summary>
  1468. private void SetGridRowHidden()
  1469. {
  1470. for (int j = 6; j < EMGrid.DisplayLayout.Bands[0].Columns.Count; j++)
  1471. {
  1472. EMGrid.DisplayLayout.Bands[0].Columns[j].Hidden = true;
  1473. EMGrid.DisplayLayout.Bands[0].Columns[j].Width = 60;
  1474. EMGrid.DisplayLayout.Bands[0].Columns[j].CellActivation = Activation.NoEdit;
  1475. EMGrid.DisplayLayout.Bands[0].Columns[0].CellActivation = Activation.NoEdit;
  1476. EMGrid.DisplayLayout.Bands[0].Columns[1].CellActivation = Activation.NoEdit;
  1477. EMGrid.DisplayLayout.Bands[0].Columns[2].CellActivation = Activation.NoEdit;
  1478. EMGrid.DisplayLayout.Bands[0].Columns[3].CellActivation = Activation.NoEdit;
  1479. EMGrid.DisplayLayout.Bands[0].Columns[4].CellActivation = Activation.NoEdit;
  1480. EMGrid.DisplayLayout.Bands[0].Columns[5].CellActivation = Activation.NoEdit;
  1481. }
  1482. for (int i = 0; i < strERow.Length; i++)
  1483. {
  1484. if (!string.IsNullOrEmpty(strERow[i]))
  1485. EMGrid.DisplayLayout.Bands[0].Columns[strERow[i]].Hidden = false;
  1486. }
  1487. for (int j = 0; j < strRowName.Length; j++)
  1488. {
  1489. EMGrid.DisplayLayout.Bands[0].Columns[strRowName[j]].Header.VisiblePosition = j + 4;
  1490. }
  1491. EMGrid.DisplayLayout.Bands[0].Columns[5].Header.VisiblePosition = EMGrid.DisplayLayout.Bands[0].Columns.Count;
  1492. EMGrid.DisplayLayout.Bands[0].Columns[3].Header.VisiblePosition = EMGrid.DisplayLayout.Bands[0].Columns.Count;
  1493. EMGrid.DisplayLayout.Bands[0].Columns[1].Header.Fixed = true;
  1494. EMGrid.DisplayLayout.Bands[0].Columns[2].Header.Fixed = true;
  1495. }
  1496. private void SetDataToGrid()
  1497. {
  1498. this._intBegin = 0;
  1499. this._intEnd = 20;
  1500. if (_dsAll != null)
  1501. {
  1502. //int count = _dsAll.Tables[0].DefaultView.Count;
  1503. int count = _dsAll.Tables[0].Rows.Count;
  1504. if (count <= 20)
  1505. {
  1506. _intEnd = count;
  1507. this.button1.Enabled = false;
  1508. this.button2.Enabled = false;
  1509. this.button3.Enabled = false;
  1510. }
  1511. else
  1512. {
  1513. this.button1.Enabled = false;
  1514. this.button2.Enabled = true;
  1515. this.button3.Enabled = true;
  1516. }
  1517. if (count == 0)
  1518. {
  1519. this.label6.Text = "无数据";
  1520. this.EMGrid.Cursor = System.Windows.Forms.Cursors.Arrow;
  1521. }
  1522. else
  1523. this.label6.Text = String.Format("第 1 行到第 {0} 行, 共 {1} 行", _intEnd, count);
  1524. SetEachRowData();
  1525. GetTAM_StandardElement(); // 取成分割标准对比
  1526. }
  1527. else
  1528. {
  1529. this.label6.Text = "无数据";
  1530. }
  1531. this.EMGrid.Cursor = System.Windows.Forms.Cursors.Arrow;
  1532. }
  1533. #endregion
  1534. #region " ToolBar Event "
  1535. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  1536. {
  1537. switch (e.Tool.Key)
  1538. {
  1539. case "query":
  1540. #region 装载数据
  1541. // Update UI
  1542. // UpdateUI(false);
  1543. //
  1544. // //显示提示对话框
  1545. // frmSplash = new SplashForm(this);
  1546. // frmSplash.Show();
  1547. #endregion
  1548. this.GetDataFromAll();
  1549. //数据获取启动线程。执行完后关闭
  1550. //Thread t = new Thread(new ThreadStart(DoDataFetchReady));
  1551. //t.IsBackground = true;
  1552. //t.Start();
  1553. break;
  1554. case "set": //设置样点
  1555. SetSampling();
  1556. break;
  1557. case "SRow": //设置化学成份字段显示
  1558. SetRowName();
  1559. break;
  1560. case "excel":
  1561. ExportExcel();
  1562. break;
  1563. }
  1564. }
  1565. /// <summary>
  1566. /// 设置化学成份列名
  1567. /// </summary>
  1568. private void SetRowName()
  1569. {
  1570. DataSet dsElements = null;//hengxing (DataSet)ClientCommon._RemotingHelp.ExecuteMethod(
  1571. // "lgIntegrationQuery",
  1572. // "Core.LgMes.Server.lgIntegrationQuery.LgGeneralInfo",
  1573. // "GetElementRow", null, out strErr);
  1574. if (dsElements != null)
  1575. {
  1576. dsElements.Tables[0].Columns.Add(new DataColumn("选择", typeof(System.Boolean)));
  1577. foreach (DataRow dr in dsElements.Tables[0].Rows)
  1578. {
  1579. dr["选择"] = false;
  1580. }
  1581. frmConfigElementsRow frm = new frmConfigElementsRow();
  1582. frm.StartPosition = FormStartPosition.CenterScreen;
  1583. frm.WindowState = FormWindowState.Normal;
  1584. frm._dsSet = dsElements;
  1585. frm.ShowDialog();
  1586. // 判断是否有设置
  1587. if (frm._setFlag)
  1588. {
  1589. string strElementsRow = ElementsConfig.GetElementsRow(); //调用函数获取要显示的列名
  1590. strERow = strElementsRow.Split('*');
  1591. GetDataFromAll();
  1592. }
  1593. }
  1594. }
  1595. /// <summary>
  1596. /// 显示样点
  1597. /// </summary>
  1598. private void SetSampling()
  1599. {
  1600. if (_dsSet == null)
  1601. {
  1602. _dsSet = null;//hengxing (DataSet)ClientCommon._RemotingHelp.ExecuteMethod(
  1603. // "lgIntegrationQuery",
  1604. // "Core.LgMes.Server.lgIntegrationQuery.LgGeneralInfo",
  1605. // "GetDisSampling",
  1606. // null, out strErr);
  1607. _dsSet.Tables[0].Columns.Add(new DataColumn("选择", typeof(System.Boolean)));
  1608. foreach (DataRow dr in _dsSet.Tables[0].Rows)
  1609. {
  1610. dr["选择"] = true;
  1611. }
  1612. }
  1613. frmSetSampling frm = new frmSetSampling();
  1614. frm._dsSet = _dsSet;
  1615. frm.ShowDialog();
  1616. if (frm._setFlag)
  1617. {
  1618. _dsSet = frm._dsSet;
  1619. _dsSet.AcceptChanges();
  1620. _dvRowFilter = "";
  1621. foreach (DataRow dr in _dsSet.Tables[0].Rows)
  1622. {
  1623. if (Convert.ToBoolean(dr["选择"]))
  1624. {
  1625. _dvRowFilter += string.Format("or assaytypecode = '{0}' ", dr[0].ToString());
  1626. }
  1627. }
  1628. if (_dvRowFilter.Length > 0)
  1629. {
  1630. _dvRowFilter = _dvRowFilter.Substring(2, _dvRowFilter.Length - 2);
  1631. }
  1632. GetDataFromAll();
  1633. }
  1634. }
  1635. private void ExportExcel()
  1636. {
  1637. try
  1638. {
  1639. string StrfileName = System.Windows.Forms.Application.StartupPath + "\\Report\\成分明细.xls";
  1640. this.GridExcelExporter.Export(this.EMGrid, StrfileName);
  1641. ProcessStartInfo p = new ProcessStartInfo(StrfileName);
  1642. p.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
  1643. p.WorkingDirectory = Path.GetDirectoryName(StrfileName);
  1644. Process.Start(p);
  1645. }
  1646. catch (Exception ex)
  1647. {
  1648. MessageBox.Show(ex.Message + "\n处理方法:查看(" + System.Windows.Forms.Application.StartupPath + ")目录下是否有[ Report文件夹 ],如果没有请手动创建!");
  1649. }
  1650. }
  1651. #endregion
  1652. #region " 直接打开界面 或 查询 "
  1653. public void GetDataFromAll()
  1654. {
  1655. string strFindName = "";
  1656. for (int i = 0; i < strERow.Length; i++)
  1657. {
  1658. if(!string.IsNullOrEmpty(strERow[i]))
  1659. strFindName = strFindName +"," + strERow[i];
  1660. }
  1661. try
  1662. {
  1663. if (Convert.ToDateTime(dateTimePicker2.Value) < Convert.ToDateTime(dateTimePicker1.Value))
  1664. {
  1665. MessageBox.Show("结束时间必须大于等于开始时间!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  1666. return;
  1667. }
  1668. GetPost();
  1669. GetDuty();
  1670. if (this.ultraMaskedEdit1.Text.Trim().Length > 0 || this.ultraMaskedEdit2.Text.Trim().Length > 0)
  1671. BuildSQLWithID();
  1672. else
  1673. BuildSQLWithOutID();
  1674. object obj = null;//hengxing ClientCommon._RemotingHelp.ExecuteMethod(
  1675. // "lgIntegrationQuery",
  1676. // "Core.LgMes.Server.lgIntegrationQuery.LgGeneralInfo",
  1677. // "GetAllDevElementHis",
  1678. // new object[] { _devPos, _strWhere1, _strWhere2, strFindName }, out strErr);
  1679. _dsAll = obj as DataSet;
  1680. _dsAll.Tables[0].DefaultView.RowFilter = _dvRowFilter;
  1681. SetDataToGrid();
  1682. }
  1683. catch (Exception ex)
  1684. {
  1685. Debug.WriteLine(ex.Message);
  1686. }
  1687. }
  1688. #endregion
  1689. #region " 从作业管理打开界面 "
  1690. public void GetDataFromCurr()
  1691. {
  1692. try
  1693. {
  1694. GetCurrDuty();
  1695. _dsAll = null;//hengxing (DataSet)ClientCommon._RemotingHelp.ExecuteMethod(
  1696. // "lgIntegrationQuery",
  1697. // "Core.LgMes.Server.lgIntegrationQuery.LgGeneralInfo",
  1698. // "GetCurrDevElementHis",
  1699. // new object[] { this._devPos, this._strDuty, GetTableName() }, out strErr);
  1700. _dsAll.Tables[0].DefaultView.RowFilter = _dvRowFilter;
  1701. // SetMaskText();
  1702. SetPost();
  1703. SetDuty();
  1704. SetDataToGrid();
  1705. }
  1706. catch { }
  1707. }
  1708. private void GetCurrDuty()
  1709. {
  1710. try
  1711. {
  1712. string strDuty = "";
  1713. strDuty = "";//hengxing (string)ClientCommon._RemotingHelp.ExecuteMethod(
  1714. // "lgIntegrationQuery",
  1715. // "Core.LgMes.Server.lgIntegrationQuery.LgGeneralInfo",
  1716. // "GetCurrDuty",
  1717. // null, out strErr);
  1718. _strDuty = strDuty.Substring(1, 1);
  1719. return;
  1720. }
  1721. catch { }
  1722. _strDuty = "0";
  1723. }
  1724. //private void GetSteelCode()
  1725. //{
  1726. // try
  1727. // {
  1728. // string strErr = "";
  1729. // object obj = ClientCommon._RemotingHelp.ExecuteMethod(
  1730. // "lgIntegrationQuery",
  1731. // "Core.LgMes.Server.lgIntegrationQuery.LgGeneralInfo",
  1732. // "GetSteelInfo",
  1733. // new object[] { "" }, out strErr);
  1734. // if (strErr == "" && obj != null)
  1735. // {
  1736. // DataSet ds = obj as DataSet;
  1737. // ultraCombo1.DataSource = ds.Tables[0].DefaultView;
  1738. // ultraCombo1.DisplayMember = "STEEL";
  1739. // ultraCombo1.ValueMember = "STEELCODE";
  1740. // ultraCombo1.DisplayLayout.Bands[0].Columns["STEELCODE"].Hidden = true;
  1741. // ultraCombo1.DisplayLayout.Bands[0].Columns["CATALOGID"].Hidden = true;
  1742. // ultraCombo1.DisplayLayout.Bands[0].Columns["STEEL"].Band.ColHeadersVisible = false;
  1743. // ultraCombo1.DisplayLayout.Bands[0].Columns["STEEL"].Width = ultraCombo1.Width;
  1744. // }
  1745. // }
  1746. // catch { }
  1747. //}
  1748. #endregion
  1749. #region " SQL "
  1750. private void BuildSQLWithOutID()
  1751. {
  1752. string begTime = Convert.ToDateTime(dateTimePicker1.Value).ToString("yyyy-MM-dd HH:mm:ss");
  1753. string endTime = Convert.ToDateTime(dateTimePicker2.Value).ToString("yyyy-MM-dd HH:mm:ss");
  1754. _strWhere1 = " where ASSAYDATE between to_date('" + begTime + "','yyyy-MM-dd HH24:mi:ss') and to_date('" + endTime + "','yyyy-MM-dd HH24:mi:ss') ";// substr(samplingid,2,1)<>'T' and
  1755. switch (this.comboBox1.SelectedIndex)
  1756. {
  1757. case 0: // hylxm like '%FE%' or hylxm like 'T' 铁水
  1758. _strWhere1 += " and (ASSAYTYPECODE like 'A%' or ASSAYTYPECODE like 'B%')";
  1759. if (this._strDuty != "0")
  1760. _strWhere1 += " and (substr(SHIFTCODE,2,1) = '" + _strDuty + "' or SHIFTCODE is null)";
  1761. break;
  1762. //case 1: // 转炉
  1763. // _strWhere1 += " and ASSAYTYPECODE like 'C%' or ASSAYTYPECODE like 'V%' ";
  1764. // break;
  1765. //case 2: // 吹氩站
  1766. // _strWhere1 += " and ASSAYTYPECODE like 'D%'";
  1767. // break;
  1768. //case 3: // 精炼炉
  1769. // _strWhere1 += " and ASSAYTYPECODE like 'E%'";
  1770. // break;
  1771. //case 4: // RH炉
  1772. // _strWhere1 += " and ASSAYTYPECODE like 'F%'";
  1773. // break;
  1774. //case 5: // 连铸机
  1775. // _strWhere1 += " and ASSAYTYPECODE like 'G%'";
  1776. // break;
  1777. default:
  1778. // _strWhere1 += " and ASSAYTYPECODE not like 'A%' and ASSAYTYPECODE not like 'B%'";
  1779. break;
  1780. }
  1781. _strWhere2 = " where 1 = 1";
  1782. string str = this._devPos.Substring(0, 3), szWZ = this._devPos.Substring(4, 1);
  1783. if (this._strDuty != "0" && str != "HMP")
  1784. _strWhere2 += string.Format(" and substr(SHIFTCODE,2,1) = '{0}' ", this._strDuty);
  1785. if (str != "HMP" && szWZ != "0" && str != "SYG")
  1786. _strWhere2 += string.Format(" and substr(stationcode,3,1) = '{0}'", szWZ);
  1787. if (txtSteel.Text.Trim() != "")
  1788. str = txtSteel.Text.ToString();//this.textBox2.Text.Trim().ToLower();
  1789. else
  1790. str = "";
  1791. if (str != "")
  1792. {
  1793. string strSteeAll = "";
  1794. string[] strSteel = str.Split(',');
  1795. for (int i = 0; i < strSteel.Length; i++)
  1796. {
  1797. if (!string.IsNullOrEmpty(strSteel[i]))
  1798. strSteeAll = strSteeAll + "'" + strSteel[i] + "',";
  1799. }
  1800. str = strSteeAll.Substring(0, strSteeAll.Length - 1);
  1801. _strWhere2 += string.Format(" and STEELNAME in ({0})", str); // lower(b.jhgz)
  1802. }
  1803. //气体样
  1804. if (chkGasSample.Checked)
  1805. {
  1806. _strWhere2 += " and (N>0 or H>0 or O>0) ";
  1807. }
  1808. }
  1809. private void BuildSQLWithID()
  1810. {
  1811. //熔炼号从
  1812. if (this.ultraMaskedEdit1.Text.Length == 0)
  1813. {
  1814. _strWhere1 = String.Format(" where HEATNO like '%{0}%' ", this.ultraMaskedEdit2.Text.Trim());
  1815. }
  1816. else
  1817. {
  1818. if (this.ultraMaskedEdit2.Text.Length == 0)
  1819. {
  1820. _strWhere1 = String.Format(" where HEATNO like '%{0}%' ", this.ultraMaskedEdit1.Text.Trim());
  1821. }
  1822. else
  1823. {
  1824. _strWhere1 = String.Format(" where HEATNO between '{0}' and '{1}' ", this.ultraMaskedEdit1.Text.Trim(), this.ultraMaskedEdit2.Text.Trim());
  1825. }
  1826. }
  1827. switch (this.comboBox1.SelectedIndex)
  1828. {
  1829. case 0: // hylxm like '%FE%' or hylxm like 'T' 铁水
  1830. _strWhere1 += " and (ASSAYTYPECODE like 'A%' or ASSAYTYPECODE like 'B%')";
  1831. if (this._strDuty != "0")
  1832. _strWhere1 += " and (substr(SHIFTCODE,2,1) = '" + _strDuty + "' or SHIFTCODE is null)";
  1833. break;
  1834. //case 1: // 转炉
  1835. // _strWhere1 += " and ASSAYTYPECODE like 'C%'";
  1836. // break;
  1837. //case 2: // 吹氩站
  1838. // _strWhere1 += " and ASSAYTYPECODE like 'D%'";
  1839. // break;
  1840. //case 3: // 精炼炉
  1841. // _strWhere1 += " and ASSAYTYPECODE like 'E%'";
  1842. // break;
  1843. //case 4: // RH炉
  1844. // _strWhere1 += " and ASSAYTYPECODE like 'F%'";
  1845. // break;
  1846. //case 5: // 连铸机
  1847. // _strWhere1 += " and ASSAYTYPECODE like 'G%'";
  1848. // break;
  1849. default:
  1850. //_strWhere1 += " and ASSAYTYPECODE not like 'A%' and ASSAYTYPECODE not like 'B%'";
  1851. break;
  1852. }
  1853. _strWhere2 = " where 1=1";
  1854. string str = this._devPos.Substring(0, 3), szWZ = this._devPos.Substring(4, 1);
  1855. if (this._strDuty != "0" && str != "HMP")
  1856. _strWhere2 += string.Format(" and substr(SHIFTCODE,2,1) = '{0}' ", this._strDuty);
  1857. if (str != "HMP" && szWZ != "0" && str != "SYG")
  1858. _strWhere2 += string.Format(" and substr(stationcode,3,1) = '{0}'", szWZ);
  1859. if (txtSteel.Text.Trim() != "")
  1860. str = txtSteel.Text.ToString();//this.textBox2.Text.Trim().ToLower();
  1861. else
  1862. str = "";
  1863. if (str != "")
  1864. {
  1865. string strSteeAll = "";
  1866. string[] strSteel = str.Split(',');
  1867. for (int i = 0; i < strSteel.Length; i++)
  1868. {
  1869. if (!string.IsNullOrEmpty(strSteel[i]))
  1870. strSteeAll = strSteeAll + "'" + strSteel[i] + "',";
  1871. }
  1872. str = strSteeAll.Substring(0, strSteeAll.Length - 1);
  1873. _strWhere2 += string.Format(" and STEELNAME in ({0})", str); // lower(b.jhgz)
  1874. }
  1875. //气体样
  1876. if (chkGasSample.Checked)
  1877. {
  1878. _strWhere2 += " and (N>0 or H>0 or O>0) ";
  1879. }
  1880. }
  1881. #endregion
  1882. #region " ComboBox Event "
  1883. private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
  1884. {
  1885. this.comboBox2.Items.Clear();
  1886. this.comboBox2.Items.AddRange(GetComboBox2Items(this.comboBox1.SelectedIndex));
  1887. this.comboBox2.SelectedIndex = 0;
  1888. intSelectedIndex = comboBox1.SelectedIndex;
  1889. }
  1890. private object[] GetComboBox2Items(int index)
  1891. {
  1892. switch (index)
  1893. {
  1894. case 1:
  1895. return new object[] { "所有", "1#转炉", "2#转炉", "3#转炉" };
  1896. case 2:
  1897. return new object[] { "所有", "1#吹氩站", "2#吹氩站", "3#吹氩站" };
  1898. case 3:
  1899. return new object[] { "所有", "1#精炼炉", "2#精炼炉" };
  1900. case 4:
  1901. return new object[] { "所有", "1#RH炉" };
  1902. case 5:
  1903. return new object[] { "所有", "1#连铸", "2#连铸", "3#连铸", "4#连铸" };
  1904. default:
  1905. return new object[] { "所有铁水" };
  1906. }
  1907. }
  1908. #endregion
  1909. #region " Common Event "
  1910. private Color SetRowBackColor(UltraGridRow ugr, Color frc, bool ifSame)
  1911. {
  1912. Color c;
  1913. if (ifSame)
  1914. {
  1915. c = frc;
  1916. }
  1917. else
  1918. {
  1919. if (frc == c1)
  1920. c = c2;
  1921. else
  1922. c = c1;
  1923. }
  1924. ugr.Appearance.BackColor = c;
  1925. return c;
  1926. }
  1927. private void SetMaskText()
  1928. {
  1929. try
  1930. {
  1931. this.ultraMaskedEdit1.Text = "";
  1932. this.ultraMaskedEdit2.Text = "";
  1933. if (this._devPos.Substring(0, 3) == "BOF" || this._devPos.Substring(0, 3) == "CAS")
  1934. {
  1935. int count = _dsAll.Tables[0].Rows.Count;
  1936. if (count > 1)
  1937. {
  1938. this.ultraMaskedEdit1.Text = _dsAll.Tables[0].Rows[count - 1]["LH"].ToString();
  1939. this.ultraMaskedEdit2.Text = _dsAll.Tables[0].Rows[0]["LH"].ToString();
  1940. }
  1941. else if (count == 1)
  1942. {
  1943. this.ultraMaskedEdit1.Text = _dsAll.Tables[0].Rows[count - 1]["LH"].ToString();
  1944. }
  1945. }
  1946. }
  1947. catch { }
  1948. }
  1949. private void GetPost()
  1950. {
  1951. this._devPos = "";
  1952. switch (this.comboBox1.SelectedIndex)
  1953. {
  1954. case 0:
  1955. this._devPos = "HMP0";
  1956. this._szTableName = "JOB_HMP_OPTINFO";
  1957. break;
  1958. case 1:
  1959. this._devPos = "BOF0";
  1960. this._szTableName = "JOB_BOF_OPTINFO";
  1961. break;
  1962. case 2:
  1963. this._devPos = "CAS0";
  1964. this._szTableName = "JOB_CAS_OPTINFO";
  1965. break;
  1966. case 3:
  1967. this._devPos = "LFS0";
  1968. this._szTableName = "JOB_LFS_OPTINFO";
  1969. break;
  1970. case 4:
  1971. this._devPos = "LFS0";
  1972. this._szTableName = "JOB_RHS_OPTINFO";
  1973. break;
  1974. case 5:
  1975. this._devPos = "CCM0";
  1976. this._szTableName = "JOB_CCM_OPTINFO";
  1977. break;
  1978. default:
  1979. this._devPos = "SYGW"; // 所有岗位
  1980. this._szTableName = "";
  1981. break;
  1982. }
  1983. this._devPos += this.comboBox2.SelectedIndex;
  1984. }
  1985. private string GetTableName()
  1986. {
  1987. string szTableName = "";
  1988. switch (_devPos.Substring(0, 3))
  1989. {
  1990. case "HMP":
  1991. szTableName = "JOB_HMP_OPTINFO";
  1992. break;
  1993. case "BOF":
  1994. szTableName = "JOB_BOF_OPTINFO";
  1995. break;
  1996. case "CAS":
  1997. szTableName = "JOB_CAS_OPTINFO";
  1998. break;
  1999. case "LFS":
  2000. szTableName = "JOB_LFS_OPTINFO";
  2001. break;
  2002. case "CCM":
  2003. szTableName = "JOB_CCM_OPTINFO";
  2004. break;
  2005. default:
  2006. break;
  2007. }
  2008. return szTableName;
  2009. }
  2010. /// <summary>
  2011. /// 设置设备选择框
  2012. /// </summary>
  2013. private void SetPost()
  2014. {
  2015. this._devPos = CurrectDevPos(this._devPos);
  2016. if (_devPos.Length < 5) return;
  2017. switch (_devPos.Substring(0, 3))
  2018. {
  2019. case "HMP":
  2020. this.comboBox1.SelectedIndex = 0;
  2021. break;
  2022. case "BOF":
  2023. this.comboBox1.SelectedIndex = 1;
  2024. break;
  2025. case "CAS":
  2026. this.comboBox1.SelectedIndex = 2;
  2027. break;
  2028. case "LFS":
  2029. this.comboBox1.SelectedIndex = 3;
  2030. break;
  2031. case "RHS":
  2032. this.comboBox1.SelectedIndex = 4;
  2033. break;
  2034. case "CCM":
  2035. this.comboBox1.SelectedIndex = 5;
  2036. break;
  2037. }
  2038. this.comboBox2.SelectedIndex = Convert.ToInt32(_devPos.Substring(4, 1));
  2039. }
  2040. private void GetDuty()
  2041. {
  2042. this._strDuty = this.comboBox3.SelectedIndex.ToString();
  2043. }
  2044. /// <summary>
  2045. /// 设置班组下拉框
  2046. /// </summary>
  2047. private void SetDuty()
  2048. {
  2049. try
  2050. {
  2051. this.comboBox3.SelectedIndex = Convert.ToInt32(this._strDuty);
  2052. }
  2053. catch { }
  2054. }
  2055. private string CurrectDevPos(string devPos)
  2056. {
  2057. if (devPos.Length < 5) return "";
  2058. if (devPos.Substring(0, 3) == "BOF")
  2059. {
  2060. switch (devPos.Substring(4, 1))
  2061. {
  2062. case "7":
  2063. devPos = devPos.Replace("7", "1");
  2064. break;
  2065. case "8":
  2066. devPos = devPos.Replace("8", "2");
  2067. break;
  2068. case "9":
  2069. devPos = devPos.Replace("9", "3");
  2070. break;
  2071. }
  2072. }
  2073. return devPos;
  2074. }
  2075. #endregion
  2076. #region " Auto Refresh "
  2077. private Thread _getDataThread;
  2078. private bool On_Off_GetDataThread = false;
  2079. private delegate void getDataFromAllDelegate();
  2080. private void StartGetDataThread()
  2081. {
  2082. try
  2083. {
  2084. ThreadStart ts = new ThreadStart(GetDataThread);
  2085. _getDataThread = new Thread(ts);
  2086. _getDataThread.Name = "GetDataThread ";
  2087. _getDataThread.Start();
  2088. }
  2089. catch { }
  2090. }
  2091. // public bool On_Off_Thread = true; ////////////////////////////////////////////////////////////////
  2092. private void GetDataThread()
  2093. {
  2094. ReStartGetDataThread:
  2095. while (true)
  2096. {
  2097. if (!this.On_Off_Thread || !On_Off_GetDataThread)
  2098. {
  2099. System.Threading.Thread.Sleep(500);
  2100. continue;
  2101. }
  2102. try
  2103. {
  2104. this.Invoke(new getDataFromAllDelegate(GetDataFromAll));
  2105. System.Threading.Thread.Sleep(3000);
  2106. }
  2107. catch
  2108. { }
  2109. }
  2110. goto ReStartGetDataThread;
  2111. }
  2112. private void checkBox1_CheckedChanged(object sender, System.EventArgs e)
  2113. {
  2114. On_Off_GetDataThread = this.checkBox1.Checked;
  2115. }
  2116. #endregion
  2117. private int nRow = -1;
  2118. private Color c3 = Color.White;
  2119. private bool bColor = false;
  2120. private void EMGrid_Click(object sender, System.EventArgs e)
  2121. {
  2122. if (this.EMGrid.ActiveRow != null)
  2123. {
  2124. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow rw in this.EMGrid.Rows)
  2125. {
  2126. if (rw.Appearance.BackColor == Color.LightBlue)
  2127. rw.Appearance.BackColor = Color.White;
  2128. }
  2129. // if(this.EMGrid.ActiveRow.Appearance.BackColor == Color.PaleGreen)
  2130. // MessageBox.Show("PaleGreen");
  2131. if (bColor)
  2132. {
  2133. if (nRow < EMGrid.Rows.Count)
  2134. this.EMGrid.Rows[nRow].Appearance.BackColor = c3;
  2135. }
  2136. else
  2137. {
  2138. bColor = true;
  2139. }
  2140. c3 = this.EMGrid.ActiveRow.Appearance.BackColor;
  2141. nRow = this.EMGrid.ActiveRow.Index;
  2142. this.EMGrid.ActiveRow.Appearance.BackColor = Color.LightBlue;
  2143. }
  2144. }
  2145. #endregion
  2146. }
  2147. }