ivr流程编辑器

CtlIVRTimer.cs 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 CtlIVRTimer : UserControl
  14. {
  15. IVRTimer _IVRTimer;
  16. public CtlIVRTimer(IVRTimer obj)
  17. {
  18. InitializeComponent();
  19. _IVRTimer = obj;
  20. this.Load += new EventHandler(CtlIVRTimer_Load);
  21. }
  22. void CtlIVRTimer_Load(object sender, EventArgs e)
  23. {
  24. this.tb_NodeID.Text = _IVRTimer.Pos;
  25. this.tb_NodeName.Text = _IVRTimer.Name;
  26. this.rtb_Note.Text = _IVRTimer.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 (_IVRTimer.Next != null)
  31. cmb_HangupPos.SelectedItem = _IVRTimer.Next;
  32. this.tb_begintime.Text = _IVRTimer.BeginTime;
  33. this.tb_endtime.Text = _IVRTimer.EndTime;
  34. this.num_TimerInterval.Value = _IVRTimer.TimerInterval;
  35. }
  36. private void btn_enter_Click(object sender, EventArgs e)
  37. {
  38. _IVRTimer.Next = cmb_HangupPos.SelectedItem as IVRControlBase;
  39. _IVRTimer.EndTime=this.tb_endtime.Text;
  40. _IVRTimer.BeginTime=this.tb_begintime.Text;
  41. _IVRTimer.TimerInterval = (int)this.num_TimerInterval.Value;
  42. _IVRTimer.Pos = this.tb_NodeID.Text;
  43. _IVRTimer.Name = this.tb_NodeName.Text;
  44. _IVRTimer.Note = this.rtb_Note.Text;
  45. this.FindForm().DialogResult = DialogResult.OK;
  46. this.FindForm().Close();
  47. }
  48. private void btn_cancel_Click(object sender, EventArgs e)
  49. {
  50. this.FindForm().DialogResult = DialogResult.No;
  51. this.FindForm().Close();
  52. }
  53. }
  54. }