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

            try
            {
                if (inCommonNoteBiz == null)
                {
                    inCommonNoteBiz = new InCommonNoteBiz(m_app);
                }
                inCommonNoteBiz.GetDetaliInCommonNote(ref m_inCommonNote);
                waitDialog.Hide();
                waitDialog.Close();
                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;
            }
        }
Пример #2
0
        /// <summary>
        /// 存在数据未保存
        /// </summary>
        /// <returns></returns>
        public bool HasInfoSave()
        {
            bool HasSave = false;

            foreach (XtraTabPage item in tabcontrol.TabPages)
            {
                if (item == null || item.Controls == null || item.Controls.Count == 0)
                {
                    continue;
                }
                UCIncommonNoteTab uCIncommonNoteTab = item.Controls[0] as UCIncommonNoteTab;
                if (uCIncommonNoteTab == null)
                {
                    continue;
                }
                HasSave = uCIncommonNoteTab.HasSave();
                if (HasSave)
                {
                    return(HasSave);
                }
            }
            return(HasSave);
        }