FrmHttAppearancecheckRecord.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. using Core.Mes.Client.Comm.Format;
  2. using Core.Mes.Client.Comm.Tool;
  3. using Core.StlMes.Client.Mcp.Treatment.Entity;
  4. using CoreFS.CA06;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.ComponentModel;
  8. using System.Data;
  9. using System.Drawing;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Windows.Forms;
  13. namespace Core.StlMes.Client.Mcp.Treatment.HeatTreatment
  14. {
  15. public partial class FrmHttAppearancecheckRecord : FrmBase
  16. {
  17. OpeBase OB;
  18. private string ResultNo = "";
  19. private string plineCode = "";
  20. private string heatPlanNo = "";
  21. public FrmHttAppearancecheckRecord(string ResultNo,string heatPlanNo,string plineCode, OpeBase ob)
  22. {
  23. InitializeComponent();
  24. EntityHelper.ShowGridCaption<HttAppearancecheckRecordEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  25. OB = ob;
  26. this.ResultNo = ResultNo;
  27. this.plineCode = plineCode;
  28. this.heatPlanNo = heatPlanNo;
  29. List<HttAppearancecheckRecordEntity> listSource = EntityHelper.GetData<HttAppearancecheckRecordEntity>(
  30. "com.steering.mes.mcp.heatTreatment.HttAppearancecheckRecordService.getHttAppearancecheckRecord", new object[] { ResultNo }, OB);
  31. httAppearancecheckRecordEntityBindingSource.DataSource = listSource;
  32. }
  33. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  34. {
  35. switch (e.Tool.Key)
  36. {
  37. case "Save":
  38. Save();
  39. break;
  40. case "Close":
  41. CloseFrm();
  42. break;
  43. }
  44. }
  45. private void CloseFrm()
  46. {
  47. this.DialogResult = System.Windows.Forms.DialogResult.OK;
  48. this.Close();
  49. }
  50. private void Save()
  51. {
  52. this.ultraGrid1.UpdateData();
  53. HttAppearancecheckRecordEntity sto = this.ultraGrid1.ActiveRow.ListObject as HttAppearancecheckRecordEntity;
  54. var template = new HttAppearancecheckRecordEntity
  55. {
  56. PipeNo = sto.PipeNo,
  57. EastPipeEndStaightess = sto.EastPipeEndStaightess.Value,
  58. EastPipeExternal = sto.EastPipeExternal.Value,
  59. EastPipeMax = sto.EastPipeMax.Value,
  60. EastPipeMin = sto.EastPipeMin.Value,
  61. EastPipeNoy = sto.EastPipeNoy.Value,
  62. WestPipeEndStaightess = sto.WestPipeEndStaightess.Value,
  63. WestPipeExternal = sto.WestPipeExternal.Value,
  64. WestPipeMax = sto.WestPipeMax.Value,
  65. WestPipeMin = sto.WestPipeMin.Value,
  66. WestPipeNoy = sto.WestPipeNoy.Value,
  67. Fulllengthstraightness=sto.Fulllengthstraightness.Value,
  68. ResultNo=ResultNo,
  69. HeatPlanNo=heatPlanNo,
  70. PlineCode=plineCode,
  71. RecordNo=sto.RecordNo
  72. };
  73. var ccp = new CoreClientParam();
  74. ccp.ServerName = "com.steering.mes.mcp.heatTreatment.HttAppearancecheckRecordService";
  75. ccp.MethodName = "addHttAppearancecheckRecord";
  76. ccp.ServerParams = new object[] { JSONFormat.Format(template) };
  77. ccp = OB.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  78. if (ccp.ReturnCode != -1)
  79. {
  80. MessageUtil.ShowTips("录入成功!");
  81. List<HttAppearancecheckRecordEntity> listSource = EntityHelper.GetData<HttAppearancecheckRecordEntity>(
  82. "com.steering.mes.mcp.heatTreatment.HttAppearancecheckRecordService.getHttAppearancecheckRecord", new object[] { ResultNo }, OB);
  83. httAppearancecheckRecordEntityBindingSource.DataSource = listSource;
  84. }
  85. else
  86. {
  87. MessageUtil.ShowTips("录入失败!");
  88. return;
  89. }
  90. }
  91. private void ultraGrid1_AfterRowInsert(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e)
  92. {
  93. }
  94. }
  95. }