QcmZbsDetectResultCtrl.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using Core.StlMes.Client.Judge.Commons;
  5. using CoreFS.CA06;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Data;
  9. using System.Windows.Forms;
  10. namespace Core.StlMes.Client.Judge.Controls
  11. {
  12. public partial class QcmZbsDetectResultCtrl : UserControl
  13. {
  14. private Dal _d;
  15. public QcmZbsDetectResultCtrl(Control container, OpeBase ob)
  16. {
  17. InitializeComponent();
  18. _d = new Dal(ob);
  19. this.Dock = DockStyle.Fill;
  20. container.Controls.Add(this);
  21. LoadBaseData();
  22. }
  23. private void LoadBaseData()
  24. {
  25. //加载基础数据
  26. ClsBaseInfo.FillComBaseInfo(ultraComboEditor1, "4021", _d.Ob, false);
  27. ultraComboEditor1.DropDownListWidth = -1;
  28. JudgeBaseInfo.LoadPhyDetect(ultraComboEditor2, _d.Ob, false);
  29. ultraComboEditor2.DropDownListWidth = -1;
  30. }
  31. public void Query(string zbsId)
  32. {
  33. DataTable dt = _d.GetTableByXmlId("JdgQcmZbsDetectResult.getByZbsId", zbsId);
  34. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  35. GridHelper.RefreshAndAutoSize(ultraGrid1);
  36. }
  37. public void Modify()
  38. {
  39. List<string> jsons = new List<string>();
  40. foreach (DataRow dr in dataTable1.Rows)
  41. {
  42. if (dr["chk"].ToString() == "False") continue;
  43. jsons.Add(JsonHelper.ToJson(dr));
  44. }
  45. if (MessageUtil.ShowYesNoAndQuestion("是否确认修改?") == DialogResult.No)
  46. {
  47. return;
  48. }
  49. var ccp = _d.Set("com.steering.pss.judge.Bll.BllCreateZbsInfo.modifyZbsDetect", jsons);
  50. if (ccp.ReturnInfo.ToString2() != "")
  51. {
  52. MessageUtil.ShowWarning(ccp.ReturnInfo.ToString2());
  53. }
  54. else
  55. {
  56. MessageUtil.ShowTips("修改成功!");
  57. }
  58. }
  59. public void ClearData()
  60. {
  61. dataTable1.Clear();
  62. }
  63. private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  64. {
  65. e.Cell.Row.Update();
  66. if (e.Cell.Column.Key == "phyCode")
  67. {
  68. e.Cell.Row.Cells["phyName"].Value = e.Cell.Text;
  69. }
  70. }
  71. }
  72. }