QcmZbsCraftResultCtrl.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Tool;
  3. using Core.StlMes.Client.Judge.Commons;
  4. using CoreFS.CA06;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Data;
  8. using System.Windows.Forms;
  9. namespace Core.StlMes.Client.Judge.Controls
  10. {
  11. public partial class QcmZbsCraftResultCtrl : UserControl
  12. {
  13. private Dal _d;
  14. public QcmZbsCraftResultCtrl(Control container, OpeBase ob)
  15. {
  16. InitializeComponent();
  17. container.Controls.Add(this);
  18. this.Dock = DockStyle.Fill;
  19. _d = new Dal(ob);
  20. }
  21. public void Query(string zbsId)
  22. {
  23. DataTable dt = _d.GetTableByXmlId("JdgQcmZbsCraftResult.getByZbsId", zbsId);
  24. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  25. GridHelper.RefreshAndAutoSize(ultraGrid1);
  26. }
  27. public void Modify()
  28. {
  29. List<string> jsons = new List<string>();
  30. foreach (DataRow dr in dataTable1.Rows)
  31. {
  32. if (dr["chk"].ToString() == "False") continue;
  33. jsons.Add(JsonHelper.ToJson(dr));
  34. }
  35. if (MessageUtil.ShowYesNoAndQuestion("是否确认修改?") == DialogResult.No)
  36. {
  37. return;
  38. }
  39. var ccp = _d.Set("com.steering.pss.judge.Bll.BllCreateZbsInfo.modifyZbsCraft", jsons);
  40. if (ccp.ReturnInfo.ToString2() != "")
  41. {
  42. MessageUtil.ShowWarning(ccp.ReturnInfo.ToString2());
  43. }
  44. else
  45. {
  46. MessageUtil.ShowTips("修改成功!");
  47. }
  48. }
  49. public void ClearData()
  50. {
  51. dataTable1.Clear();
  52. }
  53. private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  54. {
  55. e.Cell.Row.Update();
  56. }
  57. }
  58. }