Exemple #1
0
        /// <summary>
        /// 初始化界面
        /// </summary>
        private void InitForm()
        {
            WaitDialogForm waitDialog = new WaitDialogForm("正在获取数据……", "请稍等。");

            try
            {
                if (inCommonNoteBiz == null)
                {
                    inCommonNoteBiz = new InCommonNoteBiz(m_app);
                }
                //xll 在初始化列表界面的时候获取值
                //inCommonNoteBiz.GetDetaliInCommonNote(ref m_inCommonNote);
                inCommonNoteBiz.GetIncommTab(ref m_inCommonNote);
                waitDialog.Hide();
                waitDialog.Close();
                //判断选择节点是否被删除,删除则给出提示
                if (m_inCommonNote == null || m_inCommonNote.InCommonNoteFlow == null)
                {
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("该单据已被他人删除");
                    return;
                }
                //int countItem=  inCommonNoteBiz.GetCommonItemCount(m_inCommonNote.InCommonNoteFlow);
                foreach (var item in m_inCommonNote.InCommonNoteTabList)
                {
                    CommonNote_TabEntity commonNote_TabEntity = null;
                    foreach (var itemTab in m_commonNoteEntity.CommonNote_TabList)
                    {
                        if (itemTab.CommonNote_Tab_Flow == item.CommonNote_Tab_Flow)
                        {
                            commonNote_TabEntity = itemTab;
                            break;
                        }
                    }
                    if (commonNote_TabEntity == null)
                    {
                        continue;
                    }
                    XtraTabPage tabPage = new XtraTabPage();
                    tabPage.Tag  = item;
                    tabPage.Text = item.CommonNoteTabName;
                    if (item.ShowType == "表格")
                    {
                        UCIncommonNoteTab UCIncommonNoteTab = new UCIncommonNoteTab(item, commonNote_TabEntity, m_inCommonNote, m_app, m_canEdit);
                        tabPage.Controls.Add(UCIncommonNoteTab);
                        UCIncommonNoteTab.Dock = DockStyle.Fill;
                    }
                    else
                    {
                        UCInCommonTabSingle ucInCommonTabSingle = new UCInCommonTabSingle(item, commonNote_TabEntity, m_inCommonNote, m_app, m_canEdit);
                        tabPage.Controls.Add(ucInCommonTabSingle);
                        ucInCommonTabSingle.Dock = DockStyle.Fill;
                    }
                    tabcontrol.TabPages.Add(tabPage);
                }
                tabcontrol.SelectedTabPageIndex = 1;
            }
            catch (Exception ex)
            {
                waitDialog.Hide();
                waitDialog.Close();
                throw ex;
            }
        }