CouplingPhosphateInfoCtrl.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.StlMes.Client.Judge.Commons;
  3. using CoreFS.CA06;
  4. using Infragistics.Win;
  5. using Infragistics.Win.UltraWinGrid;
  6. using System.Data;
  7. using System.Windows.Forms;
  8. namespace Core.StlMes.Client.Judge.Controls
  9. {
  10. public partial class CouplingPhosphateInfoCtrl : UserControl
  11. {
  12. private Dal _d;
  13. public CouplingPhosphateInfoCtrl(Control container, OpeBase ob)
  14. {
  15. InitializeComponent();
  16. container.Controls.Add(this);
  17. this.Dock = DockStyle.Fill;
  18. _d = new Dal(ob);
  19. ValueList coatList = new ValueList();
  20. coatList.ValueListItems.Add("0", "无");
  21. coatList.ValueListItems.Add("1", "镀铜");
  22. coatList.ValueListItems.Add("2", "磷化");
  23. ultraGrid1.DisplayLayout.Bands[0].Columns["coatType"].ValueList = coatList;
  24. ultraGrid1.DisplayLayout.Bands[0].Summaries.Add(SummaryType.Sum, ultraGrid1.DisplayLayout.Bands[0].Columns["colCount"]).DisplayFormat = "合计{0}";
  25. }
  26. public void Query(string judgeStoveNo, string batchNo, string woId, bool clearData)
  27. {
  28. DataTable dt = _d.GetTableByXmlId("JdgCouplingPhosphateResult.Query", judgeStoveNo, batchNo, woId);
  29. GridHelper.CopyDataToDatatable(dt, dataTable1, clearData);
  30. foreach (DataRow row in dataTable1.Rows)
  31. {
  32. if (row["batchNo"].ToString() != "") continue;
  33. row["judgeStoveNo"] = judgeStoveNo;
  34. row["batchNo"] = batchNo;
  35. }
  36. GridHelper.RefreshAndAutoSize(ultraGrid1);
  37. }
  38. public void Query(string judgeStoveNo, string batchNo, string woId, bool clearData,string plineCode)
  39. {
  40. DataTable dt = _d.GetTableByXmlId("JdgCouplingPhosphateResult.QueryByPline", judgeStoveNo, batchNo, woId, plineCode);
  41. GridHelper.CopyDataToDatatable(dt, dataTable1, clearData);
  42. foreach (DataRow row in dataTable1.Rows)
  43. {
  44. if (row["batchNo"].ToString() != "") continue;
  45. row["judgeStoveNo"] = judgeStoveNo;
  46. row["batchNo"] = batchNo;
  47. }
  48. GridHelper.RefreshAndAutoSize(ultraGrid1);
  49. }
  50. public void ClearData()
  51. {
  52. this.dataTable1.Clear();
  53. }
  54. }
  55. }