Exemplo n.º 1
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            for (int i = 0; i < frmMain.Main.DockPanelMain.Contents.Count; i++)
            {
                if (frmMain.Main.DockPanelMain.Contents[i] is dockCustomer)
                {
                    dockCustomer dc =
                        (dockCustomer)frmMain.Main.DockPanelMain.Contents[i];
                    if (dc.GUID.ToString() == e.Node.Name)
                    {
                        if (!(dc.GUID == Guid.Empty) &&
                            dc.TabText.Substring(5) !=
                            e.Node.Text)
                        {
                            string str = "客户信息-";
                            dc.TabText = str + e.Node.Text;
                        }

                        dc.Focus();
                        dc.GetData();
                        return;
                    }
                }
            }

            dockCustomer dock = new dockCustomer();

            if (!(e.Node.Name == Guid.Empty.ToString()))
            {
                dock.TabText += "-" + e.Node.Text;
            }
            dock.GUID = new Guid(e.Node.Name);
            dock.Show(frmMain.Main.DockPanelMain);
        }
Exemplo n.º 2
0
        private void tsbCustomer_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < this.dockPanel1.Contents.Count; i++)
            {
                if (frmMain.Main.DockPanelMain.Contents[i] is dockCustomer)
                {
                    dockCustomer dc =
                        (dockCustomer)this.dockPanel1.Contents[i];
                    if (dc.GUID.ToString() == Guid.Empty.ToString())
                    {
                        dc.Focus();
                        dc.GetData();
                        return;
                    }
                }
            }

            dockCustomer dock = new dockCustomer();

            dock.Show(this.dockPanel1);
        }