Esempio n. 1
0
        /// <summary>
        /// 加载助手窗体
        /// </summary>
        /// <param name="parentCtrl"></param>
        /// <param name="classId"></param>
        public void loadFramePithy(XBaseControl parentCtrl, XUserControl xUserControl, AssiBtnDTO btnDTO)
        {
            LayoutPanelManager layoutPanelManager = xUserControl.GetConfig().GetInstance("LayoutPanelManager") as LayoutPanelManager;

            for (int n = 0; n < layoutPanelManager.ManagedPanels.Count; n++)
            {
                LayoutManagedPanel layoutManaged = layoutPanelManager.ManagedPanels[n] as LayoutManagedPanel;
                if (btnDTO.modelType == null || btnDTO.modelType != "complex")
                {
                    if ("OrdertemplatePithy" == layoutManaged.Id)
                    {
                        if (layoutManaged.Controls.Count < 1)
                        {
                            XmlNode node = xUserControl.GetConfig().GetNode("ManagedPanel", layoutManaged.Id);
                            xUserControl.GetConfig().CreateManagedPanelControl(layoutManaged, node);
                        }
                        layoutPanelManager.SelectedIndex = n;
                        break;
                    }
                }
                else
                {
                    if ("OrdertemplateComplex" == layoutManaged.Id)
                    {
                        if (layoutManaged.Controls.Count < 1)
                        {
                            XmlNode node = xUserControl.GetConfig().GetNode("ManagedPanel", layoutManaged.Id);
                            xUserControl.GetConfig().CreateManagedPanelControl(layoutManaged, node);
                        }
                        layoutPanelManager.SelectedIndex = n;
                        break;
                    }
                }
            }
            if (!IsFrameOpened)
            {
                IsFrameOpened = true;

                if (this.FrameOpenModel == AssiFrameOpenModel.SHOW_DIALOG)
                {
                    this.ShowDialog(parentCtrl);
                }
                else
                {
                    this.Show(parentCtrl);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 加载助手窗体
        /// </summary>
        /// <param name="parentCtrl"></param>
        /// <param name="classId"></param>
        public void loadFrame(XBaseControl parentCtrl, XUserControl xUserControl, AssiBtnDTO btnDTO)
        {
            this.xUserControl = xUserControl;
            this.xapFormControl.AddRender(xUserControl);

            if (btnDTO.ButtonId == "btnOpTemplateFrame")
            {
                this.loadFramePithy(parentCtrl, xUserControl, btnDTO);
                return;
            }

            LayoutPanelManager layoutPanelManager = xUserControl.GetConfig().GetInstance("LayoutPanelManager") as LayoutPanelManager;

            for (int n = 0; n < layoutPanelManager.ManagedPanels.Count; n++)
            {
                LayoutManagedPanel layoutManaged = layoutPanelManager.ManagedPanels[n] as LayoutManagedPanel;
                if (btnDTO.PanelManagerId == layoutManaged.Id)
                {
                    if (layoutManaged.Controls.Count < 1)
                    {
                        XmlNode node = xUserControl.GetConfig().GetNode("ManagedPanel", layoutManaged.Id);
                        xUserControl.GetConfig().CreateManagedPanelControl(layoutManaged, node);
                    }
                    layoutPanelManager.SelectedIndex = n;

                    foreach (Control ctrTemp in layoutManaged.Controls)
                    {
                        if (ctrTemp is XLayoutPanel)
                        {
                            if ((ctrTemp as XLayoutPanel).ControlCenter is XTabControl)
                            {
                                //if (ctrTemp is XTabControl)
                                {
                                    var tabCtr = (ctrTemp as XLayoutPanel).ControlCenter as XTabControl;
                                    for (var j = 0; j < tabCtr.XTabPages.Count; j++)
                                    {
                                        if (btnDTO.XTabPageId.Equals(tabCtr.XTabPages[j].Id))
                                        {
                                            tabCtr.SelectedIndex = j;
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    break;
                }
            }

            int     i       = 0;
            Control control = xUserControl.GetControl();

            foreach (Control obj in control.Controls)
            {
                XTabPage xtabPage = obj as XTabPage;
                if (xtabPage != null)
                {
                    i++;
                    if (i == 3)
                    {
                        xtabPage.Select();
                    }
                }
            }

            //layoutPanelManager.SelectedIndex = 1;

            // 如果窗体已经打开,只进行切换tab页签
            if (!IsFrameOpened)
            {
                IsFrameOpened = true;

                if (this.FrameOpenModel == AssiFrameOpenModel.SHOW_DIALOG)
                {
                    this.ShowDialog(parentCtrl);
                }
                else
                {
                    this.Show(parentCtrl);
                }
            }
        }