ivr流程编辑器

CtlIVRStringop.cs 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using HySoft.IVRFlowEditor.IVRControlUtility;
  10. using HySoft.IVRFlowEditor.Utility;
  11. using HySoft.IVRFlowEditor.Model;
  12. namespace HySoft.IVRFlowEditor.IVRControl
  13. {
  14. public partial class CtlIVRStringop : UserControl
  15. {
  16. IVRStringop _IVRStringop;
  17. public CtlIVRStringop(IVRStringop obj)
  18. {
  19. InitializeComponent();
  20. _IVRStringop = obj;
  21. this.Load += new EventHandler(CtlIVRStringop_Load);
  22. }
  23. void CtlIVRStringop_Load(object sender, EventArgs e)
  24. {
  25. this.tb_NodeID.Text = _IVRStringop.Pos;
  26. this.tb_NodeName.Text = _IVRStringop.Name;
  27. this.rtb_Note.Text = _IVRStringop.Note;
  28. this.cmb_NextNode.DataSource = GlobalController.GetComBoBoxofIVR();
  29. this.cmb_NextNode.DisplayMember = "Note";//2017-5-8将Name改为Note
  30. this.cmb_NextNode.ValueMember = "ID";
  31. if (_IVRStringop.Next != null)
  32. cmb_NextNode.SelectedItem = _IVRStringop.Next;
  33. this.cmb_FalsePos.DataSource = GlobalController.GetComBoBoxofIVR();
  34. this.cmb_FalsePos.DisplayMember = "Note";//2017-5-8将Name改为Note
  35. this.cmb_FalsePos.ValueMember = "ID";
  36. if (_IVRStringop.FalsePos != null)
  37. cmb_FalsePos.SelectedItem = _IVRStringop.FalsePos;
  38. this.cmb_TruePos.DataSource = GlobalController.GetComBoBoxofIVR();
  39. this.cmb_TruePos.DisplayMember = "Note";//2017-5-8将Name改为Note
  40. this.cmb_TruePos.ValueMember = "ID";
  41. if (_IVRStringop.TruePos != null)
  42. cmb_TruePos.SelectedItem = _IVRStringop.TruePos;
  43. GlobalController.BindComBoBoxOfEnumDesc(this.cmb_OpType, _IVRStringop.OpType);
  44. this.cmb_AppendVar.DataSource = GlobalController.GetFlowVar().ToList();
  45. this.cmb_AppendVar.DisplayMember = "VarName";
  46. this.cmb_AppendVar.ValueMember = "VarName";
  47. if (_IVRStringop.AppendVar != null)
  48. this.cmb_AppendVar.Text = _IVRStringop.AppendVar;
  49. this.cmb_MatchVar.DataSource = GlobalController.GetFlowVar().ToList();
  50. this.cmb_MatchVar.DisplayMember = "VarName";
  51. this.cmb_MatchVar.ValueMember = "VarName";
  52. if (_IVRStringop.MatchVar != null)
  53. this.cmb_MatchVar.Text = _IVRStringop.MatchVar;
  54. this.cmb_OperateVar.DataSource = GlobalController.GetFlowVar().ToList();
  55. this.cmb_OperateVar.DisplayMember = "VarName";
  56. this.cmb_OperateVar.ValueMember = "VarName";
  57. if (_IVRStringop.OperateVar != null)
  58. this.cmb_OperateVar.Text = _IVRStringop.OperateVar;
  59. this.cmb_RepAsVar.DataSource = GlobalController.GetFlowVar().ToList();
  60. this.cmb_RepAsVar.DisplayMember = "VarName";
  61. this.cmb_RepAsVar.ValueMember = "VarName";
  62. if (_IVRStringop.RepAsVar != null)
  63. this.cmb_RepAsVar.Text = _IVRStringop.RepAsVar;
  64. this.cmb_ReplaceVar.DataSource = GlobalController.GetFlowVar().ToList();
  65. this.cmb_ReplaceVar.DisplayMember = "VarName";
  66. this.cmb_ReplaceVar.ValueMember = "VarName";
  67. if (_IVRStringop.ReplaceVar != null)
  68. this.cmb_ReplaceVar.Text = _IVRStringop.ReplaceVar;
  69. this.cmb_ResultVar.DataSource = GlobalController.GetFlowVar().ToList();
  70. this.cmb_ResultVar.DisplayMember = "VarName";
  71. this.cmb_ResultVar.ValueMember = "VarName";
  72. if (_IVRStringop.ResultVar != null)
  73. this.cmb_ResultVar.Text = _IVRStringop.ResultVar;
  74. this.num_InterceptIdx.Value = _IVRStringop.InterceptIdx;
  75. this.num_InterceptLen.Value = _IVRStringop.InterceptLen;
  76. }
  77. private void btn_enter_Click(object sender, EventArgs e)
  78. {
  79. _IVRStringop.Next = this.cmb_NextNode.SelectedItem as IVRControlBase;
  80. _IVRStringop.TruePos = this.cmb_TruePos.SelectedItem as IVRControlBase;
  81. _IVRStringop.FalsePos = this.cmb_FalsePos.SelectedItem as IVRControlBase;
  82. _IVRStringop.OpType = GlobalController.GetEnumByComBoBoxValueOFDesc<OpType>(this.cmb_OpType.Text);
  83. _IVRStringop.AppendVar=this.cmb_AppendVar.Text ;
  84. _IVRStringop.MatchVar = this.cmb_MatchVar.Text;
  85. _IVRStringop.OperateVar = this.cmb_OperateVar.Text;
  86. _IVRStringop.RepAsVar = this.cmb_RepAsVar.Text;
  87. _IVRStringop.ReplaceVar = this.cmb_ReplaceVar.Text;
  88. _IVRStringop.ResultVar = this.cmb_ResultVar.Text;
  89. _IVRStringop.InterceptIdx=(int)this.num_InterceptIdx.Value ;
  90. _IVRStringop.InterceptLen=(int)this.num_InterceptLen.Value;
  91. _IVRStringop.Pos = this.tb_NodeID.Text;
  92. _IVRStringop.Name = this.tb_NodeName.Text;
  93. _IVRStringop.Note = this.rtb_Note.Text;
  94. this.FindForm().DialogResult = DialogResult.OK;
  95. this.FindForm().Close();
  96. }
  97. private void btn_cancel_Click(object sender, EventArgs e)
  98. {
  99. this.FindForm().DialogResult = DialogResult.No;
  100. this.FindForm().Close();
  101. }
  102. }
  103. }