ivr流程编辑器

CtlIVRTurnagent.cs 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. namespace HySoft.IVRFlowEditor.IVRControl
  12. {
  13. public partial class CtlIVRTurnagent : UserControl
  14. {
  15. IVRTurnagent _IVRTurnagent;
  16. public CtlIVRTurnagent(IVRTurnagent obj)
  17. {
  18. InitializeComponent();
  19. _IVRTurnagent = obj;
  20. this.Load += new EventHandler(CtlIVRTurnagent_Load);
  21. }
  22. void CtlIVRTurnagent_Load(object sender, EventArgs e)
  23. {
  24. this.tb_NodeID.Text = _IVRTurnagent.Pos;
  25. this.tb_NodeName.Text = _IVRTurnagent.Name;
  26. this.rtb_Note.Text = _IVRTurnagent.Note;
  27. cmb_HangupPos.DataSource = GlobalController.GetComBoBoxofIVR();
  28. this.cmb_HangupPos.DisplayMember = "Note";//2017-5-8将Name改为Note
  29. this.cmb_HangupPos.ValueMember = "ID";
  30. if (_IVRTurnagent.HangupPos != null)
  31. cmb_HangupPos.SelectedItem = _IVRTurnagent.HangupPos;
  32. this.cmb_FailPos.DataSource = GlobalController.GetComBoBoxofIVR();
  33. this.cmb_FailPos.DisplayMember = "Note";//2017-5-8将Name改为Note
  34. this.cmb_FailPos.ValueMember = "ID";
  35. if (_IVRTurnagent.FailPos != null)
  36. cmb_FailPos.SelectedItem = _IVRTurnagent.FailPos;
  37. this.cmb_successPos.DataSource= GlobalController.GetComBoBoxofIVR();
  38. this.cmb_successPos.DisplayMember = "Note";//2017-5-8将Name改为Note
  39. this.cmb_successPos.ValueMember = "ID";
  40. if (_IVRTurnagent.SuccessPos != null)
  41. cmb_successPos.SelectedItem = _IVRTurnagent.SuccessPos;
  42. this.tb_ExtenVar.Text = _IVRTurnagent.Exten;
  43. }
  44. private void btn_enter_Click(object sender, EventArgs e)
  45. {
  46. _IVRTurnagent.HangupPos = cmb_HangupPos.SelectedItem as IVRControlBase;
  47. _IVRTurnagent.SuccessPos = this.cmb_successPos.SelectedItem as IVRControlBase;
  48. _IVRTurnagent.FailPos = this.cmb_FailPos.SelectedItem as IVRControlBase;
  49. _IVRTurnagent.Pos = this.tb_NodeID.Text;
  50. _IVRTurnagent.Exten = this.tb_ExtenVar.Text;
  51. _IVRTurnagent.Name = this.tb_NodeName.Text;
  52. _IVRTurnagent.Note = this.rtb_Note.Text;
  53. //_IVRTurnagent .BandData =
  54. this.FindForm().DialogResult = DialogResult.OK;
  55. this.FindForm().Close();
  56. }
  57. private void btn_cancel_Click(object sender, EventArgs e)
  58. {
  59. this.FindForm().DialogResult = DialogResult.No;
  60. this.FindForm().Close();
  61. }
  62. private void rtb_BindData_MouseDoubleClick(object sender, MouseEventArgs e)
  63. {
  64. FrmIVREdit frm = new FrmIVREdit(_IVRTurnagent.BandData);
  65. frm.Text = "转人工节点传输变量定义";
  66. if (frm.ShowDialog() == DialogResult.OK)
  67. {
  68. this.rtb_BindData.Text = frm.GetText();
  69. _IVRTurnagent.BandData = frm.Vars;
  70. }
  71. }
  72. }
  73. }