Beispiel #1
0
        /// <summary>
        /// 初始化界面
        /// </summary>
        /// <param name="mode">初始化模式</param>
        /// <param name="node">树节点</param>
        private void InitForm(InitMode mode, TreeNode node)
        {
            if (m_flowNotice == null)
            {
                m_flowNotice = PlatformFactory.GetObject <IFlowNoticeManagement>();
                m_billMsg    = PlatformFactory.GetObject <IBillFlowMessage>();
            }

            if (mode == InitMode.刷新数据显示)
            {
                lblTitle.Text             = "";
                txtContent.Text           = "";
                contextMenuStrip1.Enabled = false;
            }

            switch (node.Name)
            {
            case "通知_预警消息":
                InitWarningNotice(mode);
                break;

            case "通知_会议提醒":
                InitMeetingNotice(mode);
                break;

            case "通知_日常事务":
                InitDailyAffair(mode);
                break;

            case "通知_单据处理后知会":
                InitBillNoticeMessage(mode);

                if (mode == InitMode.刷新数据显示)
                {
                    contextMenuStrip1.Enabled = true;
                }
                break;

            case "任务_待处理_单据":
                ThreadPool.QueueUserWorkItem((WaitCallback) delegate
                {
                    lock (locker)
                    {
                        InitUnsettledBill(mode);
                    }
                });

                if (mode == InitMode.刷新数据显示)
                {
                    contextMenuStrip1.Enabled = true;
                }
                break;

            case "任务_已处理_单据":
                InitFinishedBill(mode);

                if (mode == InitMode.刷新数据显示)
                {
                    contextMenuStrip1.Enabled = true;
                }

                break;

            case "任务_待处理_任务管理":
                InitTaskMsg(mode);
                break;

            default:
                if (mode == InitMode.刷新数据显示)
                {
                    ClearForm();
                }
                break;
            }

            if (mode == InitMode.刷新数据显示)
            {
                dataGridView1.Refresh();

                if (dataGridView1.Columns.Contains("序号"))
                {
                    dataGridView1.Columns["序号"].Visible = false;
                }

                treeView.Focus();
            }

            userControlDataLocalizer1.Init(dataGridView1, this.Name,
                                           UniversalFunction.SelectHideFields(this.Name, dataGridView1.Name, BasicInfo.LoginID));
        }