frmDesignLength.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using Core.Mes.Client.Comm.Tool;
  11. using Infragistics.Win.UltraWinGrid;
  12. using Core.Mes.Client.Comm.Format;
  13. using System.Collections;
  14. using Core.Mes.Client.Comm.Server;
  15. namespace Core.StlMes.Client.SaleOrder
  16. {
  17. public partial class frmDesignLength : FrmBase
  18. {
  19. /// <summary>
  20. /// 合同行号
  21. /// </summary>
  22. private String designKey;
  23. public String DesignKey
  24. {
  25. get { return designKey; }
  26. set { designKey = value; }
  27. }
  28. private OpeBase ob;
  29. public OpeBase Ob
  30. {
  31. get { return ob; }
  32. set { ob = value; }
  33. }
  34. public frmDesignLength(string designKey, OpeBase ob)
  35. {
  36. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  37. InitializeComponent();
  38. this.designKey = designKey;
  39. this.ob = ob;
  40. }
  41. private void frmDesignLength_Load(object sender, EventArgs e)
  42. {
  43. EntityHelper.ShowGridCaption<SlmOrdDesignLengthEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  44. DoQuery();
  45. setColumnReadOnly(ultraGrid1);
  46. }
  47. private void DoQuery()
  48. {
  49. ///ordLnPk = "EFD0A935A9C94724BA60F7AA7C580619001";
  50. List<SlmOrdDesignLengthEntity> listSource = EntityHelper.GetData<SlmOrdDesignLengthEntity>(
  51. "com.steering.pss.sale.order.CoreDesignLength.getDesingLenth", new object[] { designKey }, ob);
  52. slmOrdDesignLengthEntityBindingSource.DataSource = listSource;
  53. }
  54. /// <summary>
  55. /// 设置列只可读
  56. /// </summary>
  57. /// <param name="ugr">UltraGrid</param>
  58. /// <param name="columns">列数组</param>
  59. private void setColumnReadOnly(UltraGrid ugr)
  60. {
  61. foreach (UltraGridColumn ugc in ugr.DisplayLayout.Bands[0].Columns)
  62. {
  63. if (!ugc.Key.Equals("CHC"))
  64. {
  65. ugc.CellActivation = Activation.ActivateOnly;
  66. }
  67. }
  68. }
  69. private void buttonCommit_Click(object sender, EventArgs e)
  70. {
  71. this.DialogResult = DialogResult.OK;
  72. }
  73. private void buttonCancel_Click(object sender, EventArgs e)
  74. {
  75. this.DialogResult = DialogResult.Cancel;
  76. }
  77. }
  78. }