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; namespace HySoft.IVRFlowEditor.Propretity { public partial class CtlIVRSubflow : UserControl { public CtlIVRSubflow() { InitializeComponent(); } IVRSubflow _IVRSubflow; public CtlIVRSubflow(IVRSubflow obj) { InitializeComponent(); _IVRSubflow=obj; this.Load += new EventHandler(CtlIVRSubflow_Load); } void CtlIVRSubflow_Load(object sender, EventArgs e) { this.cmb_NextNode.DataSource = null; this.tb_NodeID.Text = _IVRSubflow.Pos; this.tb_NodeName.Text = _IVRSubflow.Name; this.rtb_Note.Text = _IVRSubflow.Note; this.cmb_NextNode.DataSource = GlobalController.GetComBoBoxofIVR(); this.cmb_NextNode.DisplayMember = "Note";//2017-5-8将Name改为Note this.cmb_NextNode.ValueMember = "ID"; if (_IVRSubflow.Next != null) this.cmb_NextNode.SelectedItem = _IVRSubflow.Next; this.cmb_subFlow.DataSource = GlobalController.GetComBoBoxofIVRFlow(); // _IVRSubflow.IVRFlows; this.cmb_subFlow.DisplayMember = "FlowName"; this.cmb_subFlow.ValueMember = "FlowID"; if (_IVRSubflow.FlowName != null) this.cmb_subFlow.SelectedText = _IVRSubflow.FlowName; } private void btn_enter_Click(object sender, EventArgs e) { _IVRSubflow.Name = tb_NodeName.Text; _IVRSubflow.Note = rtb_Note.Text; if (this.cmb_NextNode.SelectedItem != null) _IVRSubflow.Next= (this.cmb_NextNode.SelectedItem as IVRControlBase); if (this.cmb_subFlow.SelectedItem != null) _IVRSubflow.FlowName =( this.cmb_subFlow.SelectedItem as IVRFlowInfo).FlowID; if (this.cmb_subStartNode.SelectedItem != null) _IVRSubflow.BeginPos = this.cmb_subStartNode.SelectedItem as IVRControlBase; this.FindForm().DialogResult = DialogResult.OK; this.FindForm().Close(); } private void btn_cancel_Click(object sender, EventArgs e) { this.FindForm().DialogResult = DialogResult.No; this.FindForm().Close(); } private void cmb_subFlow_SelectedIndexChanged(object sender, EventArgs e) { this.cmb_subStartNode.DataSource = (this.cmb_subFlow.SelectedItem as IVRFlowInfo).IVRFlowNode.OrderBy(a=>a.ID).ToList(); this.cmb_subStartNode.DisplayMember = "Name"; this.cmb_subStartNode.ValueMember = "ID"; } } }