Esempio n. 1
0
        void LoadArticles()
        {
            //取出所有待审批文章,逐一判断是否具有权限
            List <Advice> GetAllArticles = AdviceHelper.GetArticlesByAdviceTypeID(null, AdviceState.Checking, Pager.Begin, Pager.Count);

            if (GetAllArticles.Count == 0)
            {
                Messages.ShowMessage("您好,暂无待审核文章记录!");
                return;
            }
            List <Advice> adviceList = new List <Advice>();

            foreach (Advice advice in GetAllArticles)
            {
                try
                {
                    string curLayerNOText = ProcessHelper.GetCurLayerNOAdviceText(advice.ID);
                    if (curLayerNOText != "") //反馈当前审批进程:类似 Advice.FirstAudit
                    {
                        List <string> contents = AccountHelper.GetPermissionContents(AccountID, advice.TypeID);
                        if (contents.Contains(curLayerNOText))
                        {
                            adviceList.Add(advice);
                        }
                    }
                }
                catch
                { }
            }

            if (adviceList != null)
            {
                Pager.RecorderCount = adviceList.Count;
            }
            else
            {
                Pager.RecorderCount = 0;
            }
            if (Pager.Count < 0)
            {
                Pager.PageIndex = 0;
            }
            Pager.FreshMyself();
            if (Pager.Count <= 0)
            {
                DataGridView.DataSource = null;
                DataGridView.DataBind();
                return;
            }

            DataGridView.DataSource = adviceList.GetRange(Pager.Begin, Pager.Count);
            DataGridView.DataBind();
        }