using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using HySoft.IVRFlowEditor.IVRControlUtility; using HySoft.IVRFlowEditor.Utility; using HySoft.IVRFlowEditor.Model; namespace HySoft.IVRFlowEditor.IVRControl { public partial class CtlIVRLeaveWord : UserControl { IVRLeaveWord _IVRLeaveWord; public CtlIVRLeaveWord(IVRLeaveWord obj) { InitializeComponent(); _IVRLeaveWord = obj; this.Load += new EventHandler(CtlIVRLeaveWord_Load); } void CtlIVRLeaveWord_Load(object sender, EventArgs e) { this.tb_NodeID.Text = _IVRLeaveWord.Pos; this.tb_NodeName.Text = _IVRLeaveWord.Name; this.rtb_path.Text = _IVRLeaveWord.Path; this.rtb_Note.Text = _IVRLeaveWord.Note; GlobalController.BindComBoBoxOfEnumDesc(cmb_FinishKey, _IVRLeaveWord.FinishKey); cmb_HangupPos.DataSource = GlobalController.GetComBoBoxofIVR(); this.cmb_HangupPos.DisplayMember = "Note";//2017-5-8将Name改为Note this.cmb_HangupPos.ValueMember = "ID"; if (_IVRLeaveWord.HangupPos != null) cmb_HangupPos.SelectedItem = _IVRLeaveWord.HangupPos; this.cmb_successNextNode.DataSource = GlobalController.GetComBoBoxofIVR(); this.cmb_successNextNode.DisplayMember = "Note";//2017-5-8将Name改为Note this.cmb_successNextNode.ValueMember = "ID"; if (_IVRLeaveWord.TimeoutPos != null) cmb_successNextNode.SelectedItem = _IVRLeaveWord.TimeoutPos; this.cmb_failNextNode.DataSource = GlobalController.GetComBoBoxofIVR(); this.cmb_failNextNode.DisplayMember = "Note";//2017-5-8将Name改为Note this.cmb_failNextNode.ValueMember = "ID"; if (_IVRLeaveWord.FinishPos != null) cmb_failNextNode.SelectedItem = _IVRLeaveWord.FinishPos; this.numericUpDown1.Value = _IVRLeaveWord.Timeout; } private void btn_enter_Click(object sender, EventArgs e) { _IVRLeaveWord.Timeout = (int)this.numericUpDown1.Value; _IVRLeaveWord.HangupPos = cmb_HangupPos.SelectedItem as IVRControlBase; _IVRLeaveWord.FinishPos = this.cmb_failNextNode.SelectedItem as IVRControlBase; _IVRLeaveWord.TimeoutPos = this.cmb_successNextNode.SelectedItem as IVRControlBase; _IVRLeaveWord.FinishKey = GlobalController.GetEnumByComBoBoxValueOFDesc(cmb_FinishKey.Text); _IVRLeaveWord.Pos = this.tb_NodeID.Text; _IVRLeaveWord.Name = this.tb_NodeName.Text; _IVRLeaveWord.Note = this.rtb_Note.Text; _IVRLeaveWord.Path = this.rtb_path.Text; this.FindForm().DialogResult = DialogResult.OK; this.FindForm().Close(); } private void rtb_path_MouseDoubleClick(object sender, MouseEventArgs e) { FrmIVREdit frm = new FrmIVREdit(_IVRLeaveWord.Path); frm.Text = "留言内容定义"; if (frm.ShowDialog() == DialogResult.OK) { this.rtb_path.Text = frm.GetText(); } } private void btn_cancel_Click(object sender, EventArgs e) { this.FindForm().DialogResult = DialogResult.No; this.FindForm().Close(); } } }