FrmStuffSurfaceInspection.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  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 Core.StlMes.Client.YdmStuffManage.Entity;
  11. using Core.Mes.Client.Comm.Tool;
  12. using System.Collections;
  13. using Infragistics.Win.UltraWinEditors;
  14. using Core.StlMes.Client.YdmBase;
  15. using Infragistics.Win.UltraWinGrid;
  16. using Core.Mes.Client.Comm.Format;
  17. using Infragistics.Win;
  18. using Core.Mes.Client.Comm.Server;
  19. namespace Core.StlMes.Client.YdmStuffManage
  20. {
  21. public partial class FrmStuffSurfaceInspection : FrmBase
  22. {
  23. public FrmStuffSurfaceInspection()
  24. {
  25. InitializeComponent();
  26. }
  27. private void FrmStuffSurfaceInspection_Load(object sender, EventArgs e)
  28. {
  29. DateTime now = DateTime.Now;
  30. DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
  31. DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
  32. RegStartTime.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
  33. RegEndTime.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
  34. EntityHelper.ShowGridCaption<MatGpMEntity1>(ultraGrid2.DisplayLayout.Bands[0]);
  35. EntityHelper.ShowGridCaption<QcmLgSurfaceCEntity>(ultraGrid2.DisplayLayout.Bands[1]);
  36. EntityHelper.ShowGridCaption<StlLgSurfaceMEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  37. EntityHelper.ShowGridCaption<QcmLgSurfaceCEntity>(ultraGrid1.DisplayLayout.Bands[1]);
  38. BaseMethod.InitCellPosition(ultraGrid2, new string[] {"ActCount", "ActLenMax", "ActLenMin", "ActTheoryWeight", "ActHeight", "ActDimater", "CuttingNum", "ActLen", "ActFixNum", "ActFixLen" });
  39. BaseMethod.InitCellPosition(ultraGrid2, new string[] { "ActCount", "ActTheoryWeight", "ActLen", "CheckLen", "ActDimater", "CheckDimater" }, 1);
  40. BaseMethod.InitCellPosition(ultraGrid1, new string[] { "ActCount", "ActLenMax", "ActLenMin", "ActTheoryWeight", "ActDimater", "ActLen", "ActFixNum", "ActFixLen", "Quantity", "Eligiblequty"});
  41. BaseMethod.InitCellPosition(ultraGrid1, new string[] { "ActCount", "ActTheoryWeight", "ActLen", "CheckLen", "ActDimater", "CheckDimater" }, 1);
  42. InitBaseBug();
  43. }
  44. UltraComboEditor bugLocation = new UltraComboEditor();
  45. UltraComboEditor bugName1 = new UltraComboEditor();
  46. UltraComboEditor bugName2 = new UltraComboEditor();
  47. UltraComboEditor bugName3 = new UltraComboEditor();
  48. UltraComboEditor bugName4 = new UltraComboEditor();
  49. UltraComboEditor bugName5 = new UltraComboEditor();
  50. /// <summary>
  51. /// 加载缺陷
  52. /// </summary>
  53. private void InitBaseBug()
  54. {
  55. ClsBaseInfo.FillComBaseInfo(bugLocation, "4082", ob, true);
  56. //YdmBaseClass.InitComboEditor(bugLocation, "com.steering.pss.ydm.Stuffmanage.FrmStuffSurfaceInspection.getBugLocation", "BASECODE", this.ob, true);
  57. YdmBaseClass.BindColumn(bugLocation, "BugPosName", this.Controls, this.ultraGrid2, 1);
  58. YdmBaseClass.InitComboEditor(bugName1, "com.steering.pss.ydm.Stuffmanage.FrmStuffSurfaceInspection.getBugName", "BASECODE", this.ob, true);
  59. YdmBaseClass.BindColumn(bugName1, "BugName1", this.Controls, this.ultraGrid2, 1);
  60. YdmBaseClass.InitComboEditor(bugName2, "com.steering.pss.ydm.Stuffmanage.FrmStuffSurfaceInspection.getBugName", "BASECODE", this.ob, true);
  61. YdmBaseClass.BindColumn(bugName2, "BugName2", this.Controls, this.ultraGrid2, 1);
  62. YdmBaseClass.InitComboEditor(bugName3, "com.steering.pss.ydm.Stuffmanage.FrmStuffSurfaceInspection.getBugName", "BASECODE", this.ob, true);
  63. YdmBaseClass.BindColumn(bugName3, "BugName3", this.Controls, this.ultraGrid2, 1);
  64. YdmBaseClass.InitComboEditor(bugName4, "com.steering.pss.ydm.Stuffmanage.FrmStuffSurfaceInspection.getBugName", "BASECODE", this.ob, true);
  65. YdmBaseClass.BindColumn(bugName4, "BugName4", this.Controls, this.ultraGrid2, 1);
  66. YdmBaseClass.InitComboEditor(bugName5, "com.steering.pss.ydm.Stuffmanage.FrmStuffSurfaceInspection.getBugName", "BASECODE", this.ob, true);
  67. YdmBaseClass.BindColumn(bugName5, "BugName5", this.Controls, this.ultraGrid2, 1);
  68. }
  69. /// <summary>
  70. /// 重写基类方法
  71. /// </summary>
  72. /// <param name="sender"></param>
  73. /// <param name="ToolbarKey"></param>
  74. public override void ToolBar_Click(object sender, string ToolbarKey)
  75. {
  76. switch (ToolbarKey)
  77. {
  78. case "Query":
  79. doQueryData();
  80. break;
  81. case"QuerySurFace":
  82. doQuerySurFace();
  83. break;
  84. case"Ensure":
  85. EnsureData();
  86. break;
  87. case "Close":
  88. this.Close();
  89. break;
  90. }
  91. }
  92. /// <summary>
  93. /// 查询检验结果
  94. /// </summary>
  95. private void doQuerySurFace()
  96. {
  97. string regStartTim = "";
  98. string regEndTim = "";
  99. string heatNo = "";
  100. if (this.chkRegTime.Checked)
  101. {
  102. regStartTim = RegStartTime.Value.ToString();
  103. regEndTim = RegEndTime.Value.ToString();
  104. }
  105. if (this.chkFurnace.Checked)
  106. {
  107. heatNo = this.txtFurnace.Text.Trim();
  108. }
  109. ArrayList parm = new ArrayList();
  110. parm.Add(heatNo);
  111. List<StlLgSurfaceMEntity> listSource = EntityHelper.GetData<StlLgSurfaceMEntity>(
  112. "com.steering.pss.ydm.Stuffmanage.FrmStuffSurfaceInspection.doQuerySurFace", new object[] { parm, regStartTim, regEndTim }, this.ob);
  113. List<QcmLgSurfaceCEntity> listSource2 = EntityHelper.GetData<QcmLgSurfaceCEntity>(
  114. "com.steering.pss.ydm.Stuffmanage.FrmStuffSurfaceInspection.doQuerySurFaceC", new object[] {regStartTim, regEndTim }, this.ob);
  115. EntityHelper.AddEntityRelation(listSource, listSource2, "bugNo","bugNo");
  116. QcmLgSurfaceMEntitybindingSource.DataSource = listSource;
  117. }
  118. /// <summary>
  119. /// 查询收料信息
  120. /// </summary>
  121. private void doQueryData()
  122. {
  123. string regStartTim = "";
  124. string regEndTim = "";
  125. string heatNo = "";
  126. string[] L1 = new string[] { "GroudNo", "JudgeStoveNo", "FaceResultCode" };
  127. string[] L2 = new string[] { "GroudNo", "JudgeStoveNo", "FaceResultCode" };
  128. if (this.chkRegTime.Checked)
  129. {
  130. regStartTim = RegStartTime.Value.ToString();
  131. regEndTim = RegEndTime.Value.ToString();
  132. }
  133. if (this.chkFurnace.Checked)
  134. {
  135. heatNo = this.txtFurnace.Text.Trim();
  136. }
  137. ArrayList parm = new ArrayList();
  138. parm.Add(heatNo);
  139. List<MatGpMEntity1> listSource = EntityHelper.GetData<MatGpMEntity1>(
  140. "com.steering.pss.ydm.Stuffmanage.FrmStuffSurfaceInspection.doQueryMat", new object[] { parm, regStartTim, regEndTim }, this.ob);
  141. List<QcmLgSurfaceCEntity> listSource2 = EntityHelper.GetData<QcmLgSurfaceCEntity>(
  142. "com.steering.pss.ydm.Stuffmanage.FrmStuffSurfaceInspection.doQueryMatC", new object[] { parm, regStartTim, regEndTim }, this.ob);
  143. EntityHelper.AddEntityRelation(listSource, listSource2, L1, L2);
  144. MatGpMEntity1bindingSource.DataSource = listSource;
  145. this.chkAll.Checked = false;
  146. }
  147. /// <summary>
  148. /// 确认缺陷
  149. /// </summary>
  150. private void EnsureData()
  151. {
  152. this.ultraGrid2.UpdateData();
  153. int m = 0;
  154. QcmLgSurfaceCEntity qcmEntity = null;
  155. QcmLgSurfaceCEntity _qcmEntity = null;
  156. string qcmTity = "";
  157. string _qcmTity = "";
  158. IQueryable<UltraGridRow> checkMagRows = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
  159. if (checkMagRows.Count() == 0)
  160. {
  161. MessageUtil.ShowTips("请选择需要确认缺陷的主信息!");
  162. return;
  163. }
  164. ArrayList parm = new ArrayList();
  165. ArrayList list = new ArrayList();
  166. ArrayList list1 = new ArrayList();
  167. foreach (UltraGridRow uRow in checkMagRows)
  168. {
  169. if (!((int.Parse(uRow.Cells["QualifiedCount"].Text) + int.Parse(uRow.Cells["NoQualifiedCount"].Text)).ToString()).Equals(uRow.Cells["ActCount"].Text))
  170. {
  171. MessageUtil.ShowTips("输入的合格支数/不合格支数有误,请重新输入!");
  172. return;
  173. }
  174. MatGpMEntity1 matGpEntity = (MatGpMEntity1)uRow.ListObject;
  175. string matTity = JSONFormat.Format(matGpEntity);
  176. parm.Add(matTity);
  177. foreach (UltraGridRow row in uRow.ChildBands[0].Rows)
  178. {
  179. if (row.Cells["CHK"].Value.ToString() == "True")
  180. {
  181. if (row.Cells["CheckDimater"].Text.ToString() != "")
  182. {
  183. if (!StringUtil.IsInt(row.Cells["CheckDimater"].Value.ToString()))
  184. {
  185. MessageUtil.ShowTips("输入的检验规格需为整数!");
  186. return;
  187. }
  188. }
  189. if (row.Cells["CheckLen"].Text.ToString() != "")
  190. {
  191. if (!StringUtil.IsInt(row.Cells["CheckLen"].Value.ToString()))
  192. {
  193. MessageUtil.ShowTips("输入的检验长度需为整数!");
  194. return;
  195. }
  196. }
  197. if (row.Cells["BugPosName"].Value.ToString() == "" && row.Cells["BugName1"].Value.ToString() == "" && row.Cells["BugName2"].Value.ToString() == "" && row.Cells["BugName3"].Value.ToString()=="" && row.Cells["BugName4"].Value.ToString() == "" && row.Cells["BugName5"].Value.ToString() == "")
  198. {
  199. m = m + 1;
  200. }
  201. if (row.Cells["BugPosName"].Value.ToString() != "" || row.Cells["BugName1"].Value.ToString() != "" && row.Cells["BugName2"].Value.ToString() != "" && row.Cells["BugName3"].Value.ToString() != "" && row.Cells["BugName4"].Value.ToString() != "" && row.Cells["BugName5"].Value.ToString() != "")
  202. {
  203. qcmEntity = EntityHelper.CopyEntity<QcmLgSurfaceCEntity>(row.ListObject);
  204. qcmEntity.BugCode1 = row.Cells["BugName1"].Value.ToString();
  205. qcmEntity.BugCode2 = row.Cells["BugName2"].Value.ToString();
  206. qcmEntity.BugCode3 = row.Cells["BugName3"].Value.ToString();
  207. qcmEntity.BugCode4 = row.Cells["BugName4"].Value.ToString();
  208. qcmEntity.BugCode5 = row.Cells["BugName5"].Value.ToString();
  209. qcmEntity.BugPosCode = row.Cells["BugPosName"].Value.ToString();
  210. qcmTity = JSONFormat.Format(qcmEntity);
  211. list.Add(qcmTity);
  212. }
  213. else
  214. {
  215. _qcmEntity = (QcmLgSurfaceCEntity)row.ListObject;
  216. _qcmTity = JSONFormat.Format(_qcmEntity);
  217. list1.Add(_qcmTity);
  218. }
  219. }
  220. }
  221. if (!m.ToString().Equals(uRow.Cells["QualifiedCount"].Text))
  222. {
  223. MessageUtil.ShowTips("输入合格支数与登记合格支数不相符,请确认数据的正确性!");
  224. return;
  225. }
  226. }
  227. if (MessageUtil.ShowYesNoAndQuestion("是否确认缺陷?") == DialogResult.No)
  228. {
  229. return;
  230. }
  231. CoreClientParam ccp = new CoreClientParam();
  232. ccp.ServerName = "com.steering.pss.ydm.Stuffmanage.FrmStuffSurfaceInspection";
  233. ccp.MethodName = "ensureBug";
  234. ccp.ServerParams = new object[] {parm,list,list1,this.UserInfo.GetUserName(),"C009"};
  235. ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
  236. if (ccp.ReturnCode != -1)
  237. {
  238. if (ccp.ReturnInfo.Equals("确认检验结果成功!"))
  239. {
  240. doQueryData();
  241. MessageUtil.ShowTips(ccp.ReturnInfo);
  242. }
  243. }
  244. else
  245. {
  246. MessageUtil.ShowTips(ccp.ReturnInfo);
  247. }
  248. }
  249. private void chkFurnace_CheckedChanged(object sender, EventArgs e)
  250. {
  251. this.txtFurnace.Enabled = this.chkFurnace.Checked;
  252. }
  253. private void ultraGrid2_CellChange(object sender, CellEventArgs e)
  254. {
  255. if (e.Cell.Row.HasParent())
  256. {
  257. this.ultraGrid2.UpdateData();
  258. if (e.Cell.Column.Key.Equals("CHK"))
  259. {
  260. if (e.Cell.Row.Cells["CHK"].Value.ToString() == "True")
  261. {
  262. e.Cell.Row.ParentRow.Cells["Quantity"].Value = (int.Parse(e.Cell.Row.ParentRow.Cells["Quantity"].Value.ToString()) + 1).ToString();//检验支数
  263. }
  264. else
  265. {
  266. e.Cell.Row.ParentRow.Cells["Quantity"].Value = (int.Parse(e.Cell.Row.ParentRow.Cells["Quantity"].Value.ToString())- 1).ToString();//检验支数
  267. }
  268. //if (e.Cell.Row.HasChild())
  269. //{
  270. // for (int i = 0; i < e.Cell.Row.ChildBands[0].Rows.Count; i++)
  271. // {
  272. // e.Cell.Row.ChildBands[0].Rows[i].Cells["CHK1"].Value = "true";
  273. // }
  274. //}
  275. }
  276. if (e.Cell.Column.Key.Equals("BugName1"))
  277. {
  278. if (e.Cell.Row.Cells["BugName1"].Value.ToString() != "")
  279. {
  280. if (e.Cell.Row.Cells["BugName1"].Value.ToString().Equals(e.Cell.Row.Cells["BugName2"].Value.ToString()) || e.Cell.Row.Cells["BugName1"].Value.ToString().Equals(e.Cell.Row.Cells["BugName3"].Value.ToString()) || e.Cell.Row.Cells["BugName1"].Value.ToString().Equals(e.Cell.Row.Cells["BugName4"].Value.ToString()) || e.Cell.Row.Cells["BugName1"].Value.ToString().Equals(e.Cell.Row.Cells["BugName5"].Value.ToString()))
  281. {
  282. MessageUtil.ShowTips("此缺陷【" + e.Cell.Row.Cells["BugName1"].Text.ToString() + "】已被选择,不允许重复选择!");
  283. return;
  284. }
  285. }
  286. }
  287. if (e.Cell.Column.Key.Equals("BugName2"))
  288. {
  289. if (e.Cell.Row.Cells["BugName2"].Value.ToString() != "")
  290. {
  291. if (e.Cell.Row.Cells["BugName2"].Value.ToString().Equals(e.Cell.Row.Cells["BugName1"].Value.ToString()) || e.Cell.Row.Cells["BugName2"].Value.ToString().Equals(e.Cell.Row.Cells["BugName3"].Value.ToString()) || e.Cell.Row.Cells["BugName2"].Value.ToString().Equals(e.Cell.Row.Cells["BugName4"].Value.ToString()) || e.Cell.Row.Cells["BugName2"].Value.ToString().Equals(e.Cell.Row.Cells["BugName5"].Value.ToString()))
  292. {
  293. MessageUtil.ShowTips("此缺陷【" + e.Cell.Row.Cells["BugName2"].Text.ToString() + "】已被选择,不允许重复选择!");
  294. e.Cell.Row.Cells["BugName2"].Value = "";
  295. return;
  296. }
  297. }
  298. }
  299. if (e.Cell.Column.Key.Equals("BugName3"))
  300. {
  301. if (e.Cell.Row.Cells["BugName3"].Value.ToString() != "")
  302. {
  303. if (e.Cell.Row.Cells["BugName3"].Value.ToString().Equals(e.Cell.Row.Cells["BugName1"].Value.ToString()) || e.Cell.Row.Cells["BugName3"].Value.ToString().Equals(e.Cell.Row.Cells["BugName2"].Value.ToString()) || e.Cell.Row.Cells["BugName3"].Value.ToString().Equals(e.Cell.Row.Cells["BugName4"].Value.ToString()) || e.Cell.Row.Cells["BugName3"].Value.ToString().Equals(e.Cell.Row.Cells["BugName5"].Value.ToString()))
  304. {
  305. MessageUtil.ShowTips("此缺陷【" + e.Cell.Row.Cells["BugName3"].Text.ToString() + "】已被选择,不允许重复选择!");
  306. e.Cell.Row.Cells["BugName3"].Value = "";
  307. return;
  308. }
  309. }
  310. }
  311. if (e.Cell.Column.Key.Equals("BugName4"))
  312. {
  313. if (e.Cell.Row.Cells["BugName4"].Value.ToString() != "")
  314. {
  315. if (e.Cell.Row.Cells["BugName4"].Value.ToString().Equals(e.Cell.Row.Cells["BugName1"].Value.ToString()) || e.Cell.Row.Cells["BugName4"].Value.ToString().Equals(e.Cell.Row.Cells["BugName2"].Value.ToString()) || e.Cell.Row.Cells["BugName4"].Value.ToString().Equals(e.Cell.Row.Cells["BugName3"].Value.ToString()) || e.Cell.Row.Cells["BugName4"].Value.ToString().Equals(e.Cell.Row.Cells["BugName5"].Value.ToString()))
  316. {
  317. MessageUtil.ShowTips("此缺陷【" + e.Cell.Row.Cells["BugName4"].Text.ToString() + "】已被选择,不允许重复选择!");
  318. e.Cell.Row.Cells["BugName4"].Value = "";
  319. return;
  320. }
  321. }
  322. }
  323. if (e.Cell.Column.Key.Equals("BugName5"))
  324. {
  325. if (e.Cell.Row.Cells["BugName5"].Value.ToString() != "")
  326. {
  327. if (e.Cell.Row.Cells["BugName5"].Value.ToString().Equals(e.Cell.Row.Cells["BugName1"].Value.ToString()) || e.Cell.Row.Cells["BugName5"].Value.ToString().Equals(e.Cell.Row.Cells["BugName2"].Value.ToString()) || e.Cell.Row.Cells["BugName5"].Value.ToString().Equals(e.Cell.Row.Cells["BugName3"].Value.ToString()) || e.Cell.Row.Cells["BugName5"].Value.ToString().Equals(e.Cell.Row.Cells["BugName4"].Value.ToString()))
  328. {
  329. MessageUtil.ShowTips("此缺陷【" + e.Cell.Row.Cells["BugName5"].Text.ToString() + "】已被选择,不允许重复选择!");
  330. e.Cell.Row.Cells["BugName5"].Value = "";
  331. return;
  332. }
  333. }
  334. }
  335. }
  336. }
  337. private void FrmStuffSurfaceInspection_Shown(object sender, EventArgs e)
  338. {
  339. if (toolMenu == null) return;
  340. if (toolMenu.Toolbars[0].Tools.Exists("QuerySurFace"))
  341. {
  342. toolMenu.Toolbars[0].Tools["QuerySurFace"].InstanceProps.Visible = DefaultableBoolean.False;
  343. }
  344. }
  345. private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  346. {
  347. if (toolMenu == null) return;
  348. if (ultraTabControl1.SelectedTab.Key == "0")
  349. {
  350. if (toolMenu.Toolbars[0].Tools.Exists("Query"))
  351. {
  352. toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.True;
  353. }
  354. if (toolMenu.Toolbars[0].Tools.Exists("Ensure"))
  355. {
  356. toolMenu.Toolbars[0].Tools["Ensure"].InstanceProps.Visible = DefaultableBoolean.True;
  357. }
  358. if (toolMenu.Toolbars[0].Tools.Exists("QuerySurFace"))
  359. {
  360. toolMenu.Toolbars[0].Tools["QuerySurFace"].InstanceProps.Visible = DefaultableBoolean.False;
  361. }
  362. this.chkRegTime.Text = "收料时间";
  363. }
  364. else
  365. {
  366. if (toolMenu.Toolbars[0].Tools.Exists("Query"))
  367. {
  368. toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.False;
  369. }
  370. if (toolMenu.Toolbars[0].Tools.Exists("Ensure"))
  371. {
  372. toolMenu.Toolbars[0].Tools["Ensure"].InstanceProps.Visible = DefaultableBoolean.False;
  373. }
  374. if (toolMenu.Toolbars[0].Tools.Exists("QuerySurFace"))
  375. {
  376. toolMenu.Toolbars[0].Tools["QuerySurFace"].InstanceProps.Visible = DefaultableBoolean.True;
  377. }
  378. this.chkRegTime.Text = "检验时间";
  379. }
  380. }
  381. private void chkRegTime_CheckedChanged(object sender, EventArgs e)
  382. {
  383. this.RegStartTime.Enabled = this.chkRegTime.Checked;
  384. this.RegEndTime.Enabled = this.chkRegTime.Checked;
  385. }
  386. private void chkAll_CheckedChanged(object sender, EventArgs e)
  387. {
  388. if (chkAll.Checked)
  389. {
  390. foreach (UltraGridRow row in ultraGrid2.Rows)
  391. {
  392. if (row.Cells["CHK"].Text == "True")
  393. {
  394. foreach (UltraGridRow uRow in row.ChildBands[0].Rows)
  395. {
  396. //if (uRow.Cells["CXSTUPP"].Value.ToString().Equals(""))
  397. //{
  398. // chkint += 1;
  399. // if (chkint > 50) return;
  400. uRow.Cells["CHK"].Value = true;
  401. row.Cells["Quantity"].Value = (int.Parse(row.Cells["Quantity"].Value.ToString()) + 1).ToString();//检验支数
  402. //}
  403. }
  404. }
  405. }
  406. }
  407. else
  408. {
  409. foreach (UltraGridRow row in ultraGrid2.Rows)
  410. {
  411. if (row.Cells["CHK"].Text == "True")
  412. {
  413. foreach (UltraGridRow uRow in row.ChildBands[0].Rows)
  414. {
  415. //if (uRow.Cells["CXSTUPP"].Value.ToString().Equals(""))
  416. //{
  417. // chkint += 1;
  418. // if (chkint > 50) return;
  419. uRow.Cells["CHK"].Value = false;
  420. row.Cells["Quantity"].Value = (int.Parse(row.Cells["Quantity"].Value.ToString()) - 1).ToString();//检验支数
  421. //}
  422. }
  423. }
  424. }
  425. }
  426. }
  427. }
  428. }