ivr流程编辑器

CtlIVRLeaveWord.cs 3.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 CtlIVRLeaveWord : UserControl
  15. {
  16. IVRLeaveWord _IVRLeaveWord;
  17. public CtlIVRLeaveWord(IVRLeaveWord obj)
  18. {
  19. InitializeComponent();
  20. _IVRLeaveWord = obj;
  21. this.Load += new EventHandler(CtlIVRLeaveWord_Load);
  22. }
  23. void CtlIVRLeaveWord_Load(object sender, EventArgs e)
  24. {
  25. this.tb_NodeID.Text = _IVRLeaveWord.Pos;
  26. this.tb_NodeName.Text = _IVRLeaveWord.Name;
  27. this.rtb_path.Text = _IVRLeaveWord.Path;
  28. this.rtb_Note.Text = _IVRLeaveWord.Note;
  29. GlobalController.BindComBoBoxOfEnumDesc(cmb_FinishKey, _IVRLeaveWord.FinishKey);
  30. cmb_HangupPos.DataSource = GlobalController.GetComBoBoxofIVR();
  31. this.cmb_HangupPos.DisplayMember = "Note";//2017-5-8将Name改为Note
  32. this.cmb_HangupPos.ValueMember = "ID";
  33. if (_IVRLeaveWord.HangupPos != null)
  34. cmb_HangupPos.SelectedItem = _IVRLeaveWord.HangupPos;
  35. this.cmb_successNextNode.DataSource = GlobalController.GetComBoBoxofIVR();
  36. this.cmb_successNextNode.DisplayMember = "Note";//2017-5-8将Name改为Note
  37. this.cmb_successNextNode.ValueMember = "ID";
  38. if (_IVRLeaveWord.TimeoutPos != null)
  39. cmb_successNextNode.SelectedItem = _IVRLeaveWord.TimeoutPos;
  40. this.cmb_failNextNode.DataSource = GlobalController.GetComBoBoxofIVR();
  41. this.cmb_failNextNode.DisplayMember = "Note";//2017-5-8将Name改为Note
  42. this.cmb_failNextNode.ValueMember = "ID";
  43. if (_IVRLeaveWord.FinishPos != null)
  44. cmb_failNextNode.SelectedItem = _IVRLeaveWord.FinishPos;
  45. this.numericUpDown1.Value = _IVRLeaveWord.Timeout;
  46. }
  47. private void btn_enter_Click(object sender, EventArgs e)
  48. {
  49. _IVRLeaveWord.Timeout = (int)this.numericUpDown1.Value;
  50. _IVRLeaveWord.HangupPos = cmb_HangupPos.SelectedItem as IVRControlBase;
  51. _IVRLeaveWord.FinishPos = this.cmb_failNextNode.SelectedItem as IVRControlBase;
  52. _IVRLeaveWord.TimeoutPos = this.cmb_successNextNode.SelectedItem as IVRControlBase;
  53. _IVRLeaveWord.FinishKey = GlobalController.GetEnumByComBoBoxValueOFDesc<FinishKeyType>(cmb_FinishKey.Text);
  54. _IVRLeaveWord.Pos = this.tb_NodeID.Text;
  55. _IVRLeaveWord.Name = this.tb_NodeName.Text;
  56. _IVRLeaveWord.Note = this.rtb_Note.Text;
  57. _IVRLeaveWord.Path = this.rtb_path.Text;
  58. this.FindForm().DialogResult = DialogResult.OK;
  59. this.FindForm().Close();
  60. }
  61. private void rtb_path_MouseDoubleClick(object sender, MouseEventArgs e)
  62. {
  63. FrmIVREdit frm = new FrmIVREdit(_IVRLeaveWord.Path);
  64. frm.Text = "留言内容定义";
  65. if (frm.ShowDialog() == DialogResult.OK)
  66. {
  67. this.rtb_path.Text = frm.GetText();
  68. }
  69. }
  70. private void btn_cancel_Click(object sender, EventArgs e)
  71. {
  72. this.FindForm().DialogResult = DialogResult.No;
  73. this.FindForm().Close();
  74. }
  75. }
  76. }