frmMaintenance.cs.svn-base 49 KB

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