ComBaseSplineCopyStdFrm.cs 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using Core.Mes.Client.Comm.Server;
  2. using Core.Mes.Client.Comm.Tool;
  3. using CoreFS.CA06;
  4. using System;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Windows.Forms;
  8. namespace Core.StlMes.Client.Qcm
  9. {
  10. public partial class ComBaseSplineCopyStdFrm : FrmBase
  11. {
  12. public string OldStdName { get; set; }
  13. public string OldStdCode { get; set; }
  14. public string NewStdName { get; set; }
  15. public string NewStdCode { get; set; }
  16. public ComBaseSplineCopyStdFrm(OpeBase ob)
  17. {
  18. InitializeComponent();
  19. this.ob = ob;
  20. }
  21. private void UltraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  22. {
  23. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.BLCodeManage.GetBLStd",
  24. new object[] { }, ob);
  25. dt.Columns["STD_NAME"].Caption = "标准名称";
  26. BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "STD_NAME", "STD_CODE");
  27. baseInfo.Shown += new EventHandler((a, b) =>
  28. {
  29. var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where(
  30. c => c.GetValue("STD_CODE") == ultraTextEditor1.Tag.ToString2()).FirstOrDefault();
  31. if (actRow != null) actRow.Activate();
  32. });
  33. if (baseInfo.ShowDialog() == DialogResult.OK)
  34. {
  35. ultraTextEditor1.Tag = baseInfo.ChoicedRow.GetValue("STD_CODE");
  36. ultraTextEditor1.Text = baseInfo.ChoicedRow.GetValue("STD_NAME");
  37. }
  38. }
  39. private void UltraTextEditor2_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  40. {
  41. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.BLCodeManage.GetBLStd",
  42. new object[] { }, ob);
  43. dt.Columns["STD_NAME"].Caption = "标准名称";
  44. BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "STD_NAME", "STD_CODE");
  45. baseInfo.Shown += new EventHandler((a, b) =>
  46. {
  47. var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where(
  48. c => c.GetValue("STD_CODE") == ultraTextEditor2.Tag.ToString2()).FirstOrDefault();
  49. if (actRow != null) actRow.Activate();
  50. });
  51. if (baseInfo.ShowDialog() == DialogResult.OK)
  52. {
  53. ultraTextEditor2.Tag = baseInfo.ChoicedRow.GetValue("STD_CODE");
  54. ultraTextEditor2.Text = baseInfo.ChoicedRow.GetValue("STD_NAME");
  55. }
  56. }
  57. private void UltraButton1_Click(object sender, EventArgs e)
  58. {
  59. if (ultraTextEditor1.Text == "")
  60. {
  61. MessageUtil.ShowTips("请选择旧标准");
  62. return;
  63. }
  64. if (ultraTextEditor2.Text == "")
  65. {
  66. MessageUtil.ShowTips("请选择新标准");
  67. return;
  68. }
  69. OldStdName = ultraTextEditor1.Text;
  70. OldStdCode = ultraTextEditor1.Tag.ToString2();
  71. NewStdName = ultraTextEditor2.Text;
  72. NewStdCode = ultraTextEditor2.Tag.ToString2();
  73. this.DialogResult = DialogResult.OK;
  74. }
  75. }
  76. }