frmMaintenance.cs 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061
  1. using System;
  2. using System.Data;
  3. using System.Drawing;
  4. using System.Collections.Generic;
  5. using System.Collections;
  6. using System.ComponentModel;
  7. using System.Windows.Forms;
  8. using CoreFS.CA06;
  9. using Core.StlMes.Client.LgCommon;
  10. namespace Core.StlMes.Client.LgResMgt
  11. {
  12. /// <summary>
  13. /// Department 的摘要说明。
  14. /// </summary>
  15. public class frmMaintenance : frmStyleBase
  16. {
  17. private System.Data.DataSet dataSet1;
  18. private System.Data.DataTable dataTable1;
  19. private Infragistics.Win.UltraWinGrid.UltraGrid ultraGrid2;
  20. private System.ComponentModel.IContainer components;
  21. private Infragistics.Win.Misc.UltraExpandableGroupBox ultraExpandableGroupBox1;
  22. private Infragistics.Win.Misc.UltraExpandableGroupBoxPanel ultraExpandableGroupBoxPanel1;
  23. private System.Windows.Forms.Panel FrmBase_Fill_Panel;
  24. private System.Windows.Forms.Label Lb_GWCODE;
  25. private System.Windows.Forms.Label label1;
  26. private System.Windows.Forms.TextBox tb_XMCODE;
  27. private System.Windows.Forms.TextBox tb_XMNAME;
  28. private string strError = null;
  29. private Infragistics.Win.Misc.UltraGroupBox ultraGroupBox1;
  30. private System.Data.DataColumn XMCode;
  31. private System.Data.DataColumn XMName;
  32. private DataColumn XMType;
  33. private DataColumn GWName;
  34. private Infragistics.Win.UltraWinEditors.UltraComboEditor uce_XMType;
  35. private Label label2;
  36. private Label label3;
  37. private CheckBox chkGWName;
  38. private CheckBox chkItemType;
  39. private Infragistics.Win.UltraWinEditors.UltraComboEditor cmbPosition;
  40. private Infragistics.Win.UltraWinEditors.UltraComboEditor cmbType;
  41. private Infragistics.Win.Misc.UltraPanel ultraPanel1;
  42. private Infragistics.Win.UltraWinEditors.UltraComboEditor uce_GWName;
  43. private DataColumn dataColumn1;
  44. string strLG_ZG = "LG"; //判断是炼钢还是轧钢
  45. /// <summary>
  46. ///
  47. /// </summary>
  48. public frmMaintenance()
  49. {
  50. //
  51. // Windows 窗体设计器支持所必需的
  52. //
  53. InitializeComponent();
  54. //
  55. // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
  56. //
  57. }
  58. /// <summary>
  59. /// 清理所有正在使用的资源。
  60. /// </summary>
  61. protected override void Dispose( bool disposing )
  62. {
  63. if( disposing )
  64. {
  65. if(components != null)
  66. {
  67. components.Dispose();
  68. }
  69. }
  70. base.Dispose( disposing );
  71. }
  72. #region Windows 窗体设计器生成的代码
  73. /// <summary>
  74. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  75. /// 此方法的内容。
  76. /// </summary>
  77. private void InitializeComponent()
  78. {
  79. Infragistics.Win.UltraWinGrid.UltraGridBand ultraGridBand1 = new Infragistics.Win.UltraWinGrid.UltraGridBand("Table1", -1);
  80. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn1 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("ItemCode");
  81. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn2 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("ItemName");
  82. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn3 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("ItemType");
  83. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn4 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("STATIONCODE");
  84. Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn5 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("DESCRIPTION");
  85. Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
  86. Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance();
  87. Infragistics.Win.ValueListItem valueListItem5 = new Infragistics.Win.ValueListItem();
  88. Infragistics.Win.ValueListItem valueListItem6 = new Infragistics.Win.ValueListItem();
  89. Infragistics.Win.ValueListItem valueListItem7 = new Infragistics.Win.ValueListItem();
  90. Infragistics.Win.ValueListItem valueListItem8 = new Infragistics.Win.ValueListItem();
  91. Infragistics.Win.ValueListItem valueListItem31 = new Infragistics.Win.ValueListItem();
  92. Infragistics.Win.ValueListItem valueListItem32 = new Infragistics.Win.ValueListItem();
  93. Infragistics.Win.ValueListItem valueListItem33 = new Infragistics.Win.ValueListItem();
  94. Infragistics.Win.ValueListItem valueListItem9 = new Infragistics.Win.ValueListItem();
  95. Infragistics.Win.ValueListItem valueListItem10 = new Infragistics.Win.ValueListItem();
  96. Infragistics.Win.ValueListItem valueListItem34 = new Infragistics.Win.ValueListItem();
  97. Infragistics.Win.ValueListItem valueListItem35 = new Infragistics.Win.ValueListItem();
  98. Infragistics.Win.ValueListItem valueListItem36 = new Infragistics.Win.ValueListItem();
  99. Infragistics.Win.ValueListItem valueListItem11 = new Infragistics.Win.ValueListItem();
  100. Infragistics.Win.ValueListItem valueListItem12 = new Infragistics.Win.ValueListItem();
  101. Infragistics.Win.ValueListItem valueListItem37 = new Infragistics.Win.ValueListItem();
  102. Infragistics.Win.ValueListItem valueListItem15 = new Infragistics.Win.ValueListItem();
  103. Infragistics.Win.ValueListItem valueListItem16 = new Infragistics.Win.ValueListItem();
  104. Infragistics.Win.ValueListItem valueListItem17 = new Infragistics.Win.ValueListItem();
  105. Infragistics.Win.ValueListItem valueListItem38 = new Infragistics.Win.ValueListItem();
  106. Infragistics.Win.ValueListItem valueListItem39 = new Infragistics.Win.ValueListItem();
  107. Infragistics.Win.ValueListItem valueListItem2 = new Infragistics.Win.ValueListItem();
  108. Infragistics.Win.ValueListItem valueListItem1 = new Infragistics.Win.ValueListItem();
  109. Infragistics.Win.Appearance appearance6 = new Infragistics.Win.Appearance();
  110. Infragistics.Win.ValueListItem valueListItem13 = new Infragistics.Win.ValueListItem();
  111. Infragistics.Win.ValueListItem valueListItem14 = new Infragistics.Win.ValueListItem();
  112. Infragistics.Win.ValueListItem valueListItem40 = new Infragistics.Win.ValueListItem();
  113. Infragistics.Win.ValueListItem valueListItem41 = new Infragistics.Win.ValueListItem();
  114. Infragistics.Win.ValueListItem valueListItem42 = new Infragistics.Win.ValueListItem();
  115. Infragistics.Win.ValueListItem valueListItem43 = new Infragistics.Win.ValueListItem();
  116. Infragistics.Win.ValueListItem valueListItem44 = new Infragistics.Win.ValueListItem();
  117. Infragistics.Win.ValueListItem valueListItem45 = new Infragistics.Win.ValueListItem();
  118. Infragistics.Win.ValueListItem valueListItem46 = new Infragistics.Win.ValueListItem();
  119. Infragistics.Win.ValueListItem valueListItem47 = new Infragistics.Win.ValueListItem();
  120. Infragistics.Win.ValueListItem valueListItem48 = new Infragistics.Win.ValueListItem();
  121. Infragistics.Win.ValueListItem valueListItem49 = new Infragistics.Win.ValueListItem();
  122. Infragistics.Win.ValueListItem valueListItem50 = new Infragistics.Win.ValueListItem();
  123. Infragistics.Win.ValueListItem valueListItem51 = new Infragistics.Win.ValueListItem();
  124. Infragistics.Win.ValueListItem valueListItem52 = new Infragistics.Win.ValueListItem();
  125. Infragistics.Win.ValueListItem valueListItem53 = new Infragistics.Win.ValueListItem();
  126. Infragistics.Win.ValueListItem valueListItem54 = new Infragistics.Win.ValueListItem();
  127. Infragistics.Win.ValueListItem valueListItem55 = new Infragistics.Win.ValueListItem();
  128. Infragistics.Win.ValueListItem valueListItem56 = new Infragistics.Win.ValueListItem();
  129. Infragistics.Win.ValueListItem valueListItem57 = new Infragistics.Win.ValueListItem();
  130. Infragistics.Win.Appearance appearance5 = new Infragistics.Win.Appearance();
  131. Infragistics.Win.ValueListItem valueListItem4 = new Infragistics.Win.ValueListItem();
  132. Infragistics.Win.ValueListItem valueListItem3 = new Infragistics.Win.ValueListItem();
  133. this.dataSet1 = new System.Data.DataSet();
  134. this.dataTable1 = new System.Data.DataTable();
  135. this.XMCode = new System.Data.DataColumn();
  136. this.XMName = new System.Data.DataColumn();
  137. this.XMType = new System.Data.DataColumn();
  138. this.GWName = new System.Data.DataColumn();
  139. this.dataColumn1 = new System.Data.DataColumn();
  140. this.ultraGrid2 = new Infragistics.Win.UltraWinGrid.UltraGrid();
  141. this.ultraExpandableGroupBox1 = new Infragistics.Win.Misc.UltraExpandableGroupBox();
  142. this.ultraExpandableGroupBoxPanel1 = new Infragistics.Win.Misc.UltraExpandableGroupBoxPanel();
  143. this.ultraPanel1 = new Infragistics.Win.Misc.UltraPanel();
  144. this.uce_GWName = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
  145. this.tb_XMNAME = new System.Windows.Forms.TextBox();
  146. this.tb_XMCODE = new System.Windows.Forms.TextBox();
  147. this.Lb_GWCODE = new System.Windows.Forms.Label();
  148. this.label1 = new System.Windows.Forms.Label();
  149. this.label3 = new System.Windows.Forms.Label();
  150. this.uce_XMType = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
  151. this.label2 = new System.Windows.Forms.Label();
  152. this.cmbPosition = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
  153. this.cmbType = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
  154. this.chkGWName = new System.Windows.Forms.CheckBox();
  155. this.chkItemType = new System.Windows.Forms.CheckBox();
  156. this.FrmBase_Fill_Panel = new System.Windows.Forms.Panel();
  157. this.ultraGroupBox1 = new Infragistics.Win.Misc.UltraGroupBox();
  158. ((System.ComponentModel.ISupportInitialize)(this.dataSet1)).BeginInit();
  159. ((System.ComponentModel.ISupportInitialize)(this.dataTable1)).BeginInit();
  160. ((System.ComponentModel.ISupportInitialize)(this.ultraGrid2)).BeginInit();
  161. ((System.ComponentModel.ISupportInitialize)(this.ultraExpandableGroupBox1)).BeginInit();
  162. this.ultraExpandableGroupBox1.SuspendLayout();
  163. this.ultraExpandableGroupBoxPanel1.SuspendLayout();
  164. this.ultraPanel1.ClientArea.SuspendLayout();
  165. this.ultraPanel1.SuspendLayout();
  166. ((System.ComponentModel.ISupportInitialize)(this.uce_GWName)).BeginInit();
  167. ((System.ComponentModel.ISupportInitialize)(this.uce_XMType)).BeginInit();
  168. ((System.ComponentModel.ISupportInitialize)(this.cmbPosition)).BeginInit();
  169. ((System.ComponentModel.ISupportInitialize)(this.cmbType)).BeginInit();
  170. this.FrmBase_Fill_Panel.SuspendLayout();
  171. ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).BeginInit();
  172. this.ultraGroupBox1.SuspendLayout();
  173. this.SuspendLayout();
  174. //
  175. // dataSet1
  176. //
  177. this.dataSet1.DataSetName = "NewDataSet";
  178. this.dataSet1.Locale = new System.Globalization.CultureInfo("zh-CN");
  179. this.dataSet1.Tables.AddRange(new System.Data.DataTable[] {
  180. this.dataTable1});
  181. //
  182. // dataTable1
  183. //
  184. this.dataTable1.Columns.AddRange(new System.Data.DataColumn[] {
  185. this.XMCode,
  186. this.XMName,
  187. this.XMType,
  188. this.GWName,
  189. this.dataColumn1});
  190. this.dataTable1.TableName = "Table1";
  191. //
  192. // XMCode
  193. //
  194. this.XMCode.Caption = "项目编码";
  195. this.XMCode.ColumnName = "ItemCode";
  196. this.XMCode.ReadOnly = true;
  197. //
  198. // XMName
  199. //
  200. this.XMName.Caption = "项目名称";
  201. this.XMName.ColumnName = "ItemName";
  202. //
  203. // XMType
  204. //
  205. this.XMType.Caption = "项目类型";
  206. this.XMType.ColumnName = "ItemType";
  207. //
  208. // GWName
  209. //
  210. this.GWName.Caption = "岗位名称";
  211. this.GWName.ColumnName = "STATIONCODE";
  212. //
  213. // dataColumn1
  214. //
  215. this.dataColumn1.ColumnName = "DESCRIPTION";
  216. //
  217. // ultraGrid2
  218. //
  219. this.ultraGrid2.DataMember = "Table1";
  220. this.ultraGrid2.DataSource = this.dataSet1;
  221. ultraGridColumn1.CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  222. ultraGridColumn1.Header.VisiblePosition = 0;
  223. ultraGridColumn1.Hidden = true;
  224. ultraGridColumn2.CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  225. ultraGridColumn2.Header.VisiblePosition = 1;
  226. ultraGridColumn2.Width = 164;
  227. ultraGridColumn3.CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
  228. ultraGridColumn3.Header.VisiblePosition = 2;
  229. ultraGridColumn3.Width = 147;
  230. ultraGridColumn4.Header.VisiblePosition = 3;
  231. ultraGridColumn5.Header.Caption = "描述";
  232. ultraGridColumn5.Header.VisiblePosition = 4;
  233. ultraGridColumn5.Hidden = true;
  234. ultraGridBand1.Columns.AddRange(new object[] {
  235. ultraGridColumn1,
  236. ultraGridColumn2,
  237. ultraGridColumn3,
  238. ultraGridColumn4,
  239. ultraGridColumn5});
  240. this.ultraGrid2.DisplayLayout.BandsSerializer.Add(ultraGridBand1);
  241. this.ultraGrid2.DisplayLayout.GroupByBox.Hidden = true;
  242. this.ultraGrid2.DisplayLayout.ViewStyleBand = Infragistics.Win.UltraWinGrid.ViewStyleBand.OutlookGroupBy;
  243. this.ultraGrid2.Dock = System.Windows.Forms.DockStyle.Fill;
  244. this.ultraGrid2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  245. this.ultraGrid2.Location = new System.Drawing.Point(0, 40);
  246. this.ultraGrid2.Name = "ultraGrid2";
  247. this.ultraGrid2.Size = new System.Drawing.Size(888, 313);
  248. this.ultraGrid2.TabIndex = 0;
  249. this.ultraGrid2.AfterRowActivate += new System.EventHandler(this.ultraGrid2_AfterRowActivate);
  250. //
  251. // ultraExpandableGroupBox1
  252. //
  253. appearance1.BackColor = System.Drawing.SystemColors.Control;
  254. this.ultraExpandableGroupBox1.Appearance = appearance1;
  255. this.ultraExpandableGroupBox1.Controls.Add(this.ultraExpandableGroupBoxPanel1);
  256. this.ultraExpandableGroupBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
  257. this.ultraExpandableGroupBox1.ExpandedSize = new System.Drawing.Size(888, 100);
  258. this.ultraExpandableGroupBox1.Location = new System.Drawing.Point(0, 353);
  259. this.ultraExpandableGroupBox1.Name = "ultraExpandableGroupBox1";
  260. this.ultraExpandableGroupBox1.Size = new System.Drawing.Size(888, 100);
  261. this.ultraExpandableGroupBox1.TabIndex = 1;
  262. this.ultraExpandableGroupBox1.Text = "编辑区";
  263. this.ultraExpandableGroupBox1.ViewStyle = Infragistics.Win.Misc.GroupBoxViewStyle.VisualStudio2005;
  264. //
  265. // ultraExpandableGroupBoxPanel1
  266. //
  267. this.ultraExpandableGroupBoxPanel1.Controls.Add(this.ultraPanel1);
  268. this.ultraExpandableGroupBoxPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
  269. this.ultraExpandableGroupBoxPanel1.Location = new System.Drawing.Point(2, 20);
  270. this.ultraExpandableGroupBoxPanel1.Name = "ultraExpandableGroupBoxPanel1";
  271. this.ultraExpandableGroupBoxPanel1.Size = new System.Drawing.Size(884, 78);
  272. this.ultraExpandableGroupBoxPanel1.TabIndex = 0;
  273. //
  274. // ultraPanel1
  275. //
  276. this.ultraPanel1.AutoScroll = true;
  277. //
  278. // ultraPanel1.ClientArea
  279. //
  280. this.ultraPanel1.ClientArea.Controls.Add(this.uce_GWName);
  281. this.ultraPanel1.ClientArea.Controls.Add(this.tb_XMNAME);
  282. this.ultraPanel1.ClientArea.Controls.Add(this.tb_XMCODE);
  283. this.ultraPanel1.ClientArea.Controls.Add(this.Lb_GWCODE);
  284. this.ultraPanel1.ClientArea.Controls.Add(this.label1);
  285. this.ultraPanel1.ClientArea.Controls.Add(this.label3);
  286. this.ultraPanel1.ClientArea.Controls.Add(this.uce_XMType);
  287. this.ultraPanel1.ClientArea.Controls.Add(this.label2);
  288. this.ultraPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
  289. this.ultraPanel1.Location = new System.Drawing.Point(0, 0);
  290. this.ultraPanel1.Name = "ultraPanel1";
  291. this.ultraPanel1.Size = new System.Drawing.Size(884, 78);
  292. this.ultraPanel1.TabIndex = 4;
  293. //
  294. // uce_GWName
  295. //
  296. appearance4.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel;
  297. appearance4.BorderColor = System.Drawing.Color.Black;
  298. this.uce_GWName.Appearance = appearance4;
  299. this.uce_GWName.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
  300. this.uce_GWName.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
  301. this.uce_GWName.Font = new System.Drawing.Font("宋体", 9F);
  302. valueListItem5.DataValue = "HMP01";
  303. valueListItem5.DisplayText = "1#脱硫";
  304. valueListItem6.DataValue = "HMP02";
  305. valueListItem6.DisplayText = "2#脱硫";
  306. valueListItem7.DataValue = "BOF01";
  307. valueListItem7.DisplayText = "1#转炉";
  308. valueListItem8.DataValue = "BOF02";
  309. valueListItem8.DisplayText = "2#转炉";
  310. valueListItem31.DataValue = "BOF03";
  311. valueListItem31.DisplayText = "3#转炉";
  312. valueListItem32.DataValue = "BOF04";
  313. valueListItem32.DisplayText = "4#转炉";
  314. valueListItem33.DataValue = "BOF05";
  315. valueListItem33.DisplayText = "5#转炉";
  316. valueListItem9.DataValue = "CAS01";
  317. valueListItem9.DisplayText = "1#吹氩";
  318. valueListItem10.DataValue = "CAS02";
  319. valueListItem10.DisplayText = "2#吹氩";
  320. valueListItem34.DataValue = "CAS03";
  321. valueListItem34.DisplayText = "3#吹氩";
  322. valueListItem35.DataValue = "CAS04";
  323. valueListItem35.DisplayText = "4#吹氩";
  324. valueListItem36.DataValue = "CAS05";
  325. valueListItem36.DisplayText = "5#吹氩";
  326. valueListItem11.DataValue = "LFS01";
  327. valueListItem11.DisplayText = "1#精炼";
  328. valueListItem12.DataValue = "LFS02";
  329. valueListItem12.DisplayText = "2#精炼";
  330. valueListItem37.DataValue = "LFS03";
  331. valueListItem37.DisplayText = "3#精炼";
  332. valueListItem15.DataValue = "CCM01";
  333. valueListItem15.DisplayText = "1#连铸机";
  334. valueListItem16.DataValue = "CCM02";
  335. valueListItem16.DisplayText = "2#连铸机";
  336. valueListItem17.DataValue = "CCM03";
  337. valueListItem17.DisplayText = "3#连铸机";
  338. valueListItem38.DataValue = "CCM04";
  339. valueListItem38.DisplayText = "4#连铸机";
  340. valueListItem39.DataValue = "CCM05";
  341. valueListItem39.DisplayText = "5#连铸机";
  342. this.uce_GWName.Items.AddRange(new Infragistics.Win.ValueListItem[] {
  343. valueListItem5,
  344. valueListItem6,
  345. valueListItem7,
  346. valueListItem8,
  347. valueListItem31,
  348. valueListItem32,
  349. valueListItem33,
  350. valueListItem9,
  351. valueListItem10,
  352. valueListItem34,
  353. valueListItem35,
  354. valueListItem36,
  355. valueListItem11,
  356. valueListItem12,
  357. valueListItem37,
  358. valueListItem15,
  359. valueListItem16,
  360. valueListItem17,
  361. valueListItem38,
  362. valueListItem39});
  363. this.uce_GWName.Location = new System.Drawing.Point(624, 23);
  364. this.uce_GWName.Name = "uce_GWName";
  365. this.uce_GWName.Size = new System.Drawing.Size(115, 19);
  366. this.uce_GWName.TabIndex = 80;
  367. //
  368. // tb_XMNAME
  369. //
  370. this.tb_XMNAME.Location = new System.Drawing.Point(127, 22);
  371. this.tb_XMNAME.MaxLength = 10;
  372. this.tb_XMNAME.Name = "tb_XMNAME";
  373. this.tb_XMNAME.Size = new System.Drawing.Size(123, 21);
  374. this.tb_XMNAME.TabIndex = 2;
  375. //
  376. // tb_XMCODE
  377. //
  378. this.tb_XMCODE.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  379. this.tb_XMCODE.Location = new System.Drawing.Point(778, 37);
  380. this.tb_XMCODE.MaxLength = 9;
  381. this.tb_XMCODE.Name = "tb_XMCODE";
  382. this.tb_XMCODE.Size = new System.Drawing.Size(123, 21);
  383. this.tb_XMCODE.TabIndex = 1;
  384. this.tb_XMCODE.Visible = false;
  385. //
  386. // Lb_GWCODE
  387. //
  388. this.Lb_GWCODE.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  389. this.Lb_GWCODE.Location = new System.Drawing.Point(802, 13);
  390. this.Lb_GWCODE.Name = "Lb_GWCODE";
  391. this.Lb_GWCODE.Size = new System.Drawing.Size(79, 21);
  392. this.Lb_GWCODE.TabIndex = 0;
  393. this.Lb_GWCODE.Text = "项目编码";
  394. this.Lb_GWCODE.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  395. this.Lb_GWCODE.Visible = false;
  396. //
  397. // label1
  398. //
  399. this.label1.Font = new System.Drawing.Font("宋体", 9F);
  400. this.label1.Location = new System.Drawing.Point(54, 22);
  401. this.label1.Name = "label1";
  402. this.label1.Size = new System.Drawing.Size(67, 21);
  403. this.label1.TabIndex = 1;
  404. this.label1.Text = "项目名称";
  405. this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  406. //
  407. // label3
  408. //
  409. this.label3.Font = new System.Drawing.Font("宋体", 9F);
  410. this.label3.Location = new System.Drawing.Point(553, 22);
  411. this.label3.Name = "label3";
  412. this.label3.Size = new System.Drawing.Size(65, 21);
  413. this.label3.TabIndex = 5;
  414. this.label3.Text = "岗位名称";
  415. this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  416. //
  417. // uce_XMType
  418. //
  419. this.uce_XMType.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
  420. this.uce_XMType.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
  421. this.uce_XMType.Font = new System.Drawing.Font("宋体", 9F);
  422. valueListItem2.DataValue = "0";
  423. valueListItem2.DisplayText = "设备运行";
  424. valueListItem1.DataValue = "1";
  425. valueListItem1.DisplayText = "耗材消耗";
  426. this.uce_XMType.Items.AddRange(new Infragistics.Win.ValueListItem[] {
  427. valueListItem2,
  428. valueListItem1});
  429. this.uce_XMType.Location = new System.Drawing.Point(380, 22);
  430. this.uce_XMType.Name = "uce_XMType";
  431. this.uce_XMType.Size = new System.Drawing.Size(123, 19);
  432. this.uce_XMType.TabIndex = 4;
  433. this.uce_XMType.UseFlatMode = Infragistics.Win.DefaultableBoolean.True;
  434. //
  435. // label2
  436. //
  437. this.label2.Font = new System.Drawing.Font("宋体", 9F);
  438. this.label2.Location = new System.Drawing.Point(301, 22);
  439. this.label2.Name = "label2";
  440. this.label2.Size = new System.Drawing.Size(79, 21);
  441. this.label2.TabIndex = 3;
  442. this.label2.Text = "项目类型";
  443. this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  444. //
  445. // cmbPosition
  446. //
  447. appearance6.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel;
  448. appearance6.BorderColor = System.Drawing.Color.Black;
  449. this.cmbPosition.Appearance = appearance6;
  450. this.cmbPosition.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
  451. this.cmbPosition.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
  452. this.cmbPosition.Enabled = false;
  453. this.cmbPosition.Font = new System.Drawing.Font("宋体", 9F);
  454. valueListItem13.DataValue = "HMP01";
  455. valueListItem13.DisplayText = "1#脱硫";
  456. valueListItem14.DataValue = "HMP02";
  457. valueListItem14.DisplayText = "2#脱硫";
  458. valueListItem40.DataValue = "BOF01";
  459. valueListItem40.DisplayText = "1#转炉";
  460. valueListItem41.DataValue = "BOF02";
  461. valueListItem41.DisplayText = "2#转炉";
  462. valueListItem42.DataValue = "BOF03";
  463. valueListItem42.DisplayText = "3#转炉";
  464. valueListItem43.DataValue = "BOF04";
  465. valueListItem43.DisplayText = "4#转炉";
  466. valueListItem44.DataValue = "BOF05";
  467. valueListItem44.DisplayText = "5#转炉";
  468. valueListItem45.DataValue = "CAS01";
  469. valueListItem45.DisplayText = "1#吹氩";
  470. valueListItem46.DataValue = "CAS02";
  471. valueListItem46.DisplayText = "2#吹氩";
  472. valueListItem47.DataValue = "CAS03";
  473. valueListItem47.DisplayText = "3#吹氩";
  474. valueListItem48.DataValue = "CAS04";
  475. valueListItem48.DisplayText = "4#吹氩";
  476. valueListItem49.DataValue = "CAS05";
  477. valueListItem49.DisplayText = "5#吹氩";
  478. valueListItem50.DataValue = "LFS01";
  479. valueListItem50.DisplayText = "1#精炼";
  480. valueListItem51.DataValue = "LFS02";
  481. valueListItem51.DisplayText = "2#精炼";
  482. valueListItem52.DataValue = "LFS03";
  483. valueListItem52.DisplayText = "3#精炼";
  484. valueListItem53.DataValue = "CCM01";
  485. valueListItem53.DisplayText = "1#连铸机";
  486. valueListItem54.DataValue = "CCM02";
  487. valueListItem54.DisplayText = "2#连铸机";
  488. valueListItem55.DataValue = "CCM03";
  489. valueListItem55.DisplayText = "3#连铸机";
  490. valueListItem56.DataValue = "CCM04";
  491. valueListItem56.DisplayText = "4#连铸机";
  492. valueListItem57.DataValue = "CCM05";
  493. valueListItem57.DisplayText = "5#连铸机";
  494. this.cmbPosition.Items.AddRange(new Infragistics.Win.ValueListItem[] {
  495. valueListItem13,
  496. valueListItem14,
  497. valueListItem40,
  498. valueListItem41,
  499. valueListItem42,
  500. valueListItem43,
  501. valueListItem44,
  502. valueListItem45,
  503. valueListItem46,
  504. valueListItem47,
  505. valueListItem48,
  506. valueListItem49,
  507. valueListItem50,
  508. valueListItem51,
  509. valueListItem52,
  510. valueListItem53,
  511. valueListItem54,
  512. valueListItem55,
  513. valueListItem56,
  514. valueListItem57});
  515. this.cmbPosition.Location = new System.Drawing.Point(317, 10);
  516. this.cmbPosition.Name = "cmbPosition";
  517. this.cmbPosition.Size = new System.Drawing.Size(115, 19);
  518. this.cmbPosition.TabIndex = 79;
  519. this.cmbPosition.ValueChanged += new System.EventHandler(this.ultcbo_ValueChanged);
  520. //
  521. // cmbType
  522. //
  523. appearance5.BorderAlpha = Infragistics.Win.Alpha.UseAlphaLevel;
  524. appearance5.BorderColor = System.Drawing.Color.Black;
  525. this.cmbType.Appearance = appearance5;
  526. this.cmbType.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
  527. this.cmbType.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
  528. this.cmbType.Enabled = false;
  529. this.cmbType.Font = new System.Drawing.Font("宋体", 9F);
  530. valueListItem4.DataValue = "0";
  531. valueListItem4.DisplayText = "设备运行";
  532. valueListItem3.DataValue = "1";
  533. valueListItem3.DisplayText = "耗材消耗";
  534. this.cmbType.Items.AddRange(new Infragistics.Win.ValueListItem[] {
  535. valueListItem4,
  536. valueListItem3});
  537. this.cmbType.Location = new System.Drawing.Point(103, 10);
  538. this.cmbType.Name = "cmbType";
  539. this.cmbType.Size = new System.Drawing.Size(103, 19);
  540. this.cmbType.TabIndex = 78;
  541. this.cmbType.ValueChanged += new System.EventHandler(this.ultcbo_ValueChanged);
  542. //
  543. // chkGWName
  544. //
  545. this.chkGWName.AutoSize = true;
  546. this.chkGWName.BackColor = System.Drawing.Color.Transparent;
  547. this.chkGWName.FlatStyle = System.Windows.Forms.FlatStyle.System;
  548. this.chkGWName.Font = new System.Drawing.Font("宋体", 9F);
  549. this.chkGWName.Location = new System.Drawing.Point(240, 11);
  550. this.chkGWName.Name = "chkGWName";
  551. this.chkGWName.Size = new System.Drawing.Size(84, 17);
  552. this.chkGWName.TabIndex = 77;
  553. this.chkGWName.Text = " 岗位名称";
  554. this.chkGWName.UseVisualStyleBackColor = false;
  555. this.chkGWName.CheckedChanged += new System.EventHandler(this.chkGWName_CheckedChanged);
  556. //
  557. // chkItemType
  558. //
  559. this.chkItemType.AutoSize = true;
  560. this.chkItemType.BackColor = System.Drawing.Color.Transparent;
  561. this.chkItemType.FlatStyle = System.Windows.Forms.FlatStyle.System;
  562. this.chkItemType.Font = new System.Drawing.Font("宋体", 9F);
  563. this.chkItemType.Location = new System.Drawing.Point(26, 11);
  564. this.chkItemType.Name = "chkItemType";
  565. this.chkItemType.Size = new System.Drawing.Size(84, 17);
  566. this.chkItemType.TabIndex = 76;
  567. this.chkItemType.Text = " 项目类型";
  568. this.chkItemType.UseVisualStyleBackColor = false;
  569. this.chkItemType.CheckedChanged += new System.EventHandler(this.chkItemType_CheckedChanged);
  570. //
  571. // FrmBase_Fill_Panel
  572. //
  573. this.FrmBase_Fill_Panel.Controls.Add(this.ultraGrid2);
  574. this.FrmBase_Fill_Panel.Controls.Add(this.ultraExpandableGroupBox1);
  575. this.FrmBase_Fill_Panel.Controls.Add(this.ultraGroupBox1);
  576. this.FrmBase_Fill_Panel.Cursor = System.Windows.Forms.Cursors.Default;
  577. this.FrmBase_Fill_Panel.Dock = System.Windows.Forms.DockStyle.Fill;
  578. this.FrmBase_Fill_Panel.Location = new System.Drawing.Point(0, 0);
  579. this.FrmBase_Fill_Panel.Name = "FrmBase_Fill_Panel";
  580. this.FrmBase_Fill_Panel.Size = new System.Drawing.Size(888, 453);
  581. this.FrmBase_Fill_Panel.TabIndex = 0;
  582. //
  583. // ultraGroupBox1
  584. //
  585. this.ultraGroupBox1.Controls.Add(this.cmbType);
  586. this.ultraGroupBox1.Controls.Add(this.cmbPosition);
  587. this.ultraGroupBox1.Controls.Add(this.chkGWName);
  588. this.ultraGroupBox1.Controls.Add(this.chkItemType);
  589. this.ultraGroupBox1.Dock = System.Windows.Forms.DockStyle.Top;
  590. this.ultraGroupBox1.Location = new System.Drawing.Point(0, 0);
  591. this.ultraGroupBox1.Name = "ultraGroupBox1";
  592. this.ultraGroupBox1.Size = new System.Drawing.Size(888, 40);
  593. this.ultraGroupBox1.TabIndex = 2;
  594. //
  595. // frmMaintenance
  596. //
  597. this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
  598. this.ClientSize = new System.Drawing.Size(888, 453);
  599. this.Controls.Add(this.FrmBase_Fill_Panel);
  600. this.KeyPreview = true;
  601. this.Name = "frmMaintenance";
  602. this.Text = "交接班耗材和设备项目维护";
  603. this.Load += new System.EventHandler(this.GWBM_Load);
  604. ((System.ComponentModel.ISupportInitialize)(this.dataSet1)).EndInit();
  605. ((System.ComponentModel.ISupportInitialize)(this.dataTable1)).EndInit();
  606. ((System.ComponentModel.ISupportInitialize)(this.ultraGrid2)).EndInit();
  607. ((System.ComponentModel.ISupportInitialize)(this.ultraExpandableGroupBox1)).EndInit();
  608. this.ultraExpandableGroupBox1.ResumeLayout(false);
  609. this.ultraExpandableGroupBoxPanel1.ResumeLayout(false);
  610. this.ultraPanel1.ClientArea.ResumeLayout(false);
  611. this.ultraPanel1.ClientArea.PerformLayout();
  612. this.ultraPanel1.ResumeLayout(false);
  613. ((System.ComponentModel.ISupportInitialize)(this.uce_GWName)).EndInit();
  614. ((System.ComponentModel.ISupportInitialize)(this.uce_XMType)).EndInit();
  615. ((System.ComponentModel.ISupportInitialize)(this.cmbPosition)).EndInit();
  616. ((System.ComponentModel.ISupportInitialize)(this.cmbType)).EndInit();
  617. this.FrmBase_Fill_Panel.ResumeLayout(false);
  618. ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).EndInit();
  619. this.ultraGroupBox1.ResumeLayout(false);
  620. this.ultraGroupBox1.PerformLayout();
  621. this.ResumeLayout(false);
  622. }
  623. #endregion
  624. /// <summary>
  625. /// 初始化函数
  626. /// </summary>
  627. /// <param name="sender"></param>
  628. /// <param name="e"></param>
  629. private void GWBM_Load(object sender, System.EventArgs e)
  630. {
  631. //判断是炼钢还是轧钢
  632. if(this.Key.IndexOf('@')>0)
  633. strLG_ZG = this.Key.Substring(this.Key.IndexOf('@')+1,2);
  634. uce_XMType.SelectedIndex = 0;
  635. cmbType.SelectedIndex = 0;
  636. //初始化UltraDropDown控件
  637. //InitUltraDropDown();
  638. cmbPosition.SelectedIndex = 0;
  639. uce_GWName.SelectedIndex = 0;
  640. GetHCXMData();
  641. }
  642. // 设置岗位信息
  643. /// <summary>
  644. /// 设置岗位信息
  645. /// </summary>
  646. private string getPos(string key)
  647. {
  648. try
  649. {
  650. if(key.Length<5) return "未知";
  651. string gw=key.Substring(0,3);
  652. string no=key.Substring(4,1);
  653. string pos = "";
  654. switch (gw)
  655. {
  656. case "HMP":
  657. pos = no + "#脱硫";
  658. break;
  659. case "BOF":
  660. pos = no + "#转炉";
  661. break;
  662. case "CAS":
  663. pos = no + "#吹氩";
  664. break;
  665. case "LFS":
  666. pos = no + "#精炼";
  667. break;
  668. case "CCM":
  669. pos = no + "#连铸机";
  670. break;
  671. }
  672. return pos;
  673. }
  674. catch { return "未知"; }
  675. }
  676. // 交接班项目配置数据查询
  677. /// <summary>
  678. /// 交接班项目配置数据查询
  679. /// </summary>
  680. private void GetHCXMData()
  681. {
  682. string strWhere = "";
  683. try
  684. {
  685. if (chkItemType.Checked == true)
  686. {
  687. if (cmbType.SelectedIndex < 0)
  688. {
  689. MessageBox.Show("查询条件项目类型不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  690. cmbType.Focus();
  691. return;
  692. }
  693. else
  694. {
  695. strWhere = " and a.itemtype='" + cmbType.Value.ToString() + "'";
  696. }
  697. }
  698. if (chkGWName.Checked == true)
  699. {
  700. if (cmbPosition.SelectedIndex < 0)
  701. {
  702. MessageBox.Show("查询条件岗位名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  703. cmbType.Focus();
  704. return;
  705. }
  706. else
  707. {
  708. strWhere += " and a.stationcode = '" + cmbPosition.SelectedItem.DataValue.ToString() + "'";
  709. }
  710. }
  711. dataTable1.Rows.Clear();
  712. string strErr = "";
  713. //获取交接班耗材,设备数据
  714. DataSet ds = new DataSet();
  715. //定义一个ArrayList集合存储变量[参数]值
  716. ArrayList arry = new ArrayList();
  717. ArrayList sqlList = new ArrayList();
  718. arry.Add("frmJJBBase_Query.select");//此ID为XML文件ID
  719. sqlList.Add(strWhere);
  720. //调用服务端方法
  721. CoreClientParam CCP_JJBQuery = new CoreClientParam();
  722. DataTable dt = new DataTable();
  723. CCP_JJBQuery.ServerName = "Core.LgMes.Server.Common.ComDBQuery";
  724. CCP_JJBQuery.MethodName = "doQuery";
  725. CCP_JJBQuery.ServerParams = new object[] { arry ,sqlList};
  726. CCP_JJBQuery.SourceDataTable = dt;
  727. this.ExecuteSortResultByQueryToDataTable(CCP_JJBQuery, CoreInvokeType.Internal);
  728. ds.Tables.Add(dt);
  729. if (strErr != "")
  730. {
  731. MessageBox.Show(strErr);
  732. }
  733. else
  734. {
  735. if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
  736. {
  737. int RowId = 1;
  738. foreach (DataRow Drow in ds.Tables[0].Rows)
  739. {
  740. DataRow newRow = dataTable1.NewRow();
  741. foreach (DataColumn dataColumn in ds.Tables[0].Columns)
  742. {
  743. if(dataColumn.ColumnName!="STATIONCODE")
  744. {
  745. newRow[dataColumn.ColumnName] = Drow[dataColumn.ColumnName].ToString();
  746. }
  747. if (dataColumn.ColumnName == "STATIONCODE")
  748. {
  749. newRow[dataColumn.ColumnName] = getPos(Drow[dataColumn.ColumnName].ToString().Trim());
  750. }
  751. }
  752. dataTable1.Rows.Add(newRow);
  753. RowId++;
  754. }
  755. dataTable1.AcceptChanges();
  756. }
  757. }
  758. }
  759. catch (System.Exception exp)
  760. {
  761. WriteLog(exp.Message);
  762. }
  763. finally
  764. {
  765. }
  766. }
  767. /// <summary>
  768. /// 写日志信息到日志文件
  769. /// </summary>
  770. /// <param name="str"></param>
  771. private void WriteLog(string str)
  772. {
  773. string strDate = System.DateTime.Now.Year.ToString() + System.DateTime.Now.Month.ToString() + System.DateTime.Now.Day.ToString();
  774. this.WriteLog(str, this.UserInfo.GetUserName(), "frmMaintenance" + strDate, LogInfoLevel.Message);
  775. }
  776. public override void ToolBar_Click(object sender, string ToolbarKey)
  777. {
  778. DialogResult result;
  779. switch (ToolbarKey)
  780. {
  781. case "Query": //显示数据
  782. GetHCXMData();
  783. break;
  784. case "Add"://新增
  785. AddHCXMData();
  786. GetHCXMData();
  787. break;
  788. case "Update":
  789. result = MessageBox.Show(this, "您确定要修改此项目配置吗?", "提示", MessageBoxButtons.YesNo,
  790. MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
  791. if (result == DialogResult.Yes)
  792. {
  793. UpdateHCXMData();
  794. GetHCXMData();
  795. }
  796. break;
  797. case "Delete":
  798. string mk = "确定要删除此项目配置吗?";
  799. result = MessageBox.Show(this, mk, "提示", MessageBoxButtons.YesNo,
  800. MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
  801. if (result == DialogResult.Yes)
  802. {
  803. DeleteHCXMData();
  804. GetHCXMData();
  805. }
  806. break;
  807. case "Export":
  808. try
  809. {
  810. Core.Mes.Client.Comm.Globals.ulGridToExcel(ultraGrid2, Text);
  811. }
  812. catch (Exception ex)
  813. {
  814. MessageBox.Show(ex.Message);
  815. }
  816. break;
  817. case "Exit":
  818. this.Close();
  819. break;
  820. default:
  821. break;
  822. }
  823. }
  824. // 新增耗材项目编码数据
  825. /// <summary>
  826. /// 新增耗材项目编码数据
  827. /// </summary>
  828. public void AddHCXMData()
  829. {
  830. try
  831. {
  832. //耗材项目名称
  833. string strXMNAME = null;
  834. if (string.IsNullOrEmpty(tb_XMNAME.Text.Trim()))
  835. {
  836. MessageBox.Show("项目名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  837. return;
  838. }
  839. else
  840. strXMNAME = tb_XMNAME.Text.Trim();
  841. //项目类型
  842. if (uce_XMType.SelectedIndex<0)
  843. {
  844. MessageBox.Show("项目类型不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  845. return;
  846. }
  847. string strXMType = uce_XMType.Value.ToString();
  848. //岗位编码
  849. string strGWName = "";
  850. if (uce_GWName.SelectedIndex < 0)
  851. {
  852. MessageBox.Show("岗位名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  853. return;
  854. }
  855. try
  856. {
  857. strGWName = uce_GWName.Value.ToString();
  858. }
  859. catch { strGWName = "0"; }
  860. string strErr = "";
  861. //定义一个ArrayList集合存储变量[参数]值
  862. ArrayList sArgs = new ArrayList();
  863. sArgs.Add(strXMNAME);
  864. sArgs.Add(strXMType);
  865. sArgs.Add(strGWName);
  866. ClsDataAccessPack.DoProcedure("frmMaintenance_AddToPos.select", sArgs, out strErr, ob);
  867. if (strErr != "")
  868. {
  869. MessageBox.Show("交接班项目配置新增失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  870. }
  871. else
  872. MessageBox.Show("交接班项目配置新增成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  873. }
  874. catch (System.Exception exp)
  875. {
  876. WriteLog(exp.Message);
  877. }
  878. finally
  879. {
  880. }
  881. }
  882. // 修改耗材项目,设备状况数据
  883. /// <summary>
  884. /// 修改耗材项目,设备状况数据
  885. /// </summary>
  886. public void UpdateHCXMData()
  887. {
  888. try
  889. {
  890. //耗材项目名称
  891. string strXMNAME = null;
  892. if (string.IsNullOrEmpty(tb_XMNAME.Text.Trim()))
  893. {
  894. MessageBox.Show("项目名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  895. return;
  896. }
  897. else
  898. strXMNAME = tb_XMNAME.Text.Trim();
  899. //项目类型
  900. if (uce_XMType.SelectedIndex < 0)
  901. {
  902. MessageBox.Show("项目类型不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  903. return;
  904. }
  905. string strXMType = uce_XMType.Value.ToString();
  906. //岗位编码
  907. string strGWName = "";
  908. if (uce_GWName.SelectedIndex < 0)
  909. {
  910. MessageBox.Show("岗位名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  911. return;
  912. }
  913. try
  914. {
  915. strGWName = uce_GWName.Value.ToString();
  916. }
  917. catch { strGWName = "0"; }
  918. string strErr = "";
  919. //定义一个ArrayList集合存储变量[参数]值
  920. ArrayList arry = new ArrayList();
  921. arry.Add("frmJJBBase_Update.select");
  922. arry.Add(strXMNAME);
  923. arry.Add(strXMType);
  924. arry.Add(strGWName);
  925. arry.Add(ultraGrid2.ActiveRow.Cells["ItemCode"].Value.ToString().Trim());
  926. CommonClientToServer cctos = new CommonClientToServer();
  927. cctos.ob = this.ob;
  928. string info = cctos.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave",
  929. "doSimpleSave", arry, out strErr);
  930. if (strErr != "")
  931. {
  932. MessageBox.Show("交接班项目配置修改失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); ;
  933. }
  934. else
  935. {
  936. MessageBox.Show("交接班项目配置修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  937. dataTable1.Clear();
  938. }
  939. }
  940. catch (System.Exception exp)
  941. {
  942. WriteLog(exp.Message);
  943. MessageBox.Show("修改失败!");
  944. }
  945. finally
  946. {
  947. }
  948. }
  949. // 删除耗材项目,设备状况数据
  950. /// <summary>
  951. /// 删除耗材项目,设备状况数据
  952. /// </summary>
  953. public void DeleteHCXMData()
  954. {
  955. try
  956. {
  957. string strErr = "";
  958. string strXMCODE = ultraGrid2.ActiveRow.Cells["ItemCODE"].Text.Trim();
  959. //定义一个ArrayList集合存储变量[参数]值
  960. ArrayList arry = new ArrayList();
  961. arry.Add("frmJJBBase_Del.select");
  962. arry.Add(strXMCODE);
  963. CommonClientToServer cctos = new CommonClientToServer();
  964. cctos.ob = this.ob;
  965. string info = cctos.NoQueryFunctions("Core.LgMes.Server.Common.ComDBSave",
  966. "doSimpleSave", arry, out strErr);
  967. if (strErr != "")
  968. {
  969. MessageBox.Show("交接班项目配置删除失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  970. }
  971. else
  972. {
  973. tb_XMCODE.Text = "";
  974. tb_XMNAME.Text = "";
  975. MessageBox.Show("交接班项目配置删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  976. }
  977. }//end try
  978. catch (System.Exception exp)
  979. {
  980. WriteLog(exp.Message);
  981. }
  982. finally
  983. {
  984. }
  985. }
  986. private void chkItemType_CheckedChanged(object sender, EventArgs e)
  987. {
  988. cmbType.Enabled = chkItemType.Checked;
  989. }
  990. private void chkGWName_CheckedChanged(object sender, EventArgs e)
  991. {
  992. cmbPosition.Enabled = chkGWName.Checked;
  993. }
  994. private void ultcbo_ValueChanged(object sender, EventArgs e)
  995. {
  996. GetHCXMData();
  997. }
  998. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  999. {
  1000. try
  1001. {
  1002. if (ultraGrid2.ActiveRow == null || ultraGrid2.Rows.Count==0)
  1003. {
  1004. return;
  1005. }
  1006. tb_XMCODE.Text = ultraGrid2.ActiveRow.Cells["ItemCODE"].Text.Trim();
  1007. tb_XMNAME.Text = ultraGrid2.ActiveRow.Cells["ItemNAME"].Text.Trim();
  1008. uce_XMType.Text = ultraGrid2.ActiveRow.Cells["ItemTYPE"].Text.Trim();
  1009. uce_GWName.Text = ultraGrid2.ActiveRow.Cells["STATIONCODE"].Text.Trim();
  1010. this.ultraGrid2.ActiveRow.Selected = true;
  1011. }
  1012. catch { }
  1013. }
  1014. }
  1015. }