BundingControl.cs 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. 
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using com.steering.mes.mcp.entity;
  5. using Core.Mes.Client.Comm.Tool;
  6. using Core.StlMes.Client.Mcp.Control.Entity;
  7. using Core.StlMes.Client.Mcp.Control.Machining;
  8. namespace Core.StlMes.Client.Mcp.Control
  9. {
  10. public partial class BundingControl : MchControlBase
  11. {
  12. public BundingControl()
  13. {
  14. InitializeComponent();
  15. EntityHelper.ShowGridCaption<MchBundlingResultEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  16. gx = "701312";
  17. Value = null;
  18. }
  19. protected override string ScrapCode { get { return ""; } }
  20. public MchBundlingResultEntity Value
  21. {
  22. get
  23. {
  24. var list =
  25. MchBundlingResultEntityBindingSource.DataSource as List<MchBundlingResultEntity>;
  26. return (list == null) || !list.Any() ? new MchBundlingResultEntity() : list.FirstOrDefault();
  27. }
  28. set
  29. {
  30. if (value == null)
  31. {
  32. MchBundlingResultEntityBindingSource.DataSource = new List<MchBundlingResultEntity>
  33. {
  34. new MchBundlingResultEntity()
  35. };
  36. ScrappedList = new List<MchBugDEntity>();
  37. }
  38. else
  39. {
  40. value.ProWt = comm.GetWeight1(PortHttBatchSampleResultEntitys, gx, (int)(value.ProNum ?? 0),
  41. (int)(PlnZyJgxCEntity.ProCount ?? 0));
  42. MchBundlingResultEntityBindingSource.DataSource = new List<MchBundlingResultEntity> { value.Clone() };
  43. if (_plineCode != Value.PlineCode)
  44. {
  45. Names = EntityHelper.GetData<HttSignatureEntity>(
  46. "com.steering.mes.mcp.heatTreatment.FrmHttCrackDetectResult.getHttSign",
  47. new object[] { Value.PlineCode, "10" }, Ob);
  48. name.DisplayMember = "UserName";
  49. name.ValueMember = "UserName";
  50. YdmBaseClass.SetComboItemHeight(name);
  51. _plineCode = Value.PlineCode;
  52. }
  53. name.DataSource = Names.Where(p => p.ColGroup == value.ProGroup).ToList();
  54. if (value.FailNum == 0)
  55. ScrappedList = new List<MchBugDEntity>();
  56. }
  57. }
  58. }
  59. private void ultraGrid1_CellChange_1(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  60. {
  61. if (e.Cell.Column.Key == "BundingTypeCode")
  62. {
  63. e.Cell.Row.Cells["BundingTypeName"].Value = e.Cell.Text;
  64. }
  65. }
  66. }
  67. }