ivr流程编辑器

CtlIVRTransfeOut.cs 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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.Model;
  11. using HySoft.IVRFlowEditor.Utility;
  12. namespace HySoft.IVRFlowEditor.IVRControl
  13. {
  14. public partial class CtlIVRTransfeOut : UserControl
  15. {
  16. IVRTransfeOut _IVRTransfeOut;
  17. public CtlIVRTransfeOut(IVRTransfeOut obj)
  18. {
  19. InitializeComponent();
  20. _IVRTransfeOut = obj;
  21. this.Load += new EventHandler(CtlIVRTransfeOut_Load);
  22. }
  23. void CtlIVRTransfeOut_Load(object sender, EventArgs e)
  24. {
  25. this.cmb_CalleeNumType.DataSource = System.Enum.GetNames(typeof(NumberType));
  26. this.cmb_CalleeNumType.SelectedItem = _IVRTransfeOut.CalleeNumType.ToString();
  27. this.tb_NodeID.Text = _IVRTransfeOut.Pos;
  28. this.tb_NodeName.Text = _IVRTransfeOut.Name;
  29. this.rtb_Note.Text = _IVRTransfeOut.Note;
  30. this.cmb_CalleeNum.Text = _IVRTransfeOut.CalleeNum;
  31. this.tb_TimeOut.Text = _IVRTransfeOut.Timeout.ToString();
  32. this.cmb_successNextNode.DataSource = GlobalController.GetComBoBoxofIVR();
  33. this.cmb_successNextNode.DisplayMember = "Note";//2017-5-8将Name改为Note
  34. this.cmb_successNextNode.ValueMember = "ID";
  35. if (_IVRTransfeOut.SuccessPos != null)
  36. this.cmb_successNextNode.SelectedItem = _IVRTransfeOut.SuccessPos;
  37. this.cmb_failNextNode.DataSource = GlobalController.GetComBoBoxofIVR();
  38. this.cmb_failNextNode.DisplayMember = "Name";
  39. this.cmb_failNextNode.ValueMember = "ID";
  40. if (_IVRTransfeOut.FailPos != null)
  41. this.cmb_failNextNode.SelectedItem = _IVRTransfeOut.FailPos;
  42. }
  43. private void btn_enter_Click(object sender, EventArgs e)
  44. {
  45. _IVRTransfeOut.Name = tb_NodeName.Text;
  46. _IVRTransfeOut.Note = rtb_Note.Text;
  47. _IVRTransfeOut.CalleeNum = this.cmb_CalleeNum.Text;
  48. _IVRTransfeOut.CalleeNumType = (NumberType)Enum.Parse(typeof(NumberType), this.cmb_CalleeNumType.Text);
  49. _IVRTransfeOut.Timeout = Int32.Parse(this.tb_TimeOut.Text);
  50. if (this.cmb_successNextNode.SelectedItem != null)
  51. _IVRTransfeOut.SuccessPos = (this.cmb_successNextNode.SelectedItem as IVRControlBase);
  52. if (this.cmb_failNextNode.SelectedItem != null)
  53. _IVRTransfeOut.FailPos = (this.cmb_failNextNode.SelectedItem as IVRControlBase);
  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 cmb_CalleeNumType_SelectedIndexChanged(object sender, EventArgs e)
  63. {
  64. GlobalController.BindComboBoxOFVar(this.cmb_CalleeNum, GlobalController.GetEnumByComBoBoxValueOFDesc<NumberType>(this.cmb_CalleeNumType.Text));
  65. }
  66. }
  67. }