ColHotCheck.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using CoreFS.CA06;
  11. using Core.Mes.Client.Comm.Server;
  12. using Core.Mes.Client.Comm.Control;
  13. using Core.StlMes.Client.ZGMil;
  14. using com.steering.mes.zgmil.entity;
  15. using Infragistics.Win.UltraWinGrid;
  16. namespace Core.StlMes.Client.ZGMil.ResultConrtrol
  17. {
  18. public partial class ColHotCheck : UserControl
  19. {
  20. private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null;
  21. public ColHotCheck()
  22. {
  23. InitializeComponent();
  24. GridHelper.InitCardGrid(SizingDataSource, ultraGrid2);
  25. _grid = this.ultraGrid2;
  26. }
  27. private MilHotCheckResultEntity _hotCheckResult = new MilHotCheckResultEntity();
  28. public MilHotCheckResultEntity Value
  29. {
  30. get { return _hotCheckResult; }
  31. set
  32. {
  33. if (value != null)
  34. {
  35. _hotCheckResult = value;
  36. UpdateDate();
  37. }
  38. }
  39. }
  40. private bool isCellSelect = false;
  41. public bool IsCellSelect
  42. {
  43. get { return isCellSelect; }
  44. set { isCellSelect = value; }
  45. }
  46. public void UpdateDate()
  47. {
  48. if (_hotCheckResult != null)
  49. {
  50. SizingDataSource.Rows[0]["INSPECTOR"] = _hotCheckResult.Inspector;
  51. SizingDataSource.Rows[0]["CHECK_DATE"] = _hotCheckResult.CheckDate;
  52. SizingDataSource.Rows[0]["CUT_HEAD_P"] = _hotCheckResult.CutHeadP;
  53. SizingDataSource.Rows[0]["CUT_TRAIL_P"] = _hotCheckResult.CutTrailP;
  54. SizingDataSource.Rows[0]["CUT_ORDER_P"] = _hotCheckResult.CutOrderP;
  55. SizingDataSource.Rows[0]["CUT_HEAD"] = _hotCheckResult.CutHead;
  56. SizingDataSource.Rows[0]["CUT_TRAIL"] = _hotCheckResult.CutTrail;
  57. SizingDataSource.Rows[0]["CUT_ORDER"] = _hotCheckResult.CutOrder;
  58. SizingDataSource.Rows[0]["REMARK"] = _hotCheckResult.Remark;
  59. SizingDataSource.Rows[0]["PASS_SERIES1"] = _hotCheckResult.PassSeries1;
  60. SizingDataSource.Rows[0]["PASS_SERIES2"] = _hotCheckResult.PassSeries2;
  61. SizingDataSource.Rows[0]["PASS_SERIES3"] = _hotCheckResult.PassSeries3;
  62. SizingDataSource.Rows[0]["PASS_SERIES4"] = _hotCheckResult.PassSeries4;
  63. SizingDataSource.Rows[0]["DOUBLE_B1"] = _hotCheckResult.DoubleB1;
  64. SizingDataSource.Rows[0]["DOUBLE_B2"] = _hotCheckResult.DoubleB2;
  65. SizingDataSource.Rows[0]["DOUBLE_B3"] = _hotCheckResult.DoubleB3;
  66. SizingDataSource.Rows[0]["DOUBLE_B4"] = _hotCheckResult.DoubleB4;
  67. SizingDataSource.Rows[0]["START_TEMP"] = _hotCheckResult.StartTemp;
  68. SizingDataSource.Rows[0]["END_TEMP"] = _hotCheckResult.EndTemp;
  69. SizingDataSource.Rows[0]["OUTDIAMETER"] = _hotCheckResult.Outdiameter;
  70. SizingDataSource.Rows[0]["WALLTHICK"] = _hotCheckResult.Wallthick;
  71. }
  72. }
  73. private void ultraGrid2_CellChange(object sender, CellEventArgs e)
  74. {
  75. isCellSelect = true;
  76. }
  77. private void ultraGrid2_Error(object sender, ErrorEventArgs e)
  78. {
  79. e.Cancel = true;
  80. if (ultraGrid2.ActiveCell.Column.Key == "CHECK_DATE" )
  81. {
  82. MessageBox.Show("请输入完整的时间");
  83. }
  84. }
  85. private void ultraGrid2_KeyPress(object sender, KeyPressEventArgs e)
  86. {
  87. if (e.KeyChar == (char)13)
  88. {
  89. //this.SelectNextControl(this.ActiveControl, true, true, true, true);
  90. ultraGrid2.PerformAction(UltraGridAction.NextCell);
  91. ultraGrid2.PerformAction(UltraGridAction.EnterEditMode);
  92. //ultraGrid2.ActiveCell.IsInEditMode = true;
  93. }
  94. }
  95. }
  96. }