fb65817510011ce0af79f36071f58e1af206f6d0.svn-base 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056
  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 Infragistics.Win.UltraWinGrid;
  11. using System.Collections;
  12. using System.Diagnostics;
  13. namespace Core.LZMes.Client.UIB
  14. {
  15. public partial class UIB030110 : FrmBase
  16. {
  17. public UIB030110()
  18. {
  19. InitializeComponent();
  20. }
  21. // public DataSet ds = new DataSet();
  22. private string SLSelected = null;
  23. int jx = 1;
  24. public override void ToolBar_Click(object sender, string ToolbarKey)
  25. {
  26. switch (ToolbarKey)
  27. {
  28. case "Query":
  29. this.DoQuery();
  30. break;
  31. case "Save":
  32. this.DoSave();
  33. break;
  34. //case "FanXiu":
  35. // this.FanXiu();
  36. //break;
  37. case "Export":
  38. this.DoExport();
  39. break;
  40. }
  41. }
  42. private void DoQuery()
  43. {
  44. try
  45. {
  46. ArrayList al = new ArrayList();
  47. SLSelected = this.comboBox3.Text;
  48. if (textBox1.Text == "" && !this.checkBox1.Checked && this.textBox3.Text == "")
  49. {
  50. MessageBox.Show("请选择查询条件!", "提示");
  51. return;
  52. }
  53. //SQL
  54. if (this.comboBox3.Text == "酸轧")
  55. {
  56. al.Add("UIB030110_01.SELECT");
  57. al.Add(textBox1.Text.ToString());//轧制单元
  58. }
  59. else if (this.comboBox3.Text == "酸洗")
  60. {
  61. al.Add("UIB030110_11.SELECT");
  62. al.Add(textBox1.Text.ToString());//轧制单元
  63. }
  64. else if (this.comboBox3.Text == "连退")
  65. //al.Add("UIB030110_01_LIAN.SELECT");
  66. //20151103修改查询sql语句去掉重复的卷
  67. al.Add("UIB030110_01_LIAN_QC.SELECT");
  68. else if (this.comboBox3.Text == "重卷")//重卷
  69. {
  70. //20151103修改查询sql语句去掉重复的卷
  71. //al.Add("UIB030110_01_CJ_QC.SELECT");
  72. if (this.checkBox1.Checked)
  73. {
  74. al.Add("UIB030110_01_CJ.SELECT");
  75. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd"));//日期
  76. al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));//日期
  77. }
  78. else
  79. {
  80. al.Add("UIB030110_03_CJ.SELECT");
  81. }
  82. }
  83. //查询条件
  84. if (this.comboBox3.Text == "连退" || this.comboBox3.Text == "酸轧" || this.comboBox3.Text == "酸洗")
  85. {
  86. if (this.checkBox1.Checked)
  87. {
  88. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "000000");//日期
  89. al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") + "999999");//日期
  90. }
  91. else
  92. {
  93. al.Add("");
  94. al.Add("");
  95. }
  96. }
  97. al.Add(this.textBox3.Text.Trim());//钢卷号
  98. if (!this.checkBox1.Checked && this.textBox3.Text.Trim() == "")
  99. return;
  100. OperateConditionRecode.WriteCondition("UIB030110", this.textBox1.Text.ToString());
  101. OperateConditionRecode.WriteCondition("UIB030110_1", this.comboBox3.SelectedIndex.ToString());
  102. this.dataSet1.Tables[0].Clear();
  103. CoreClientParam ccp = new CoreClientParam();
  104. ccp.ServerName = "UIB.COM.ComDBQuery";
  105. ccp.MethodName = "doSimpleQuery";
  106. ccp.ServerParams = new object[] { al };
  107. ccp.SourceDataTable = this.dataSet1.Tables[0];
  108. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  109. //MessageBox.Show(ccp.ReturnInfo, "调试信息");
  110. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  111. {
  112. if (ugr.Cells["SMP_DIR_PIC_YN"].Text == "Y"
  113. && ugr.Cells["SMP_PICK_YN"].Text == "")
  114. {
  115. ugr.Appearance.ForeColor = Color.Red;//字体显示红色
  116. //ugr.Delete();
  117. //ugr.Hidden = true;
  118. }
  119. //判断人工录入宽度判定值与机器测量宽度实际值之差,若≥10则显示红色
  120. string COILWTH = ugr.Cells["COIL_WTH"].Text;
  121. string DCSWTH = ugr.Cells["DCS_WTH"].Text;
  122. if (COILWTH != null && COILWTH != "" && DCSWTH != null && DCSWTH != "" && DCSWTH != "0")
  123. {
  124. double chazhi = double.Parse(DCSWTH) - double.Parse(COILWTH);
  125. if (System.Math.Abs(chazhi) >= 10)
  126. {
  127. ugr.Cells["COIL_WTH"].Appearance.BackColor = Color.Red;
  128. ugr.Cells["DCS_WTH"].Appearance.BackColor = Color.Red;
  129. }
  130. else
  131. {
  132. ugr.Cells["COIL_WTH"].Appearance.BackColor = Color.White;
  133. ugr.Cells["DCS_WTH"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  134. }
  135. }
  136. else
  137. {
  138. ugr.Cells["COIL_WTH"].Appearance.BackColor = Color.White;
  139. ugr.Cells["DCS_WTH"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  140. }
  141. //判断人工录入厚度判定值与机器测量厚度实际值之差,若≥0.01则显示红色
  142. string COILTHK = ugr.Cells["COIL_THK"].Text;
  143. string DCSTHK = ugr.Cells["DCS_THK"].Text;
  144. if (COILTHK != null && COILTHK != "" && DCSTHK != null && DCSTHK != "" && DCSTHK != "0")
  145. {
  146. double chazhi = double.Parse(DCSTHK) - double.Parse(COILTHK);
  147. if (System.Math.Abs(chazhi) >= 0.01)
  148. {
  149. ugr.Cells["COIL_THK"].Appearance.BackColor = Color.Red;
  150. ugr.Cells["DCS_THK"].Appearance.BackColor = Color.Red;
  151. }
  152. else
  153. {
  154. ugr.Cells["COIL_THK"].Appearance.BackColor = Color.White;
  155. ugr.Cells["DCS_THK"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  156. }
  157. }
  158. else
  159. {
  160. ugr.Cells["COIL_THK"].Appearance.BackColor = Color.White;
  161. ugr.Cells["DCS_THK"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  162. }
  163. }
  164. }
  165. catch (Exception ex)
  166. {
  167. MessageBox.Show(ex.ToString());
  168. }
  169. }
  170. private void DoSave()
  171. {
  172. try
  173. {
  174. //this.ultraGrid1.UpdateData();//选择以后,这里必须要updatedata。
  175. ArrayList list = new ArrayList();
  176. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  177. {
  178. if (Convert.ToBoolean(ugr.Cells["CHK"].Value))
  179. {
  180. if (ugr.Cells["SMPPICK_TP"].Text == "Y")
  181. {
  182. // smpList = new ArrayList();
  183. //取样操作
  184. jx = 1;
  185. CoreClientParam ccp = new CoreClientParam();
  186. Hashtable ht = new Hashtable();
  187. ht.Add("i" + jx, SLSelected); jx++;//产线
  188. ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号
  189. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号
  190. ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置
  191. ht.Add("i" + jx, ""); jx++;//去向
  192. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//外观等级
  193. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度
  194. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度
  195. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度
  196. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度
  197. ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样
  198. ht.Add("i" + jx, ""); jx++;//外观缺陷1
  199. ht.Add("i" + jx, ""); jx++;
  200. ht.Add("i" + jx, ""); jx++;
  201. ht.Add("i" + jx, ""); jx++;
  202. ht.Add("i" + jx, ""); jx++;
  203. ht.Add("i" + jx, ""); jx++;
  204. ht.Add("i" + jx, ""); jx++;
  205. ht.Add("i" + jx, ""); jx++;
  206. ht.Add("i" + jx, ""); jx++;//外观缺陷5
  207. ht.Add("i" + jx, ""); jx++;
  208. ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人
  209. ht.Add("i" + jx, "取样登记"); jx++;//操作标志
  210. ht.Add("o" + jx, ""); jx = 1;
  211. ccp.ServerName = "UIB.COM.ComDBProcedure";
  212. ccp.MethodName = "doXmlProcedure";
  213. ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht };
  214. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  215. ugr.Cells["SMPPICK_TP"].Value = "";
  216. ArrayList all = ccp.ReturnObject as ArrayList;
  217. if (all[0].ToString() != "YY")//确认是否存在问题
  218. {
  219. MessageBox.Show(all[0].ToString(), "提示");
  220. }
  221. }
  222. if (ugr.Cells["CRK_TP"].Text == "Y")//外观缺陷
  223. {
  224. jx = 1;
  225. CoreClientParam ccp = new CoreClientParam();
  226. Hashtable ht = new Hashtable();
  227. ht.Add("i" + jx, SLSelected); jx++;//产线
  228. ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号
  229. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号
  230. ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置
  231. ht.Add("i" + jx, ""); jx++;//去向
  232. ht.Add("i" + jx, ugr.Cells["EXTSHAPE_QUALITY"].Text); jx++;//外观等级
  233. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度
  234. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度
  235. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度
  236. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度
  237. ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样
  238. ht.Add("i" + jx, ugr.Cells["CRK_CD1"].Value.ToString()); jx++;//外观缺陷1
  239. ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++;
  240. ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString()); jx++;
  241. ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++;
  242. ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString()); jx++;
  243. ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++;
  244. ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString()); jx++;
  245. ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++;
  246. ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString()); jx++;//外观缺陷5
  247. ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++;
  248. ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人
  249. ht.Add("i" + jx, "外观缺陷录入"); jx++;//操作标志
  250. ht.Add("o" + jx, ""); jx = 1;
  251. ccp.ServerName = "UIB.COM.ComDBProcedure";
  252. ccp.MethodName = "doXmlProcedure";
  253. ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht };
  254. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  255. ugr.Cells["CRK_TP"].Value = "";
  256. ArrayList all = ccp.ReturnObject as ArrayList;
  257. if (all[0].ToString() != "YY")//确认是否存在问题
  258. {
  259. MessageBox.Show(all[0].ToString(), "提示");
  260. }
  261. }
  262. if (ugr.Cells["EXSHAPE_TP"].Text == "Y")//外观等级
  263. {
  264. jx = 1;
  265. CoreClientParam ccp = new CoreClientParam();
  266. Hashtable ht = new Hashtable();
  267. ht.Add("i" + jx, SLSelected); jx++;//产线
  268. ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号
  269. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号
  270. ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置
  271. // ht.Add("i" + jx, ugr.Cells["COIL_RT"].Text); jx++;//去向
  272. ht.Add("i" + jx, ugr.Cells["CUR_PROG_CD"].Text); jx++;//20190228指定钢卷去向
  273. ht.Add("i" + jx, ugr.Cells["EXTSHAPE_QUALITY"].Text); jx++;//外观等级
  274. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度
  275. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度
  276. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度
  277. ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度
  278. ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样
  279. ht.Add("i" + jx, ugr.Cells["CRK_CD1"].Value.ToString()); jx++;//外观缺陷1
  280. ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++;
  281. ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString()); jx++;
  282. ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++;
  283. ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString()); jx++;
  284. ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++;
  285. ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString()); jx++;
  286. ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++;
  287. ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString()); jx++;//外观缺陷5
  288. ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++;
  289. ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人
  290. ht.Add("i" + jx, "外观等级录入"); jx++;//操作标志
  291. ht.Add("o" + jx, ""); jx = 1;
  292. ccp.ServerName = "UIB.COM.ComDBProcedure";
  293. ccp.MethodName = "doXmlProcedure";
  294. ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht };
  295. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  296. ugr.Cells["EXSHAPE_TP"].Value = "";
  297. ArrayList all = ccp.ReturnObject as ArrayList;
  298. if (all[0].ToString() != "YY")//确认是否存在问题
  299. {
  300. MessageBox.Show(all[0].ToString(), "提示");
  301. }
  302. }
  303. }
  304. }
  305. this.ultraGrid1.UpdateData();
  306. this.DoQuery();
  307. }
  308. catch (Exception ex)
  309. {
  310. System.Diagnostics.Debug.WriteLine(ex.ToString());
  311. }
  312. }
  313. //导出
  314. public void DoExport()
  315. {
  316. try
  317. {
  318. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  319. {
  320. string fName = this.saveFileDialog1.FileName;
  321. this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
  322. Process.Start(fName);
  323. }
  324. }
  325. catch (Exception ex)
  326. {
  327. System.Diagnostics.Debug.WriteLine(ex.ToString());
  328. }
  329. }
  330. //页面初始化时加载钢卷缺陷
  331. public void initCoilDefect()
  332. {
  333. try
  334. {
  335. //缺陷
  336. ArrayList alt = new ArrayList();
  337. alt.Add("UIB030110_02.SELECT");
  338. this.ultraCombo1Dataset.Tables[0].Clear();
  339. CoreClientParam ccp = new CoreClientParam();
  340. ccp.ServerName = "UIB.COM.ComDBQuery";
  341. ccp.MethodName = "doSimpleQuery";
  342. ccp.ServerParams = new object[] { alt };
  343. ccp.SourceDataTable = this.ultraCombo1Dataset.Tables[0];
  344. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  345. //进程
  346. alt = new ArrayList();
  347. alt.Add("UIB030110_01.INIT_SELECT");
  348. this.ultraCombo1Dataset.Tables[1].Clear();
  349. ccp = new CoreClientParam();
  350. ccp.ServerName = "UIB.COM.ComDBQuery";
  351. ccp.MethodName = "doSimpleQuery";
  352. ccp.ServerParams = new object[] { alt };
  353. ccp.SourceDataTable = this.ultraCombo1Dataset.Tables[0];
  354. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  355. }
  356. catch (Exception ex)
  357. {
  358. System.Diagnostics.Debug.WriteLine(ex.ToString());
  359. }
  360. }
  361. private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  362. {
  363. try
  364. {
  365. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  366. {
  367. if (ugr.Cells["SMP_DIR_PIC_YN"].Text.Equals("Y") && ugr.Cells["CHK"].Text.ToLower() == "true") //无取样指示则不允许进行取样操作
  368. {
  369. ugr.Cells["SMP_PICK_YN"].Value = this.comboBox1.SelectedItem.ToString();//执行取样操作,或者去除取样标记
  370. ugr.Cells["SMPPICK_TP"].Value = "Y";
  371. }
  372. }
  373. this.ultraGrid1.UpdateData();
  374. }
  375. catch (Exception ex)
  376. {
  377. System.Diagnostics.Debug.WriteLine(ex.ToString());
  378. }
  379. }
  380. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  381. {
  382. //取样后,重新去掉取样标记,便于下次取样操作
  383. this.comboBox1.SelectedIndex = 0;
  384. }
  385. private void UIB020310_Load(object sender, EventArgs e)
  386. {
  387. try
  388. {
  389. this.comboBox1.SelectedIndex = 0;
  390. this.comboBox2.SelectedIndex = 0;
  391. // this.comboBox3.SelectedIndex = 0;
  392. this.ultraDateTimeEditor1.Enabled = this.checkBox1.Checked;
  393. this.ultraDateTimeEditor2.Enabled = this.checkBox1.Checked;
  394. this.textBox1.Text = OperateConditionRecode.ReadCondition("UIB030110");
  395. //this.comboBox3.Text = OperateConditionRecode.ReadCondition("UIB030110_1");
  396. this.comboBox3.SelectedIndex = Convert.ToInt32(OperateConditionRecode.ReadCondition("UIB030110_1"));
  397. initCoilDefect();
  398. }
  399. catch (Exception ex)
  400. {
  401. MessageBox.Show("初始化异常");
  402. }
  403. }
  404. private void label5_Click(object sender, EventArgs e)
  405. {
  406. }
  407. private void ultraGrid1_CellChange(object sender, CellEventArgs e)
  408. {
  409. }
  410. private void button1_Click(object sender, EventArgs e)
  411. {
  412. try
  413. {
  414. CUIB030110 CWindow = new CUIB030110();
  415. CWindow.ob = this.ob;
  416. //CWindow.frmdoquery += new CUIB030110.ddd(CWindow_frmdoquery);//委托
  417. if (CWindow.ShowDialog() == DialogResult.OK)
  418. {
  419. int arrayCount = CWindow.al.Count;
  420. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  421. {
  422. if (ugr.Cells["CHK"].Text.ToLower() == "true")
  423. { //有选中项时,先进行清空。因为有初始选N个,第二次选M个。不清除,当M<N是,会残留N-M个。
  424. ugr.Cells["CRK_CD1"].Value = "";
  425. ugr.Cells["CRK_CD1_TYPE"].Value = "";
  426. ugr.Cells["CRK_CD2"].Value = "";
  427. ugr.Cells["CRK_CD2_TYPE"].Value = "";
  428. ugr.Cells["CRK_CD3"].Value = "";
  429. ugr.Cells["CRK_CD3_TYPE"].Value = "";
  430. ugr.Cells["CRK_CD4"].Value = "";
  431. ugr.Cells["CRK_CD4_TYPE"].Value = "";
  432. ugr.Cells["CRK_CD5"].Value = "";
  433. ugr.Cells["CRK_CD5_TYPE"].Value = "";
  434. for (int i = 0; i < arrayCount; i++)
  435. {
  436. // MessageBox.Show(CWindow.al[i].ToString() +"---------"+ CWindow.al[i].ToString().Substring(2));
  437. ugr.Cells["CRK_CD" + Convert.ToString((i + 1))].Value = CWindow.al.GetByIndex(i).ToString().Substring(0, 2);
  438. ugr.Cells["CRK_CD" + Convert.ToString((i + 1)) + "_TYPE"].Value = CWindow.al.GetByIndex(i).ToString().Substring(2);
  439. }
  440. ugr.Cells["CRK_TP"].Value = "Y";
  441. }
  442. }
  443. }
  444. CWindow.Dispose();
  445. this.ultraGrid1.UpdateData();
  446. }
  447. catch (Exception ex)
  448. {
  449. System.Diagnostics.Debug.WriteLine(ex.ToString());
  450. }
  451. }
  452. //委托,暂未使用
  453. void CWindow_frmdoquery()
  454. {
  455. try
  456. {
  457. }
  458. catch (Exception ex)
  459. {
  460. MessageBox.Show(ex.ToString());
  461. }
  462. }
  463. private void ultraCombo1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
  464. {
  465. }
  466. private void button2_Click(object sender, EventArgs e)
  467. {
  468. try
  469. {
  470. CUIB030110SP childCib02 = new CUIB030110SP();
  471. childCib02.ob = this.ob;
  472. if (childCib02.ShowDialog() == DialogResult.OK)
  473. {
  474. }
  475. childCib02.Close();
  476. }
  477. catch (Exception ex)
  478. {
  479. System.Diagnostics.Debug.WriteLine(ex.ToString());
  480. }
  481. }
  482. //回车保存返修温度、粗糙度、判定厚度、判定宽度
  483. private void ultraGrid1_KeyDown_1(object sender, KeyEventArgs e)
  484. {
  485. try
  486. {
  487. //if (SLSelected == "酸轧")
  488. // return;
  489. if (e.KeyCode != Keys.Enter)
  490. return; //只对回车事件操作
  491. if (this.ultraGrid1.ActiveCell.Column.Key != "DCS_THK"//只对判定厚度、返修温度、判定宽度操作
  492. && this.ultraGrid1.ActiveCell.Column.Key != "DCS_WTH"
  493. && this.ultraGrid1.ActiveCell.Column.Key != "CAL_TYPE_TEMP"
  494. && this.ultraGrid1.ActiveCell.Column.Key != "CU_CAO_DU"
  495. && this.ultraGrid1.ActiveCell.Column.Key != "YUAN_COIL_THK"
  496. && this.ultraGrid1.ActiveCell.Column.Key != "YUAN_COIL_WTH"
  497. )
  498. return;
  499. if (this.ultraGrid1.ActiveCell.DataChanged == false) return;//无数据变更时不做修改操作
  500. jx = 1;
  501. CoreClientParam ccp = new CoreClientParam();
  502. Hashtable ht = new Hashtable();
  503. ht.Add("i" + jx, SLSelected); jx++;//产线
  504. ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["COIL_NO"].Text); jx++;//钢卷号
  505. ht.Add("i" + jx, ""); jx++;//试样号
  506. ht.Add("i" + jx, ""); jx++;//位置
  507. ht.Add("i" + jx, ""); jx++;//去向
  508. ht.Add("i" + jx, ""); jx++;//外观等级
  509. ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Text); jx++;//录入厚度
  510. ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Text); jx++;//录入宽度
  511. ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["CAL_TYPE_TEMP"].Text); jx++;//温度
  512. ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["CU_CAO_DU"].Text); jx++;//粗糙度
  513. ht.Add("i" + jx, ""); jx++;//是否取样
  514. ht.Add("i" + jx, ""); jx++;//外观缺陷1
  515. ht.Add("i" + jx, ""); jx++;
  516. ht.Add("i" + jx, ""); jx++;
  517. ht.Add("i" + jx, ""); jx++;
  518. ht.Add("i" + jx, ""); jx++;
  519. ht.Add("i" + jx, ""); jx++;
  520. ht.Add("i" + jx, ""); jx++;
  521. ht.Add("i" + jx, ""); jx++;
  522. ht.Add("i" + jx, ""); jx++;//外观缺陷5
  523. ht.Add("i" + jx, ""); jx++;
  524. ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人
  525. ht.Add("i" + jx, "判定规格录入"); jx++;//操作标志
  526. ht.Add("o" + jx, ""); jx = 1;
  527. ccp.ServerName = "UIB.COM.ComDBProcedure";
  528. ccp.MethodName = "doXmlProcedure";
  529. ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht };
  530. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  531. ArrayList all = ccp.ReturnObject as ArrayList;
  532. if (all[0].ToString() != "YY")//确认是否存在问题
  533. {
  534. MessageBox.Show(all[0].ToString(), "提示");
  535. }
  536. int currentColIndex = this.ultraGrid1.ActiveCell.Column.Index;//换行前获取当前列的列序号
  537. //取消录入判定宽度值覆盖原来的机器测量宽度实绩值
  538. //this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Value = this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Text;////////
  539. //判断人工录入判定值与机器测量实际值之差,若≥10则显示红色
  540. string COILWTH = this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Text;
  541. string DCSWTH = this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Text;
  542. if (COILWTH != null && COILWTH != "" && DCSWTH != null && DCSWTH != "")
  543. {
  544. double chazhi = double.Parse(DCSWTH) - double.Parse(COILWTH);
  545. if (System.Math.Abs(chazhi) >= 10)
  546. {
  547. this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Appearance.BackColor = Color.Red;
  548. this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Appearance.BackColor = Color.Red;
  549. }
  550. else
  551. {
  552. this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Appearance.BackColor = Color.White;
  553. this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Appearance.BackColor = Color.FromArgb(255, 255, 128); //黄色
  554. }
  555. }
  556. else
  557. {
  558. this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Appearance.BackColor = Color.White;
  559. this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  560. }
  561. //判断人工录入厚度判定值与机器测量厚度实际值之差,若≥0.01则显示红色
  562. string COILTHK = this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Text;
  563. string DCSTHK = this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Text;
  564. if (COILTHK != null && COILTHK != "" && DCSTHK != null && DCSTHK != "")
  565. {
  566. double chazhi = double.Parse(DCSTHK) - double.Parse(COILTHK);
  567. if (System.Math.Abs(chazhi) >= 0.01)
  568. {
  569. this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Appearance.BackColor = Color.Red;
  570. this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Appearance.BackColor = Color.Red;
  571. }
  572. else
  573. {
  574. this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Appearance.BackColor = Color.White;
  575. this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  576. }
  577. }
  578. else
  579. {
  580. this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Appearance.BackColor = Color.White;
  581. this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
  582. }
  583. //换行并使其可编辑
  584. this.ultraGrid1.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.NextRow);
  585. this.ultraGrid1.ActiveRow.Cells[currentColIndex].Activate();
  586. this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
  587. }
  588. catch (Exception ex)
  589. {
  590. MessageBox.Show(ex.ToString());
  591. System.Diagnostics.Debug.WriteLine(ex.ToString());
  592. }
  593. }
  594. private void ultraGrid1_MouseDown(object sender, MouseEventArgs e)
  595. {
  596. try
  597. {
  598. if (this.ultraGrid1.ActiveCell.Column.Key == "ORD_NO")//链接到品质设计结果查询
  599. {
  600. UIB010301 frm = new UIB010301();
  601. frm.ob = this.ob;
  602. frm.OrderNO = this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text;
  603. frm.OrderSEQ = this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text;
  604. frm.ShowDialog();
  605. this.ultraGrid1.ActiveRow.Cells["SPEC_ABBSYM"].Activate();//换焦点
  606. }
  607. else if (this.ultraGrid1.ActiveCell.Column.Key == "COIL_NO")
  608. {
  609. this.dataSet2.Tables[0].Clear();
  610. if (this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text != "")
  611. {
  612. ArrayList al = new ArrayList();
  613. al.Add("UIB030110_03.SELECT");
  614. al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text);
  615. al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_CUT_LOC"].Text);
  616. this.dataSet2.Tables[0].Clear();
  617. CoreClientParam ccp = new CoreClientParam();
  618. ccp.ServerName = "UIB.COM.ComDBQuery";
  619. ccp.MethodName = "doSimpleQuery";
  620. ccp.ServerParams = new object[] { al };
  621. ccp.SourceDataTable = this.dataSet2.Tables[0];
  622. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  623. }
  624. //this.ultraGrid1.ActiveRow.Cells["SPEC_ABBSYM"].Activate();//换焦点
  625. }
  626. }
  627. catch (Exception ex)
  628. {
  629. System.Diagnostics.Debug.WriteLine(ex.ToString());
  630. }
  631. }
  632. private void textBox1_KeyDown(object sender, KeyEventArgs e)
  633. {
  634. try
  635. {
  636. if (e.KeyCode != Keys.Enter)
  637. return; //只对回车事件操作
  638. this.DoQuery();
  639. }
  640. catch (Exception ex)
  641. {
  642. System.Diagnostics.Debug.WriteLine(ex.ToString());
  643. }
  644. }
  645. private void checkBox1_Click(object sender, EventArgs e)
  646. {
  647. this.ultraDateTimeEditor1.Enabled = this.checkBox1.Checked;
  648. this.ultraDateTimeEditor2.Enabled = this.checkBox1.Checked;
  649. }
  650. private void ultraComboEditor1_SelectionChanged_1(object sender, EventArgs e)
  651. {
  652. try
  653. {
  654. object chk_ex = ultraComboEditor1.Value;
  655. if (this.ultraGrid1.ActiveRow == null || chk_ex == null) return;
  656. string chek_exs = chk_ex.ToString();
  657. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  658. {
  659. if (ugr.Cells["CHK"].Text.ToLower() == "true")
  660. {
  661. string sz_exp = ugr.Cells["EXTSHAPE_QUALITY_S"].Text;
  662. if (this.comboBox3.Text == "连退")
  663. {
  664. //与酸轧的外观等级进行比较是否一致,不一致则弹出提示
  665. if (!sz_exp.Equals(chek_exs))
  666. {
  667. if (MessageBox.Show("所选外观等级与酸轧的外观等级不一致,确定要继续吗?", "确认提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
  668. {
  669. ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定
  670. ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs;
  671. }
  672. }
  673. else
  674. {
  675. ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定
  676. ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs;
  677. }
  678. }
  679. else if (this.comboBox3.Text == "重卷")
  680. {
  681. string lt_exp = ugr.Cells["EXTSHAPE_QUALITY_L"].Text;
  682. if (sz_exp.Equals(chek_exs) && lt_exp.Equals(chek_exs))
  683. {
  684. ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定
  685. ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs;
  686. }
  687. else
  688. {
  689. if (MessageBox.Show("所选外观等级与酸轧或连退的外观等级不一致,确定要继续吗?", "确认提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
  690. {
  691. ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定
  692. ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs;
  693. }
  694. }
  695. }
  696. else
  697. {
  698. ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定
  699. ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs;
  700. }
  701. }
  702. }
  703. this.ultraGrid1.UpdateData();
  704. }
  705. catch (Exception ex)
  706. {
  707. System.Diagnostics.Debug.WriteLine(ex.ToString());
  708. }
  709. }
  710. private void ultraGrid1_Click(object sender, EventArgs e)
  711. {
  712. }
  713. //返修或降级处理
  714. private void comboBox4_SelectedIndexChanged(object sender, EventArgs e)
  715. {
  716. try
  717. {
  718. string MES = "";
  719. if (this.comboBox4.Text == "返修" || this.comboBox4.Text == "过渡")
  720. {
  721. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  722. {
  723. if (Convert.ToBoolean(ugr.Cells["CHK"].Value))
  724. {
  725. MES += string.Format(ugr.Cells["COIL_NO"].Value.ToString()+":");
  726. if (ugr.Cells["COIL_THK"].Value.ToString() == "0")
  727. MES += string.Format("厚度为0");
  728. if (ugr.Cells["COIL_WTH"].Value.ToString() == "0")
  729. MES += string.Format("宽度为0");
  730. if (ugr.Cells["WGT_DEC_RST"].Value.ToString() == "")
  731. MES += string.Format("重量未判");
  732. if (ugr.Cells["EXTSHAPE_DEC_GRD"].Value.ToString() == "")
  733. MES += string.Format("外观未判");
  734. if (ugr.Cells["COIL_THK"].Value.ToString() != "0" && ugr.Cells["COIL_WTH"].Value.ToString() != "0"
  735. && ugr.Cells["WGT_DEC_RST"].Value.ToString() != "" && ugr.Cells["EXTSHAPE_DEC_GRD"].Value.ToString() != "")
  736. MES += string.Format("可以判过渡/返修");
  737. MES += string.Format("\r\n");
  738. }
  739. }
  740. if (MessageBox.Show(MES, "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  741. return;
  742. }
  743. if (MessageBox.Show("确定执行该操作?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  744. return;
  745. if ((SLSelected == "酸轧")||(SLSelected == "酸洗"))//连退才有返修操作
  746. {
  747. if (this.comboBox4.Text == "封闭" || this.comboBox4.Text == "取消封闭"
  748. || this.comboBox4.Text == "返修" || this.comboBox4.Text == "取消返修"
  749. || this.comboBox4.Text == "过渡" || this.comboBox4.Text == "取消过渡" || this.comboBox4.Text == "处置")
  750. {
  751. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  752. {
  753. if (Convert.ToBoolean(ugr.Cells["CHK"].Value))
  754. {
  755. if (this.comboBox4.Text == "封闭")
  756. {
  757. object prog_cd = ugr.Cells["CUR_PROG_CD"].Value;
  758. if (prog_cd != null && (prog_cd.ToString() == "运送待机" || prog_cd.ToString() == "运送完成" || prog_cd.ToString() == "DFB"
  759. || prog_cd.ToString() == "DFF" || prog_cd.ToString() == "SFB" || prog_cd.ToString() == "SFF"))
  760. {
  761. MessageBox.Show("运送待机或运送完成的钢卷不能做封闭操作!", "提示");
  762. return;
  763. }
  764. }
  765. ugr.Cells["FB_YN"].Value = this.comboBox4.Text;
  766. CoreClientParam ccp = new CoreClientParam();
  767. Hashtable ht = new Hashtable();
  768. ht.Add("i1", ugr.Cells["COIL_NO"].Text);
  769. ht.Add("i2", this.comboBox4.Text);
  770. ht.Add("i3", this.textBox4.Text);
  771. ht.Add("i4", this.UserInfo.GetUserName().ToString());
  772. ht.Add("o5", "");
  773. ccp.ServerName = "UIB.COM.ComDBProcedure";
  774. ccp.MethodName = "doXmlProcedure";
  775. ccp.ServerParams = new object[] { "UIB030110_01_SUAN.CALL", ht };
  776. CoreClientParam rccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  777. ArrayList all = rccp.ReturnObject as ArrayList;
  778. if (all[0].ToString() != "YY")//确认是否存在问题
  779. {
  780. MessageBox.Show(all[0].ToString(), "提示");
  781. }
  782. }
  783. }
  784. }
  785. return;
  786. }
  787. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  788. {
  789. if (Convert.ToBoolean(ugr.Cells["CHK"].Value))
  790. {
  791. if (this.comboBox4.Text == "封闭")
  792. {
  793. object prog_cd = ugr.Cells["CUR_PROG_CD"].Value;
  794. if (prog_cd != null && (prog_cd.ToString() == "运送待机" || prog_cd.ToString() == "运送完成" || prog_cd.ToString() == "DFB"
  795. || prog_cd.ToString() == "DFF" || prog_cd.ToString() == "SFB" || prog_cd.ToString() == "SFF"))
  796. {
  797. MessageBox.Show("运送待机或运送完成的钢卷不能做封闭操作!", "提示");
  798. return;
  799. }
  800. }
  801. if (this.comboBox4.Text == "" || this.comboBox4.Text == "返修")
  802. {
  803. ugr.Cells["FAN_XIU"].Value = this.comboBox4.Text;
  804. }
  805. else
  806. {
  807. ugr.Cells["RCAL_CNT"].Value = this.comboBox4.Text;
  808. }
  809. CoreClientParam ccp = new CoreClientParam();
  810. Hashtable ht = new Hashtable();
  811. ht.Add("i1", ugr.Cells["COIL_NO"].Text);
  812. ht.Add("i2", this.comboBox4.Text);
  813. ht.Add("i3", this.textBox4.Text);
  814. ht.Add("i4", this.UserInfo.GetUserName().ToString());
  815. ht.Add("o5", "");
  816. ccp.ServerName = "UIB.COM.ComDBProcedure";
  817. ccp.MethodName = "doXmlProcedure";
  818. ccp.ServerParams = new object[] { "UIB030110_01_LIAN.CALL", ht };
  819. CoreClientParam rccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  820. ArrayList all = rccp.ReturnObject as ArrayList;
  821. if (all[0].ToString() != "YY")//确认是否存在问题
  822. {
  823. MessageBox.Show(all[0].ToString(), "提示");
  824. }
  825. }
  826. }
  827. this.DoQuery();
  828. }
  829. catch (Exception ex)
  830. {
  831. MessageBox.Show("系统发生错误", "提示");
  832. }
  833. }
  834. private void comboBox5_SelectedIndexChanged(object sender, EventArgs e)
  835. {
  836. try
  837. {
  838. //foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  839. //{
  840. // if (ugr.Cells["CHK"].Text.ToLower() == "true") //无取样指示则不允许进行取样操作
  841. // {
  842. // ugr.Cells["COIL_RT"].Value = this.comboBox5.SelectedItem.ToString();//执行取样操作,或者去除取样标记
  843. // ugr.Cells["EXSHAPE_TP"].Value = "Y";//与外观判定的更新放在一起
  844. // }
  845. //}
  846. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  847. {
  848. if (ugr.Cells["CHK"].Text.ToLower() == "true") //无取样指示则不允许进行取样操作
  849. {
  850. ugr.Cells["CUR_PROG_CD"].Value = this.comboBox6.SelectedItem.ToString();//执行取样操作,或者去除取样标记
  851. ugr.Cells["EXSHAPE_TP"].Value = "Y";//与外观判定的更新放在一起
  852. }
  853. }
  854. this.ultraGrid1.UpdateData();
  855. }
  856. catch (Exception ex)
  857. {
  858. System.Diagnostics.Debug.WriteLine(ex.ToString());
  859. }
  860. }
  861. private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
  862. {
  863. UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[0];
  864. if (comboBox2.SelectedItem.ToString() == "全部"){
  865. band.ColumnFilters["FB_YN"].ClearFilterConditions();
  866. band.ColumnFilters["EXTSHAPE_DEC_GRD"].ClearFilterConditions();
  867. band.ColumnFilters["SMP_DIR_PIC_YN"].ClearFilterConditions();
  868. band.ColumnFilters["SMP_PICK_YN"].ClearFilterConditions();
  869. }
  870. else if (comboBox2.SelectedItem.ToString() == "封闭卷")
  871. {
  872. band.ColumnFilters["FB_YN"].ClearFilterConditions();
  873. band.ColumnFilters["EXTSHAPE_DEC_GRD"].ClearFilterConditions();
  874. band.ColumnFilters["SMP_DIR_PIC_YN"].ClearFilterConditions();
  875. band.ColumnFilters["SMP_PICK_YN"].ClearFilterConditions();
  876. band.ColumnFilters["FB_YN"].FilterConditions.Add(FilterComparisionOperator.Equals, "Y");
  877. }
  878. else if (comboBox2.SelectedItem.ToString() == "待判卷")
  879. {
  880. band.ColumnFilters["FB_YN"].ClearFilterConditions();
  881. band.ColumnFilters["EXTSHAPE_DEC_GRD"].ClearFilterConditions();
  882. band.ColumnFilters["SMP_DIR_PIC_YN"].ClearFilterConditions();
  883. band.ColumnFilters["SMP_PICK_YN"].ClearFilterConditions();
  884. band.ColumnFilters["EXTSHAPE_DEC_GRD"].FilterConditions.Add(FilterComparisionOperator.NotEquals,1);
  885. band.ColumnFilters["EXTSHAPE_DEC_GRD"].FilterConditions.Add(FilterComparisionOperator.NotEquals, 2);
  886. }
  887. else if (comboBox2.SelectedItem.ToString() == "未取样卷")
  888. {
  889. band.ColumnFilters["FB_YN"].ClearFilterConditions();
  890. band.ColumnFilters["EXTSHAPE_DEC_GRD"].ClearFilterConditions();
  891. band.ColumnFilters["SMP_DIR_PIC_YN"].ClearFilterConditions();
  892. band.ColumnFilters["SMP_PICK_YN"].ClearFilterConditions();
  893. band.ColumnFilters["SMP_DIR_PIC_YN"].FilterConditions.Add(FilterComparisionOperator.Equals, "Y");
  894. band.ColumnFilters["SMP_PICK_YN"].FilterConditions.Add(FilterComparisionOperator.NotEquals, "Y");
  895. }
  896. }
  897. private void comboBox6_SelectedIndexChanged(object sender, EventArgs e)
  898. {
  899. try
  900. {
  901. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  902. {
  903. if (ugr.Cells["CHK"].Text.ToLower() == "true") //无取样指示则不允许进行取样操作
  904. {
  905. ugr.Cells["CUR_PROG_CD"].Value = this.comboBox6.SelectedItem.ToString();//执行取样操作,或者去除取样标记
  906. ugr.Cells["EXSHAPE_TP"].Value = "Y";//与外观判定的更新放在一起
  907. }
  908. }
  909. this.ultraGrid1.UpdateData();
  910. }
  911. catch (Exception ex)
  912. {
  913. System.Diagnostics.Debug.WriteLine(ex.ToString());
  914. }
  915. }
  916. //private void ultraGrid1_KeyUp(object sender, KeyEventArgs e)
  917. //{
  918. // int currentColIndex = this.ultraGrid1.ActiveCell.Column.Index;
  919. // switch (e.KeyCode)
  920. // {
  921. // case Keys.Up:
  922. // this.ultraGrid1.PerformAction(UltraGridAction.ExitEditMode);
  923. // this.ultraGrid1.PerformAction(UltraGridAction.AboveRow);
  924. // this.ultraGrid1.ActiveRow.Cells[currentColIndex].Activate();
  925. // e.Handled = true;
  926. // this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
  927. // break;
  928. // case Keys.Down:
  929. // this.ultraGrid1.PerformAction(UltraGridAction.ExitEditMode);
  930. // this.ultraGrid1.PerformAction(UltraGridAction.NextRow);
  931. // this.ultraGrid1.ActiveRow.Cells[currentColIndex].Activate();
  932. // e.Handled = true;
  933. // this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
  934. // break;
  935. // case Keys.Right:
  936. // this.ultraGrid1.PerformAction(UltraGridAction.ExitEditMode);
  937. // this.ultraGrid1.PerformAction(UltraGridAction.NextCell);
  938. // e.Handled = true;
  939. // this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
  940. // break;
  941. // case Keys.Left:
  942. // this.ultraGrid1.PerformAction(UltraGridAction.ExitEditMode);
  943. // this.ultraGrid1.PerformAction(UltraGridAction.PrevCell);
  944. // e.Handled = true;
  945. // this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
  946. // break;
  947. // }
  948. //}
  949. }
  950. }