Bll/BNewsSort.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Web.UI.WebControls;
using Dal;
using Model;

namespace Bll
{
    public class BNewsSort
    {
        DNewsSort idn = new DNewsSort();
        public void BindRep(Repeater repeater, string Where)
        {
            repeater.DataSource = GetLists(Where);
            repeater.DataBind();
        }
        public DataTable GetLists(string Where)
        {
            return idn.GetList(Where);
        }
        /// <summary>
        /// 外部调用分类
        /// </summary>
        /// <param name="SortId"></param>
        /// <param name="returnimg"></param>
        /// <param name="iMaxLayer"></param>
        /// <returns></returns>
        public DataTable GetSortTree(int SortId, bool returnimg, ref int iMaxLayer)
        {
            //DataTable sourcedt = idn.GetList(string.Empty);
            DataTable sourcedt = idn.GetList(string.Empty);
            DataTable targetdt = sourcedt.Clone(); //克隆一个结构一样DataTable
            GetSortTree2(sourcedt, targetdt, SortId, returnimg, 0,ref iMaxLayer);

            return targetdt;
        }
        /// <summary>
        /// 递归获取分类
        /// </summary>
        /// <param name="sourcedt"></param>
        /// <param name="tardt"></param>
        /// <param name="SortId"></param>
        /// <param name="returnimg"></param>
        /// <param name="dep"></param>
        /// <param name="iMaxLayer"></param>
        private void GetSortTree2(DataTable sourcedt, DataTable tardt,int SortId, bool returnimg, int dep, ref int iMaxLayer)
        {
            if (iMaxLayer == 0 || dep < iMaxLayer)
            {
                DataView dv = sourcedt.DefaultView;
                dv.RowFilter = " NS_ParentId="+SortId.ToString();
                foreach (DataRowView drv in dv)
                {
                    StringBuilder str = new StringBuilder();
                    if (returnimg)
                    {
                        for (int i = 0; i < dep; i++)
后面还有 214 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。