UIB100220.cs 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using System.Collections;
  11. using System.Text.RegularExpressions;//正则表达式所在空间
  12. using Infragistics.Win.UltraWinGrid;
  13. namespace Core.LZMes.Client.UIB
  14. {
  15. public partial class UIB100220 : FrmBase
  16. {
  17. public UIB100220()
  18. {
  19. InitializeComponent();
  20. }
  21. public override void ToolBar_Click(object sender, string ToolbarKey)
  22. {
  23. try
  24. {
  25. switch (ToolbarKey.ToString())
  26. {
  27. case "Query":
  28. this.DoQuery();
  29. break;
  30. case "Send":
  31. this.DoSend();
  32. break;
  33. case "Export":
  34. this.DoExport();
  35. break;
  36. case "OnFile":
  37. this.DoOnFile();
  38. break;
  39. }
  40. }
  41. catch (System.Exception ex)
  42. {
  43. System.Diagnostics.Debug.WriteLine(ex.ToString());
  44. }
  45. }
  46. private string strLine = null;//产线
  47. private string strArea = null;//地点
  48. private string strSendTP = null;//是否已发送
  49. private string strWtbh = null;//委托编号
  50. private int Data1Table5Count = 0;//DataSet1.Table["Table5"]的列数
  51. public void DoQuery()
  52. {
  53. try
  54. {
  55. if (this.comboBox1.Text.Trim() == "" || this.comboBox2.Text.Trim() == "")
  56. {
  57. MessageBox.Show("请选择产线和实验地点", "提示");
  58. return;
  59. }
  60. OperateConditionRecode.WriteCondition("UIB100220_BOX1", this.comboBox1.Text);
  61. OperateConditionRecode.WriteCondition("UIB100220_BOX2", this.comboBox2.Text);
  62. OperateConditionRecode.WriteCondition("UIB100220_BOX3", this.comboBox3.Text);
  63. ArrayList al = new ArrayList();
  64. //产线
  65. if (this.comboBox1.Text == "热轧") { al.Add("UIB100220_01_01.SELECT"); strLine = "R"; }
  66. else if (this.comboBox1.Text == "连退") { al.Add("UIB100220_01_01.SELECT"); strLine = "L"; }
  67. else if (this.comboBox1.Text == "中板") { al.Add("UIB100220_01.SELECT"); strLine = "ZB"; }
  68. else if (this.comboBox1.Text == "厚板") { al.Add("UIB100220_01.SELECT"); strLine = "HB"; }
  69. else if (this.comboBox1.Text == "高棒") { al.Add("UIB100220_01.SELECT"); strLine = "GB"; }
  70. else if (this.comboBox1.Text == "高线") { al.Add("UIB100220_01.SELECT"); strLine = "GX"; }
  71. al.Add(strLine);
  72. //地点
  73. if (this.comboBox2.Text.Trim() == "力学") { strArea = "LX"; }
  74. else if (this.comboBox2.Text.Trim() == "金相") { strArea = "JX"; }
  75. else { MessageBox.Show("请区分力学与金相", "提示"); return; }
  76. al.Add(strArea);
  77. //是否已发送
  78. if (this.comboBox3.Text.Trim() == "未发送") { strSendTP = "0"; al.Add(strArea); al.Add(strSendTP); }
  79. else if (this.comboBox3.Text.Trim() == "已发送") { strSendTP = "1"; al.Add(strArea); al.Add(strSendTP); }
  80. else if (this.comboBox3.Text.Trim() == "全部") { strSendTP = ""; al.Add(""); al.Add(""); }
  81. else { MessageBox.Show("请选择发送状态"); return; }
  82. //委托时间
  83. al.Add(this.dateTimePicker1.Value.Date.ToString("yyyyMMdd")+"000000");
  84. al.Add(this.dateTimePicker2.Value.Date.ToString("yyyyMMdd") + "999999");
  85. this.dataSet1.Tables[0].Clear();
  86. CoreClientParam ccp = new CoreClientParam();
  87. ccp.ServerName = "UIB.JHY.JHYComQuery";
  88. ccp.MethodName = "doSimpleQuery";
  89. ccp.ServerParams = new object[] { al };
  90. ccp.SourceDataTable = this.dataSet1.Tables[0];
  91. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  92. //发送、完成状态颜色显示,发送状态优先
  93. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  94. {
  95. if (ugr.Cells["SEND_STAT"].Text.Substring(0, 1) == "0")//是否已发送,未发送则蓝色
  96. {
  97. ugr.Cells["SEND_STAT"].Appearance.BackColor = Color.Blue;
  98. }
  99. if (ugr.Cells["WORK_STATS"].Text == "XX")//是否已完成,未完成则显示黄色
  100. {
  101. ugr.RowSelectorAppearance.BackColor = Color.Yellow;
  102. }
  103. }
  104. }
  105. catch (Exception ex)
  106. {
  107. System.Diagnostics.Debug.WriteLine(ex.ToString());
  108. }
  109. }
  110. public void DoSave()
  111. {
  112. }
  113. //发送
  114. public void DoSend()
  115. {
  116. try
  117. {
  118. string strSMPNO = null;
  119. string strSMPCUTLOC = null;
  120. string strSMPTNOTYPE = null;
  121. string strMat = null;//物料号
  122. int SPLITNUM = 3;
  123. string splitStr = null;
  124. int coilNum = 0;
  125. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  126. {
  127. if (ugr.Cells["CHK"].Text == "True")
  128. {
  129. strSMPNO = strSMPNO + ugr.Cells["SMP_NO"].Text;
  130. strSMPCUTLOC = strSMPCUTLOC + ugr.Cells["SMP_CUT_LOC"].Text;
  131. strSMPTNOTYPE = strSMPTNOTYPE + ugr.Cells["SMP_NO_TYPE"].Text;
  132. if (strMat != null)
  133. {
  134. coilNum++;
  135. if (coilNum % SPLITNUM == 0) { splitStr = "\n"; }
  136. else {splitStr = ",";}
  137. }
  138. strMat = strMat + splitStr + ugr.Cells["COIL_NO"].Text;
  139. }
  140. // this.ultraGrid5.Rows[colNum].Cells["QLTY_VAL"].Value = al[0].ToString();
  141. }
  142. if (strSMPNO == null) return;
  143. if (MessageBox.Show("确定发送以下批号:\n" + strMat, "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  144. return;
  145. Hashtable ht = new Hashtable();
  146. ht.Add("i1", strSMPNO);
  147. ht.Add("i2", strSMPCUTLOC);
  148. ht.Add("i3", strSMPTNOTYPE);
  149. ht.Add("i4", strArea);
  150. ht.Add("i5", this.UserInfo.GetUserName());
  151. ht.Add("o6", "");
  152. CoreClientParam ccp = new CoreClientParam();
  153. ccp.ServerName = "UIB.JHY.JHyComCallProc";
  154. ccp.MethodName = "doSimpleProc";
  155. ccp.ServerParams = new object[] { "UIB100203_04.CALL", ht };
  156. CoreClientParam rccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  157. //计算结果返回
  158. ArrayList al = rccp.ReturnObject as ArrayList;
  159. if (al[0] == null) { MessageBox.Show("发送异常!"); return; }
  160. if (al[0].ToString() == "XX"){ MessageBox.Show("部分钢卷发送失败!", "提示");}
  161. else{MessageBox.Show("发送成功!", "提示");}
  162. this.DoQuery();
  163. }
  164. catch (Exception ex)
  165. {
  166. System.Diagnostics.Debug.WriteLine(ex.ToString());
  167. }
  168. }
  169. public void DoExport()
  170. {
  171. try
  172. {
  173. string strMat = "";//物料号
  174. string strWtbh = "";//委托单号
  175. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  176. {
  177. if (ugr.Cells["CHK"].Text == "True")
  178. {
  179. strMat = strMat + ugr.Cells["MATERIAL_NO"].Text;
  180. strWtbh = strWtbh + ugr.Cells["WEITO_NO"].Text;
  181. }
  182. }
  183. ArrayList al = new ArrayList();
  184. if (this.comboBoxExp.Text == "拉力原始记录")
  185. {
  186. this.dataSetExport.Tables["Table1"].Clear();
  187. al.Add("UIB100220_01.EXPORT.SELECT");
  188. al.Add(strMat);
  189. al.Add(strWtbh);
  190. CoreClientParam ccp = new CoreClientParam();
  191. ccp.ServerName = "UIB.JHY.JHYComQuery";
  192. ccp.MethodName = "doSimpleQuery";
  193. ccp.ServerParams = new object[] { al };
  194. ccp.SourceDataTable = this.dataSetExport.Tables["Table1"];
  195. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  196. JhyOpe jo = new JhyOpe();
  197. jo.Export(this.dataSetExport.Tables["Table1"], this.textBoxPath.Text, "热轧拉力试验原始记录表", "HostLaLi.xls");//拉力导出
  198. }
  199. else if (this.comboBoxExp.Text == "冲击原始记录")
  200. {
  201. //查询出所需要导出卷的信息
  202. this.dataSetExport.Tables["Table2"].Clear();
  203. al.Add("UIB100220_02.EXPORT.SELECT");
  204. al.Add(strMat);
  205. al.Add(strWtbh);
  206. CoreClientParam ccp = new CoreClientParam();
  207. ccp.ServerName = "UIB.JHY.JHYComQuery";
  208. ccp.MethodName = "doSimpleQuery";
  209. ccp.ServerParams = new object[] { al };
  210. ccp.SourceDataTable = this.dataSetExport.Tables["Table2"];
  211. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  212. JhyOpe jo = new JhyOpe();
  213. jo.Export(this.dataSetExport.Tables["Table2"], this.textBoxPath.Text, "热轧冲击试验原始记录表", "HostChongJi.xls");//拉力导出
  214. }
  215. MessageBox.Show("导出成功" , "提示");
  216. }
  217. catch (Exception ex)
  218. {
  219. System.Diagnostics.Debug.WriteLine(ex.ToString());
  220. }
  221. }
  222. public void DoOnFile()
  223. {
  224. }
  225. private void UIB100220_Load(object sender, EventArgs e)
  226. {
  227. try
  228. {
  229. /**
  230. * 1、查询条件初始化
  231. * 2、过程编码初始化
  232. * 3、材质代码初始化,用于grid4中的绑定材质代码
  233. * 4、DataSet1.Table["Table5"]的列数
  234. * **/
  235. //查询条件初始化
  236. this.comboBox1.Text = OperateConditionRecode.ReadCondition("UIB100220_BOX1");
  237. this.comboBox2.Text = OperateConditionRecode.ReadCondition("UIB100220_BOX2");
  238. this.comboBox3.Text = OperateConditionRecode.ReadCondition("UIB100220_BOX3");
  239. this.textBoxPath.Text = OperateConditionRecode.ReadCondition("UIB100220_PATH");
  240. this.comboBoxExp.SelectedIndex = 0;
  241. //DataSet1.Table["Table5"]的列数
  242. Data1Table5Count = this.dataSet1.Tables["Table5"].Columns.Count;
  243. //过程编码和材质代码初始化
  244. ArrayList list = new ArrayList();
  245. ArrayList al = new ArrayList();
  246. al.Add("UIB100220_03.SELECT");
  247. list.Add(al);
  248. al.Add("");
  249. al = new ArrayList();
  250. al.Add("UIB100220_01.INITSELECT");
  251. list.Add(al);
  252. CoreClientParam ccp = new CoreClientParam();
  253. ccp.ServerName = "UIB.JHY.JHYComQuery";
  254. ccp.MethodName = "doContQluery";
  255. ccp.ServerParams = new object[] { list };
  256. CoreClientParam ccpList = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  257. if (ccpList.ReturnInfo.Length == 0)
  258. {
  259. ArrayList aList = ccpList.ReturnObject as ArrayList;
  260. if (aList[0] != null)
  261. {
  262. this.dataSet2.Tables["Table1"].Clear();
  263. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[0] as System.Collections.ArrayList, this.dataSet2.Tables["Table1"]);
  264. tab0.TableName = "Table1";
  265. this.dataSet2.Tables["Table1"].Merge(tab0);
  266. }
  267. if (aList[1] != null)
  268. {
  269. this.dataSet2.Tables["Table2"].Clear();
  270. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[1] as System.Collections.ArrayList, this.dataSet2.Tables["Table2"]);
  271. tab0.TableName = "Table2";
  272. this.dataSet2.Tables["Table2"].Merge(tab0);
  273. }
  274. }//end if
  275. }
  276. catch (Exception ex)
  277. {
  278. MessageBox.Show("系统缺少必要信息,请重新加载","提示");
  279. //System.Diagnostics.Debug.WriteLine(ex.ToString());
  280. }
  281. }
  282. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  283. {
  284. try
  285. {
  286. this.textBox1.Enabled = this.checkBox1.Checked;
  287. }
  288. catch (Exception ex)
  289. {
  290. System.Diagnostics.Debug.WriteLine(ex.ToString());
  291. }
  292. }
  293. //对grid5动态行的处理
  294. public void grid5ColumnChange(string strQltyCD2, string strQltyCD3 , string strQltyCD)
  295. {
  296. // SETUP2:添加动态过程项目到table中
  297. for (int i = 0; i < this.dataSet2.Tables["Table3"].Rows.Count; i++)
  298. {
  299. this.dataSet1.Tables["Table5"].Columns.Add(this.dataSet2.Tables["Table3"].Rows[i]["QLTY_OPE_CFNM"].ToString());
  300. }
  301. // SETUP3:对grid5进行操作
  302. CoreClientParam ccp = new CoreClientParam();
  303. ccp.ServerName = "UIB.JHY.UIB100220";
  304. ccp.MethodName = "doQltyCdQuery";
  305. ccp.ServerParams = new object[] { strQltyCD2, strQltyCD3, strWtbh, this.strArea, this.strSendTP == null ? "" : this.strSendTP, strQltyCD };
  306. ccp.SourceDataTable = this.dataSet1.Tables["Table5"];
  307. //this.ultraGrid5.Refresh();
  308. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  309. //设置列宽和不可编辑属性
  310. int index = Data1Table5Count + 1;
  311. for (int nextCol = Data1Table5Count; nextCol < this.ultraGrid5.DisplayLayout.Bands[0].Columns.Count; nextCol++)
  312. {
  313. this.ultraGrid5.DisplayLayout.Bands[0].Columns[nextCol].Width = 40;//设置列宽
  314. this.ultraGrid5.DisplayLayout.Bands[0].Columns[nextCol].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;//不可编辑
  315. }
  316. }
  317. private void ultraGrid6_KeyDown(object sender, KeyEventArgs e)
  318. {
  319. try
  320. {
  321. /**
  322. *
  323. * 回车后,首先区分数据已变、未变的情况;未变时需要光标跳动,已变后需要处理数据问题以及光标跳动
  324. *
  325. * 针对已变逻辑如下:
  326. * SETUP1:保存数据,返回修约后的结果和是否合格的标识,回填到隐藏Table
  327. * SETUP2:从该项开始进行循环,有计算公式的,进行保存计算,回填到隐藏Table
  328. * SETUP3:通过隐藏的Table,回填到grid5和grid6
  329. *
  330. * SETUPA: 如果grid6未到行末,则grid6调到下一行;若grid6到达行末,对grid5换行,并执行查询;需要使得grid6首行的列处于可编辑状态
  331. * 注意 :DataSet1的Table6和DataSet2的Table4字段是相同的,DataSet2.Tables["Table4"]便是对grid6的隐藏Table
  332. * **/
  333. if (e.KeyCode != Keys.Enter) return;
  334. if (this.ultraGrid6.ActiveCell == null) return;
  335. if (this.ultraGrid6.ActiveCell.DataChanged == true)
  336. {
  337. //数据禁止修改,或数据不符合格式
  338. string strVal = this.ultraGrid6.ActiveRow.Cells["QLTY_VAL"].Text.Trim() == "" ? "0" : this.ultraGrid6.ActiveRow.Cells["QLTY_VAL"].Text.Trim();
  339. if (this.ultraGrid6.ActiveRow.Cells["EDIT_TP"].Text == "N" || JhyOpe.DcsDouble(strVal) == false)
  340. {
  341. MessageBox.Show("数据禁止修改或格式错误", "提示");
  342. //恢复数据
  343. this.ultraGrid6.ActiveRow.Cells["QLTY_VAL"].Value = this.ultraGrid6.ActiveRow.Cells["QLTY_VAL"].Value.ToString();
  344. this.ultraGrid6.UpdateData();
  345. return;
  346. }
  347. //数据处理问题
  348. Grid6KeyDown();
  349. }
  350. //光标跳动处理
  351. CursorMove();
  352. }
  353. catch (Exception ex)
  354. {
  355. System.Diagnostics.Debug.WriteLine(ex.ToString());
  356. }
  357. }
  358. //grid6的回车事件
  359. private void Grid6KeyDown()
  360. {
  361. ArrayList rsList = null;
  362. //SETUP1.OF 保存数据
  363. rsList = this.DoUpdate(this.ultraGrid5.ActiveRow.Cells["SMP_NO"].Text, this.ultraGrid5.ActiveRow.Cells["SMP_CUT_LOC"].Text
  364. , this.ultraGrid5.ActiveRow.Cells["SMP_NO_TYPE"].Text, this.ultraGrid5.ActiveRow.Cells["QLTY_CD_2"].Text
  365. , this.ultraGrid6.ActiveRow.Cells["QLTY_OPE_CD"].Text, ""
  366. , this.ultraGrid6.ActiveRow.Cells["QLTY_DIS_LEN"].Text, this.ultraGrid6.ActiveRow.Cells["CRCT_REG"].Text.ToUpper()
  367. , "", this.ultraGrid6.ActiveRow.Cells["QLTY_VAL"].Text);
  368. //SETUP1 OF 回填到隐藏的Table
  369. int rowTable4 = 0;
  370. for (int i = 0; i < this.dataSet2.Tables["Table4"].Rows.Count; i++)
  371. {
  372. if (this.dataSet2.Tables["Table4"].Rows[i]["QLTY_OPE_CD"].ToString() == this.ultraGrid6.ActiveRow.Cells["QLTY_OPE_CD"].Text)
  373. {
  374. this.setValHiddenTable(i, rsList);//回填数据到隐藏的Table
  375. rowTable4 = i;
  376. break;
  377. }
  378. }
  379. //SETUP2 OF 有计算公式的进行保存计算
  380. for (int i = rowTable4; i < this.dataSet2.Tables["Table4"].Rows.Count; i++)
  381. {
  382. string strCompVal = this.dataSet2.Tables["Table4"].Rows[i]["COMP_CAL"].ToString();//提取计算公式,如“a*b”
  383. if (strCompVal == "") continue;
  384. strCompVal = this.DoCompVal(strCompVal);//返回替换值后的计算公式,如 “12*13”
  385. rsList = this.DoUpdate(this.ultraGrid5.ActiveRow.Cells["SMP_NO"].Text, this.ultraGrid5.ActiveRow.Cells["SMP_CUT_LOC"].Text
  386. , this.ultraGrid5.ActiveRow.Cells["SMP_NO_TYPE"].Text, this.ultraGrid5.ActiveRow.Cells["QLTY_CD_2"].Text
  387. , this.dataSet2.Tables["Table4"].Rows[i]["QLTY_OPE_CD"].ToString(), strCompVal
  388. , this.dataSet2.Tables["Table4"].Rows[i]["QLTY_DIS_LEN"].ToString(), this.dataSet2.Tables["Table4"].Rows[i]["CRCT_REG"].ToString().ToUpper()
  389. , "", this.dataSet2.Tables["Table4"].Rows[i]["QLTY_VAL"].ToString());
  390. //SETUP2 OF 回填到隐藏的Table
  391. this.setValHiddenTable(i, rsList);
  392. }
  393. //SETUP3 回填到grid5、grid6
  394. for (int i = 0; i < this.dataSet2.Tables["Table4"].Rows.Count; i++)
  395. {
  396. //SETUP3.通过隐藏的Table,回填到grid5
  397. //grid5的动态变化字段,与table的操作编码对应
  398. setValGrid5(this.dataSet2.Tables["Table4"].Rows[i]["QLTY_OPE_CFNM"].ToString() , this.dataSet2.Tables["Table4"].Rows[i]["QLTY_VAL"].ToString());
  399. if (this.dataSet2.Tables["Table4"].Rows[i]["QLTY_CD"].ToString() == this.ultraGrid5.ActiveRow.Cells["QLTY_CD"].Text )
  400. {
  401. //实绩值字段
  402. setValGrid5("QLTY_VAL", this.dataSet2.Tables["Table4"].Rows[i]["QLTY_VAL"].ToString());
  403. //判定结果字段
  404. setValGrid5("QLTY_DCS_RST", this.dataSet2.Tables["Table4"].Rows[i]["QLTY_DCS_RST"].ToString());
  405. }
  406. //SETUP3.通过隐藏的Table,回填到grid6
  407. setValGrid6(this.dataSet2.Tables["Table4"].Rows[i]["QLTY_OPE_CD"].ToString(), this.dataSet2.Tables["Table4"].Rows[i]["QLTY_VAL"].ToString());
  408. }
  409. this.ultraGrid5.UpdateData();
  410. this.ultraGrid6.UpdateData();
  411. this.dataSet2.Tables["Table4"].AcceptChanges();
  412. //不合格颜色提示
  413. string dcsRst = setColor("A" , this.ultraGrid5);
  414. if (dcsRst == "不合格")
  415. {
  416. MessageBox.Show("数据不合格" , "提示");
  417. }
  418. }
  419. //光标跳动处理
  420. private void CursorMove()
  421. {
  422. //换行,并编辑
  423. int grid6CurRow = this.ultraGrid6.ActiveRow.Index + 1;//下一行的序号
  424. for (int i = grid6CurRow; i < this.ultraGrid6.Rows.Count; i++)
  425. {
  426. //SETUPA OF 如果grid6未到行末,则grid6调到下一行
  427. if (i + 1 != this.ultraGrid6.Rows.Count)
  428. {
  429. if (this.ultraGrid6.Rows[i].Cells["EDIT_TP"].Text == "N")
  430. {
  431. i++;//执行i++后,可能到达了行末,所以后面需要重新判断是否到达行末
  432. }
  433. else
  434. {
  435. //this.ultraGrid6.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.NextRow);
  436. this.ultraGrid6.Rows[i].Activate();
  437. this.ultraGrid6.ActiveRow.Cells["QLTY_VAL"].Activated = true;
  438. this.ultraGrid6.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode);
  439. break;
  440. }
  441. }
  442. if (i + 1 == this.ultraGrid6.Rows.Count)// SETUPA OF 如果grid6到达行末,对grid5换行,并执行查询;需要使得grid6首行处于可编辑状态
  443. {
  444. this.ultraGrid5.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.NextRow);
  445. //this.ultraGrid5_ClickCell(null, null);
  446. this.ultraGrid6.Rows[0].Activate();
  447. this.ultraGrid6.ActiveRow.Cells["QLTY_VAL"].Activated = true;
  448. this.ultraGrid6.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode);
  449. this.ultraGrid6.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode);//不明白为什么要写两次才可以进入回车编辑状态
  450. break;
  451. }
  452. }
  453. }
  454. private ArrayList DoUpdate(string smpNo, string smpCutLoc, string smpNoType, string qltyCd2
  455. ,string qltyOpeCd, string strCompVal, string qltyDisLen, string crctReg
  456. ,string flag, string qltyVal)
  457. {
  458. ArrayList al = null;
  459. try
  460. {
  461. Hashtable ht = null;
  462. ht = new Hashtable();
  463. ht.Add("i1", smpNo);
  464. ht.Add("i2", smpCutLoc);
  465. ht.Add("i3", smpNoType);
  466. ht.Add("i4", qltyCd2);
  467. ht.Add("i5", qltyOpeCd);
  468. ht.Add("i6", strCompVal);//计算公式
  469. ht.Add("i7", qltyDisLen);//保留位数
  470. ht.Add("i8", crctReg);//修约规则
  471. ht.Add("i9", flag);//特殊处理
  472. ht.Add("i10", qltyVal);
  473. ht.Add("i11", this.UserInfo.GetUserName());
  474. ht.Add("o12", "");
  475. CoreClientParam ccp = new CoreClientParam();
  476. ccp.ServerName = "UIB.JHY.JHyComCallProc";
  477. ccp.MethodName = "doSimpleProc";
  478. ccp.ServerParams = new object[] { "UIB100203_01.CALL", ht };
  479. CoreClientParam rccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  480. al = rccp.ReturnObject as ArrayList;
  481. if (al[0] == null) { al = new ArrayList(); }
  482. }
  483. catch (Exception ex)
  484. {
  485. System.Diagnostics.Debug.WriteLine(ex.ToString());
  486. }
  487. return al;
  488. }
  489. private string DoCompVal(string strCompVal)
  490. {
  491. try
  492. {
  493. for (int i = 0; i < this.dataSet2.Tables["Table4"].Rows.Count; i++)
  494. {
  495. strCompVal = strCompVal.Replace(this.dataSet2.Tables["Table4"].Rows[i]["QLTY_OPE_CD"].ToString()
  496. , this.dataSet2.Tables["Table4"].Rows[i]["QLTY_VAL"].ToString());
  497. //判断公式的字符串是否已经替换完成,未替换完成,则不进行任何操作,进入下一次循环
  498. Regex r = new Regex(@"[A-Z,a-z]");
  499. Match m = r.Match(strCompVal);
  500. if (m.Success) continue;
  501. strCompVal = strCompVal.Replace("√", "SQRT").Replace("=", "");//开根号处理
  502. break;
  503. }
  504. }
  505. catch (Exception ex)
  506. {
  507. System.Diagnostics.Debug.WriteLine(ex.ToString());
  508. }
  509. return strCompVal;
  510. }
  511. //回填实绩值、判定结果到隐藏的Table
  512. private void setValHiddenTable(int num , ArrayList al)
  513. {
  514. try
  515. {
  516. string[] str = al[0].ToString().Split(';');
  517. this.dataSet2.Tables["Table4"].Rows[num]["QLTY_VAL"] = str[0];//回填值
  518. this.dataSet2.Tables["Table4"].Rows[num]["QLTY_DCS_RST"] = str[1];//回填判定结果
  519. }
  520. catch (Exception ex)
  521. {
  522. System.Diagnostics.Debug.WriteLine(ex.ToString());
  523. }
  524. }
  525. //回填实绩值、判定结果到grid5
  526. private void setValGrid5(string coluMnName , string val)
  527. {
  528. try
  529. {
  530. if (coluMnName != "")
  531. this.ultraGrid5.ActiveRow.Cells[coluMnName].Value = val;
  532. }
  533. catch (Exception ex)
  534. {
  535. System.Diagnostics.Debug.WriteLine(ex.ToString());
  536. }
  537. }
  538. //回填实绩值、判定结果到grid6
  539. private void setValGrid6(string qltyOpeCd, string val)
  540. {
  541. try
  542. {
  543. for (int j = 0; j < this.dataSet1.Tables["Table6"].Rows.Count; j++)
  544. {
  545. if (this.dataSet1.Tables["Table6"].Rows[j]["QLTY_OPE_CD"].ToString() == qltyOpeCd)
  546. {
  547. this.dataSet1.Tables["Table6"].Rows[j]["QLTY_VAL"] = val;
  548. break;
  549. }
  550. }
  551. }
  552. catch (Exception ex)
  553. {
  554. System.Diagnostics.Debug.WriteLine(ex.ToString());
  555. }
  556. }
  557. //颜色提示,A为不合格颜色
  558. private string setColor(string flag , Infragistics.Win.UltraWinGrid.UltraGrid grid)
  559. {
  560. string dcsRst = "";//不合格为真,合格为假
  561. if (flag == "A")
  562. {
  563. foreach (UltraGridRow ugr in grid.Rows)
  564. {
  565. if (ugr.Cells["QLTY_DCS_RST"].Text == "不合格")
  566. {
  567. ugr.RowSelectorAppearance.BackColor = Color.Red;
  568. dcsRst = "不合格";
  569. //ugr.Appearance.ForeColor = Color.Red;
  570. }
  571. else
  572. {
  573. ugr.RowSelectorAppearance.BackColor = Color.White;
  574. }
  575. }
  576. }
  577. return dcsRst;
  578. }
  579. private void ultraGrid1_ClickCell(object sender, ClickCellEventArgs e)
  580. {
  581. try
  582. {
  583. if (this.ultraGrid1.ActiveRow == null) return;
  584. strWtbh = this.ultraGrid1.ActiveRow.Cells["WEITO_NO"].Text;//委托编号,全局变量
  585. ArrayList al = new ArrayList();
  586. DataTable dt = new DataTable();
  587. //if (this.ultraTabControl1.SelectedTab.Text == "结果录入")
  588. if (this.ultraTabControl1.Tabs[3].Selected)
  589. {
  590. al.Add("UIB100220_02.SELECT");
  591. al.Add(this.strArea);
  592. al.Add(this.ultraGrid1.ActiveRow.Cells["WEITO_NO"].Text);
  593. this.dataSet1.Tables["Table3"].Clear();
  594. dt = this.dataSet1.Tables["Table3"];
  595. }
  596. else if (this.ultraTabControl1.SelectedTab.Text == "检验结果")
  597. {
  598. al.Add("UIB100220_06.SELECT");
  599. al.Add(this.strArea);//检测中心和理化楼区分
  600. al.Add(this.ultraGrid1.ActiveRow.Cells["WEITO_NO"].Text);
  601. if (this.ultraGrid1.ActiveCell.Column.Key == "MATERIAL_NO")
  602. {al.Add(this.ultraGrid1.ActiveCell.Value.ToString());}
  603. else
  604. {al.Add("");}
  605. this.dataSet1.Tables["Table2"].Clear();
  606. dt = this.dataSet1.Tables["Table2"];
  607. }
  608. else if (this.ultraTabControl1.SelectedTab.Text == "基本信息")
  609. {
  610. al.Add("UIB100220_08.SELECT");
  611. al.Add(this.strArea);
  612. al.Add(this.ultraGrid1.ActiveRow.Cells["WEITO_NO"].Text);
  613. this.dataSet1.Tables["Table7"].Clear();
  614. dt = this.dataSet1.Tables["Table7"];
  615. }
  616. else if (this.ultraTabControl1.SelectedTab.Text == "异常处理")
  617. {
  618. this.textWtbh.Text = this.ultraGrid1.ActiveRow.Cells["WEITO_NO"].Text;
  619. this.textGyh.Text = this.ultraGrid1.ActiveRow.Cells["SMP_STEEL_NO"].Text;
  620. return;
  621. }
  622. else
  623. {
  624. return;
  625. }
  626. CoreClientParam ccp = new CoreClientParam();
  627. ccp.ServerName = "UIB.JHY.JHYComQuery";
  628. ccp.MethodName = "doSimpleQuery";
  629. ccp.ServerParams = new object[] { al };
  630. ccp.SourceDataTable = dt;
  631. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  632. //不合格颜色提示
  633. if (this.ultraTabControl1.SelectedTab.Text == "检验结果")
  634. setColor("A", this.ultraGrid2);
  635. }
  636. catch (Exception ex)
  637. {
  638. System.Diagnostics.Debug.WriteLine(ex.ToString());
  639. }
  640. }
  641. private void ultraGrid4_ClickCell(object sender, ClickCellEventArgs e)
  642. {
  643. if (this.ultraGrid4.ActiveRow == null) return;
  644. this.dataSet1.Tables["Table5"].Clear();
  645. this.dataSet1.Tables["Table6"].Clear();
  646. //清除添加的列
  647. for (int i = this.dataSet1.Tables["Table5"].Columns.Count; i > Data1Table5Count; i--)
  648. {
  649. this.dataSet1.Tables["Table5"].Columns.Remove(this.dataSet1.Tables["Table5"].Columns[i - 1]);
  650. }
  651. grid5ColumnChange(this.ultraGrid4.ActiveRow.Cells["QLTY_CD_2"].Text , this.ultraGrid4.ActiveRow.Cells["QLTY_CD_3"].Text ,this.ultraGrid4.ActiveRow.Cells["QLTY_CD"].Text );
  652. this.ultraTabControl1.Tabs[3].Text = this.ultraGrid4.Rows[0].Cells["QLTY_CD_CFNM"].Text;
  653. }
  654. private void ultraGrid7_AfterRowActivate(object sender, EventArgs e)
  655. {
  656. try
  657. {
  658. this.textBoxRmkSB.Text = this.ultraGrid7.ActiveRow.Cells["RMK_1"].Text;//备注
  659. this.textBoxRmkBZ.Text = this.ultraGrid7.ActiveRow.Cells["RMK_2"].Text;//设备编号
  660. this.textBoxRmk3.Text = "检测备注";
  661. }
  662. catch (Exception ex)
  663. {
  664. System.Diagnostics.Debug.WriteLine(ex.ToString());
  665. }
  666. }
  667. private void comboBox6_SelectedIndexChanged(object sender, EventArgs e)
  668. {
  669. try
  670. {
  671. foreach (UltraGridRow ugr in this.ultraGrid5.Rows)
  672. {
  673. if(ugr.Selected)
  674. {
  675. Hashtable ht = new Hashtable();
  676. ht.Add("i1", ugr.Cells["SMP_NO"].Text);
  677. ht.Add("i2", ugr.Cells["SMP_CUT_LOC"].Text);
  678. ht.Add("i3", ugr.Cells["SMP_NO_TYPE"].Text);
  679. ht.Add("i4", ugr.Cells["QLTY_CD"].Text);
  680. ht.Add("i5", this.comboBox6.Text.Trim());
  681. ht.Add("i6", this.UserInfo.GetUserName());
  682. ht.Add("o7", "");
  683. CoreClientParam ccp = new CoreClientParam();
  684. ccp.ServerName = "UIB.JHY.JHyComCallProc";
  685. ccp.MethodName = "doSimpleProc";
  686. ccp.ServerParams = new object[] { "UIB100203_02.CALL", ht };
  687. CoreClientParam rccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  688. ArrayList al = rccp.ReturnObject as ArrayList;
  689. if (al[0] == null) return;
  690. if (al[0].ToString() == "XX") return;
  691. MessageBox.Show("修改成功" , "提示");
  692. //ugr.Cells["QLTY_CD_CFNM"].Value = al[0].ToString();
  693. }
  694. }
  695. }
  696. catch (Exception ex)
  697. {
  698. System.Diagnostics.Debug.WriteLine(ex.ToString());
  699. }
  700. }
  701. //设备
  702. private void textBoxRmkSB_KeyDown(object sender, KeyEventArgs e)
  703. {
  704. try
  705. {
  706. if (e.KeyCode != Keys.Enter) return;
  707. ArrayList al = new ArrayList();
  708. al.Add("UIB100220_01.UPDATE");
  709. al.Add(this.textBoxRmkSB.Text.Trim().ToString());
  710. al.Add(this.textBoxRmkSB.Text.Trim().ToString());
  711. al.Add(this.ultraGrid7.ActiveRow.Cells["SMP_NO"].Text);
  712. al.Add(this.ultraGrid7.ActiveRow.Cells["SMP_CUT_LOC"].Text);
  713. al.Add(this.ultraGrid7.ActiveRow.Cells["SMP_NO_TYPE"].Text);
  714. CoreClientParam ccp = new CoreClientParam();
  715. ccp.ServerName = "UIB.JHY.JHYComSave";
  716. ccp.ServerParams = new object[] { al };
  717. ccp.MethodName = "doSimpleSave";
  718. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  719. this.ultraGrid7.ActiveRow.Cells["RMK_2"].Value = this.textBoxRmkSB.Text.ToString();
  720. this.ultraGrid7.UpdateData();
  721. if (sender != null)
  722. this.textBoxRmkBZ.Focus();
  723. }
  724. catch (Exception ex)
  725. {
  726. System.Diagnostics.Debug.WriteLine(ex.ToString());
  727. }
  728. }
  729. //备注
  730. private void textBoxRmkBZ_KeyDown(object sender, KeyEventArgs e)
  731. {
  732. try
  733. {
  734. if (e.KeyCode != Keys.Enter) return;
  735. this.ultraGrid7.ActiveRow.Cells["RMK_1"].Value = this.textBoxRmkBZ.Text.ToString();
  736. textBoxRmkSB_KeyDown(null, e);
  737. this.ultraGrid7.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.NextRow);
  738. this.textBoxRmkSB.Focus();
  739. }
  740. catch (Exception ex)
  741. {
  742. System.Diagnostics.Debug.WriteLine(ex.ToString());
  743. }
  744. }
  745. //委托单号变更
  746. private void textWtbh_KeyDown(object sender, KeyEventArgs e)
  747. {
  748. try
  749. {
  750. ArrayList al = new ArrayList();
  751. al.Add("UIB100220_02.UPDATE");
  752. al.Add(this.textWtbh.Text.ToString());
  753. al.Add(this.ultraGrid1.ActiveRow.Cells["WEITO_NO"].Text);
  754. CoreClientParam ccp = new CoreClientParam();
  755. ccp.ServerName = "UIB.JHY.JHYComSave";
  756. ccp.ServerParams = new object[] { al };
  757. ccp.MethodName = "doSimpleSave";
  758. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  759. }
  760. catch (Exception ex)
  761. {
  762. System.Diagnostics.Debug.WriteLine(ex.ToString());
  763. }
  764. }
  765. private void textGyh_KeyDown(object sender, KeyEventArgs e)
  766. {
  767. if (e.KeyCode != Keys.Enter) return;//回车时,才保存数据
  768. try
  769. {
  770. Hashtable ht = new Hashtable();
  771. ht.Add("i1", this.ultraGrid1.ActiveRow.Cells["COIL_NO"].Text);
  772. ht.Add("i2", this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text);
  773. ht.Add("i3", this.ultraGrid1.ActiveRow.Cells["SMP_CUT_LOC"].Text);
  774. ht.Add("i4", this.ultraGrid1.ActiveRow.Cells["SMP_NO_TYPE"].Text);
  775. ht.Add("i5", this.textGyh.Text.Trim());
  776. ht.Add("o6", "");
  777. CoreClientParam ccp = new CoreClientParam();
  778. ccp.ServerName = "UIB.JHY.JHyComCallProc";
  779. ccp.MethodName = "doSimpleProc";
  780. ccp.ServerParams = new object[] { "UIB100203_03.CALL", ht };
  781. CoreClientParam rccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  782. //计算结果返回
  783. ArrayList al = rccp.ReturnObject as ArrayList;
  784. if (al[0] == null) return;
  785. MessageBox.Show(al[0].ToString(), "提示");
  786. }
  787. catch (Exception ex)
  788. {
  789. System.Diagnostics.Debug.WriteLine(ex.ToString());
  790. }
  791. }
  792. //导出路径修改
  793. private void button1_Click(object sender, EventArgs e)
  794. {
  795. try
  796. {
  797. string path = null;
  798. if (this.folderBrowserDialog1.ShowDialog() == DialogResult.OK)
  799. {
  800. path = this.folderBrowserDialog1.SelectedPath;
  801. this.textBoxPath.Text = path;
  802. OperateConditionRecode.WriteCondition("UIB100220_PATH", this.textBoxPath.Text);
  803. }
  804. }
  805. catch (Exception ex)
  806. {
  807. System.Diagnostics.Debug.WriteLine(ex.ToString());
  808. }
  809. }
  810. Boolean blChkci = false;
  811. private void label13_Click(object sender, EventArgs e)
  812. {
  813. blChkci = !blChkci;
  814. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  815. {
  816. ugr.Cells["CHK"].Value = blChkci;
  817. }
  818. this.ultraGrid1.UpdateData();
  819. }
  820. private void ultraTabControl1_MouseClick(object sender, MouseEventArgs e)
  821. {
  822. ultraGrid1_ClickCell(null ,null);
  823. }
  824. private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
  825. {
  826. try
  827. {
  828. /*
  829. * 由于SQL语句查询出来的动态的列,在界面上显示时并不是按照SQL语句中字段的先后顺序排列的。故:
  830. * SETUP1:查询出检验大类(如拉力)所需要的过程项目(Lo,So等),SQL的ID为UIB100220_03.SELECT
  831. * SETUP2:将查询出来的过程项目添加到grid5的数据源dataset1.Table5中
  832. * SETUP2-1:每次点击都需要添加过程项目,故而每次要先删除被添加的项目,否则第二次添加将会出错
  833. * SETUP2-2:删除dataset1.Table5中添加项,必须知道有多少列是固定的=>在界面初始化时获取固定列
  834. * SETUP3:对grid5进行操作,给动态列“设置列宽”和“设置可编辑属性”
  835. * **/
  836. if (this.ultraGrid3.ActiveRow == null) return;
  837. //int GRIDCOLS = this.ultraGrid3.DisplayLayout.Bands[0].Columns.Count;
  838. string strQltyCD2 = this.ultraGrid3.ActiveRow.Cells["QLTY_CD_2"].Text;//二级编码,如拉力,冲击
  839. string strQltyCD3 = this.ultraGrid3.ActiveRow.Cells["QLTY_CD_3"].Text;//三级编码,如屈服强度,伸长率
  840. this.dataSet1.Tables["Table4"].Clear();
  841. this.dataSet1.Tables["Table6"].Clear();
  842. this.dataSet1.Tables["Table5"].Clear();
  843. //清除添加的列
  844. for (int i = this.dataSet1.Tables["Table5"].Columns.Count; i > Data1Table5Count; i--)
  845. {
  846. this.dataSet1.Tables["Table5"].Columns.Remove(this.dataSet1.Tables["Table5"].Columns[i - 1]);
  847. }
  848. this.dataSet2.Tables["Table3"].Clear();
  849. this.dataSet2.Tables["Table4"].Clear();
  850. //SETUP1:初始化工作完成后,进行查询过程项目
  851. ArrayList list = new ArrayList();
  852. ArrayList al = new ArrayList();
  853. al.Add("UIB100220_03.SELECT");//查询大类(如拉力)所对应的操作编码,对应this.dataSet2.Tables["Table3"].Clear();
  854. al.Add(strQltyCD2);
  855. list.Add(al);
  856. al = new ArrayList();
  857. al.Add("UIB100220_07.SELECT");//查询具体项目名称和编码,对应this.dataSet1.Tables["Table4"].Clear();
  858. al.Add(strQltyCD2);
  859. al.Add(strQltyCD3);
  860. al.Add(strWtbh);
  861. list.Add(al);
  862. CoreClientParam ccp = new CoreClientParam();
  863. ccp.ServerName = "UIB.JHY.JHYComQuery";
  864. ccp.MethodName = "doContQluery";
  865. ccp.ServerParams = new object[] { list };
  866. CoreClientParam ccpList = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  867. if (ccpList.ReturnInfo.Length == 0)
  868. {
  869. ArrayList aList = ccpList.ReturnObject as ArrayList;
  870. if (aList[0] != null)
  871. {
  872. this.dataSet2.Tables["Table3"].Clear();
  873. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[0] as System.Collections.ArrayList, this.dataSet2.Tables["Table3"]);
  874. tab0.TableName = "Table3";
  875. this.dataSet2.Tables["Table3"].Merge(tab0);
  876. }
  877. if (aList[1] != null)
  878. {
  879. this.dataSet1.Tables["Table4"].Clear();
  880. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[1] as System.Collections.ArrayList, this.dataSet1.Tables["Table4"]);
  881. tab0.TableName = "Table4";
  882. this.dataSet1.Tables["Table4"].Merge(tab0);
  883. }
  884. }//end if
  885. this.ultraTabControl1.Tabs[3].Text = this.ultraGrid4.Rows[0].Cells["QLTY_CD_CFNM"].Text;
  886. grid5ColumnChange(strQltyCD2, strQltyCD3, "");//对grid5动态行的处理
  887. //不合格颜色提示
  888. setColor("A", this.ultraGrid5);
  889. }
  890. catch (Exception ex)
  891. {
  892. System.Diagnostics.Debug.WriteLine(ex.ToString());
  893. }
  894. }
  895. private void ultraGrid5_AfterRowActivate(object sender, EventArgs e)
  896. {
  897. try
  898. {
  899. ///*
  900. ///录入数据的grid6的需求决定了grid5的查询
  901. ///
  902. ///*/
  903. if (this.ultraGrid5.ActiveRow == null) return;
  904. this.dataSet1.Tables["Table6"].Clear();
  905. this.dataSet2.Tables["Table4"].Clear();
  906. ArrayList list = new ArrayList();
  907. //grid6的显示,只显示相关过程项目
  908. ArrayList al = new ArrayList();
  909. al.Add("UIB100220_05.SELECT");
  910. al.Add(this.strLine);
  911. al.Add(this.ultraGrid5.ActiveRow.Cells["SMP_NO"].Text);
  912. al.Add(this.ultraGrid5.ActiveRow.Cells["SMP_CUT_LOC"].Text);
  913. al.Add(this.ultraGrid5.ActiveRow.Cells["SMP_NO_TYPE"].Text);
  914. al.Add(this.ultraGrid5.ActiveRow.Cells["QLTY_CD_3"].Text);
  915. al.Add(this.ultraGrid5.ActiveRow.Cells["QLTY_CD_2"].Text);
  916. list.Add(al);
  917. //grid6的隐藏Table,获取所有大类(如拉力)中的过程项目,并放入this.dataSet2.Tables["Table4"]
  918. al = new ArrayList();
  919. al.Add("UIB100220_05.SELECT");
  920. al.Add(this.strLine);
  921. al.Add(this.ultraGrid5.ActiveRow.Cells["SMP_NO"].Text);
  922. al.Add(this.ultraGrid5.ActiveRow.Cells["SMP_CUT_LOC"].Text);
  923. al.Add(this.ultraGrid5.ActiveRow.Cells["SMP_NO_TYPE"].Text);
  924. al.Add("");
  925. al.Add(this.ultraGrid5.ActiveRow.Cells["QLTY_CD_2"].Text);
  926. list.Add(al);
  927. CoreClientParam ccp = new CoreClientParam();
  928. ccp.ServerName = "UIB.JHY.JHYComQuery";
  929. ccp.MethodName = "doContQluery";
  930. ccp.ServerParams = new object[] { list };
  931. CoreClientParam ccpList = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
  932. if (ccpList.ReturnInfo.Length == 0)
  933. {
  934. ArrayList aList = ccpList.ReturnObject as ArrayList;
  935. if (aList[0] != null)
  936. {
  937. this.dataSet1.Tables["Table6"].Clear();
  938. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[0] as System.Collections.ArrayList, this.dataSet1.Tables["Table6"]);
  939. tab0.TableName = "Table6";
  940. this.dataSet1.Tables["Table6"].Merge(tab0);
  941. }
  942. if (aList[1] != null)
  943. {
  944. this.dataSet2.Tables["Table4"].Clear();
  945. System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(aList[1] as System.Collections.ArrayList, this.dataSet2.Tables["Table4"]);
  946. tab0.TableName = "Table4";
  947. this.dataSet2.Tables["Table4"].Merge(tab0);
  948. }
  949. }//if end
  950. foreach (UltraGridRow ugr in this.ultraGrid6.Rows)
  951. {
  952. if (ugr.Cells["QLTY_OPE_CD"].Text == "FX")//与试样方向绑定
  953. {
  954. ugr.Cells["QLTY_VAL"].EditorComponent = this.ultraComboEditor3;
  955. }
  956. else if (ugr.Cells["QLTY_OPE_CD"].Text == "CB")//与冷弯值绑定
  957. {
  958. ugr.Cells["QLTY_VAL"].EditorComponent = this.ultraComboEditor2;
  959. }
  960. else if (ugr.Cells["QLTY_OPE_CD"].Text == "MJGG")//与剪切面积绑定
  961. {
  962. ugr.Cells["QLTY_VAL"].EditorComponent = this.ultraComboEditor4;
  963. }
  964. }
  965. }
  966. catch (Exception ex)
  967. {
  968. System.Diagnostics.Debug.WriteLine(ex.ToString());
  969. }
  970. }
  971. }//Class end
  972. }//namespace end