ivr流程编辑器

CtlIVRRecordSet.cs 2.9KB

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 CtlIVRRecordSet : UserControl
  14. {
  15. IVRRecordSet _IVRRecordSet;
  16. public CtlIVRRecordSet(IVRRecordSet obj)
  17. {
  18. InitializeComponent();
  19. _IVRRecordSet = obj;
  20. this.Load += new EventHandler(CtlIVRRecordSet_Load);
  21. }
  22. void CtlIVRRecordSet_Load(object sender, EventArgs e)
  23. {
  24. this.tb_NodeID.Text = _IVRRecordSet.Pos;
  25. this.tb_NodeName.Text = _IVRRecordSet.Name;
  26. this.rtb_Note.Text = _IVRRecordSet.Note;
  27. this.cmb_EPos.DataSource = GlobalController.GetComBoBoxofIVR();
  28. this.cmb_EPos.DisplayMember = "Note";//2017-5-8将Name改为Note
  29. this.cmb_EPos.ValueMember = "ID";
  30. if (_IVRRecordSet.EPos != null)
  31. cmb_EPos.SelectedItem = _IVRRecordSet.EPos;
  32. this.cmb_GPos.DataSource = GlobalController.GetComBoBoxofIVR();
  33. this.cmb_GPos.DisplayMember = "Note";//2017-5-8将Name改为Note
  34. this.cmb_GPos.ValueMember = "ID";
  35. if (_IVRRecordSet.GPos != null)
  36. cmb_GPos.SelectedItem = _IVRRecordSet.GPos;
  37. this.cmb_LPos.DataSource = GlobalController.GetComBoBoxofIVR();
  38. this.cmb_LPos.DisplayMember = "Note";//2017-5-8将Name改为Note
  39. this.cmb_LPos.ValueMember = "ID";
  40. if (_IVRRecordSet.LPos != null)
  41. cmb_LPos.SelectedItem = _IVRRecordSet.LPos;
  42. CtlVar = null;
  43. CtlVar = new CtlDefaultListVar();
  44. CtlVar.SetData(_IVRRecordSet.Map.Count > 0 ? _IVRRecordSet.Map.Select(a => a.Var).ToList() : new List<string>());
  45. this.groupBox1.Controls.Clear();
  46. this.groupBox1.Controls.Add(CtlVar);
  47. CtlVar.Dock = DockStyle.Fill;
  48. }
  49. CtlDefaultListVar CtlVar;
  50. private void btn_enter_Click(object sender, EventArgs e)
  51. {
  52. _IVRRecordSet.LPos = this.cmb_LPos.SelectedItem as IVRControlBase;
  53. _IVRRecordSet.GPos = this.cmb_GPos.SelectedItem as IVRControlBase;
  54. _IVRRecordSet.EPos = this.cmb_EPos.SelectedItem as IVRControlBase;
  55. _IVRRecordSet.Pos = this.tb_NodeID.Text;
  56. _IVRRecordSet.Name = this.tb_NodeName.Text;
  57. _IVRRecordSet.Note = this.rtb_Note.Text;
  58. _IVRRecordSet.Map = CtlVar.GetListVar();
  59. this.FindForm().DialogResult = DialogResult.OK;
  60. this.FindForm().Close();
  61. }
  62. private void btn_cancel_Click(object sender, EventArgs e)
  63. {
  64. this.FindForm().DialogResult = DialogResult.No;
  65. this.FindForm().Close();
  66. }
  67. }
  68. }