Example #1
0
        /// <summary>
        /// 信息查询
        /// </summary>
        /// <returns></returns>
        public virtual DataView InfoListDataBind(
            string MenuType,
            string LoginName,
            string Criteria,
            ref long CurrentPage,
            long PageRows,
            out long PageCount)
        {
            long     lgPageCount = 0;
            DataView dv;

            switch (MenuType)
            {
            case "Callback":
                dv = dal.GetInfoListByRecycle(
                    Criteria,
                    ref CurrentPage,
                    PageRows,
                    ref lgPageCount);
                break;

            case "MyPub":
                dv = dal.GetInfoListBySelf(
                    Criteria,
                    LoginName,
                    ref CurrentPage,
                    PageRows,
                    ref lgPageCount);
                break;

            default:
                dv = null;
                break;
            }

            if (!dv.Table.Columns.Contains("TitleDesc"))
            {
                dv.Table.Columns.Add("TitleDesc", typeof(string));
            }
            if (!dv.Table.Columns.Contains("AuditingStatusDesc"))
            {
                dv.Table.Columns.Add("AuditingStatusDesc", typeof(string));
            }

            for (int i = 0; i < dv.Count; i++)
            {
                dv[i]["TitleDesc"] = "[" + dv[i]["InfoTypeName"].ToString().Trim() +
                                     "]" + dv[i]["Title"].ToString().Trim();

                switch (Convert.ToByte(dv[i]["AuditingStatus"]))
                {
                case 0:
                    dv[i]["AuditingStatusDesc"] = "待审";
                    break;

                case 1:
                    dv[i]["AuditingStatusDesc"] = "已审";
                    break;

                case 2:
                default:
                    dv[i]["AuditingStatusDesc"] = "审核未通过";
                    break;
                }
            }

            PageCount = lgPageCount;

            return(dv);
        }