ivr流程编辑器

CtlIVRQueue.cs 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 CtlIVRQueue : UserControl
  15. {
  16. IVRQueue _IVRQueue;
  17. public CtlIVRQueue(IVRQueue obj)
  18. {
  19. InitializeComponent();
  20. _IVRQueue = obj;
  21. this.Load += new EventHandler(CtlIVRQueue_Load);
  22. }
  23. void CtlIVRQueue_Load(object sender, EventArgs e)
  24. {
  25. this.tb_NodeID.Text = _IVRQueue.Pos;
  26. this.tb_NodeName.Text = _IVRQueue.Name;
  27. this.rtb_Note.Text = _IVRQueue.Note;
  28. cmb_HangupPos.DataSource = GlobalController.GetComBoBoxofIVR();
  29. this.cmb_HangupPos.DisplayMember = "Note";//2017-5-8将Name改为Note
  30. this.cmb_HangupPos.ValueMember = "ID";
  31. if (_IVRQueue.HangupPos != null)
  32. cmb_HangupPos.SelectedItem = _IVRQueue.HangupPos;
  33. this.cmb_NoAgentPos.DataSource = GlobalController.GetComBoBoxofIVR();
  34. this.cmb_NoAgentPos.DisplayMember = "Note";//2017-5-8将Name改为Note
  35. this.cmb_NoAgentPos.ValueMember = "ID";
  36. if (_IVRQueue.NoAgentPos != null)
  37. cmb_NoAgentPos.SelectedItem = _IVRQueue.NoAgentPos;
  38. this.cmb_NoFreePos.DataSource = GlobalController.GetComBoBoxofIVR();
  39. this.cmb_NoFreePos.DisplayMember = "Note";//2017-5-8将Name改为Note
  40. this.cmb_NoFreePos.ValueMember = "ID";
  41. if (_IVRQueue.NoFreePos != null)
  42. cmb_NoFreePos.SelectedItem = _IVRQueue.NoFreePos;
  43. this.cmb_successPos.DataSource = GlobalController.GetComBoBoxofIVR();
  44. this.cmb_successPos.DisplayMember = "Note";//2017-5-8将Name改为Note
  45. this.cmb_successPos.ValueMember = "ID";
  46. if (_IVRQueue.SuccessPos != null)
  47. cmb_successPos.SelectedItem = _IVRQueue.SuccessPos;
  48. GlobalController.BindComBoBoxOfEnumDesc(this.cmb_GroupType, _IVRQueue.GroupType);
  49. GlobalController.BindComBoBoxOfEnumDesc(this.cmb_Strategy, _IVRQueue.Strategy);
  50. GlobalController.BindComBoBoxOfEnumDesc(this.cmb_VipLevelType, _IVRQueue.VipLevelType);
  51. this.tb_Group.Text = _IVRQueue.Group;
  52. this.tb_VipLevel.Text = _IVRQueue.VipLevel;
  53. this.tb_ExtenVar.Text = _IVRQueue.ExtenVar;
  54. this.tb_AgentVar.Text = _IVRQueue.AgentVar;
  55. }
  56. private void btn_enter_Click(object sender, EventArgs e)
  57. {
  58. _IVRQueue.Pos = this.tb_NodeID.Text;
  59. _IVRQueue.Name = this.tb_NodeName.Text;
  60. _IVRQueue.Note = this.rtb_Note.Text;
  61. _IVRQueue.HangupPos = cmb_HangupPos.SelectedItem as IVRControlBase;
  62. _IVRQueue.SuccessPos = this.cmb_successPos.SelectedItem as IVRControlBase;
  63. _IVRQueue.NoAgentPos = this.cmb_NoAgentPos.SelectedItem as IVRControlBase;
  64. _IVRQueue.NoFreePos = this.cmb_NoFreePos.SelectedItem as IVRControlBase;
  65. _IVRQueue.VipLevelType = GlobalController.GetEnumByComBoBoxValueOFDesc<NumberType>(this.cmb_VipLevelType.Text);
  66. _IVRQueue.GroupType = GlobalController.GetEnumByComBoBoxValueOFDesc<NumberType>(this.cmb_GroupType.Text);
  67. _IVRQueue.Strategy = GlobalController.GetEnumByComBoBoxValueOFDesc<StrategyType>(this.cmb_Strategy.Text);
  68. _IVRQueue.Group = this.tb_Group.Text;
  69. _IVRQueue.VipLevel = this.tb_VipLevel.Text;
  70. _IVRQueue.ExtenVar = this.tb_ExtenVar.Text;
  71. _IVRQueue.AgentVar = this.tb_AgentVar.Text;
  72. this.FindForm().DialogResult = DialogResult.OK;
  73. this.FindForm().Close();
  74. }
  75. private void btn_cancel_Click(object sender, EventArgs e)
  76. {
  77. this.FindForm().DialogResult = DialogResult.No;
  78. this.FindForm().Close();
  79. }
  80. }
  81. }