Пример #1
0
        private void TreeBind(int _channel_id)
        {
            BLL.contents.article_category bll = new BLL.contents.article_category();
            DataTable dt = bll.GetList(0, _channel_id);

            this.ddlParentId.Items.Clear();
            this.ddlParentId.Items.Add(new ListItem("无父级分类", "1"));
            foreach (DataRow dr in dt.Rows)
            {
                string Id         = dr["id"].ToString();
                int    ClassLayer = int.Parse(dr["class_layer"].ToString());
                string Title      = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlParentId.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlParentId.Items.Add(new ListItem(Title, Id));
                }
            }
        }
Пример #2
0
        /// <summary>
        /// 栏目URL
        public string Url(int category_id)
        {
            string _url = string.Empty;

            BLL.contents.article_category bll = new BLL.contents.article_category();
            DataTable dt = bll.GetList(0, "class_list like '%," + category_id + ",%'", "class_layer desc, sort_id asc,id desc").Tables[0];

            if (dt.Rows.Count > 0 && dt.Rows != null)
            {
                if (!string.IsNullOrEmpty(dt.Rows[0]["link_url"].ToString()))
                {
                    _url = dt.Rows[0]["link_url"].ToString();
                }
                else
                {
                    if (bll.GetModel(category_id).model_id != 0)
                    {
                        string _key1 = BasePage.pageUrl(bll.GetModel(category_id).model_id);
                        _url = new BasePage().linkurl(_key1, category_id);
                    }
                    else
                    {
                        string _key         = BasePage.pageUrl(Convert.ToInt32(dt.Rows[0]["model_id"]));
                        string _category_id = dt.Rows[0]["id"].ToString();
                        _url = new BasePage().linkurl(_key, _category_id);
                    }
                }
            }
            return(_url.ToString());
        }
Пример #3
0
        private void edit_category(HttpContext context)
        {
            //取得管理员登录信息
            Model.managers.manager adminInfo = new Web.UI.ManagePage().GetAdminInfo();
            if (adminInfo == null)
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"未登录或已超时,请重新登录!\"}");
                return;
            }

            int category1 = OSRequest.GetFormInt("Category1");
            int category2 = OSRequest.GetFormInt("Category2");

            if (category1 == category2)
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"移动目录跟目的目录不能相同!\"}");
                return;
            }

            BLL.contents.article_category   bll   = new BLL.contents.article_category();
            Model.contents.article_category model = bll.GetModel(category2);

            if (model.class_list.IndexOf("," + category1 + ",") > 0)
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"父级本不能向其子级转移!\"}");
                return;
            }

            if (bll.GetModel(category1).parent_id == category2)
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"移动目录已经在目的目录里!\"}");
                return;
            }

            DataTable dt = bll.GetList(0, "class_list like '%," + category1 + ",%'", "class_layer asc").Tables[0];

            if (dt.Rows != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    int    id              = Convert.ToInt32(dt.Rows[i]["id"]);
                    string class_list      = dt.Rows[i]["class_list"].ToString();
                    int    new_channel_id  = model.channel_id;
                    string new_class_list  = model.class_list + class_list.Substring(class_list.IndexOf("," + category1 + ",")).TrimStart(',');
                    string new_class_layer = new_class_list.Trim(',').Split(',').Length.ToString();
                    if (i == 0)
                    {
                        bll.UpdateField(id, "channel_id=" + new_channel_id + ", parent_id=" + category2 + ", class_list='" + new_class_list + "',class_layer=" + new_class_layer);
                    }
                    else
                    {
                        bll.UpdateField(id, "channel_id=" + new_channel_id + ", class_list='" + new_class_list + "',class_layer=" + new_class_layer);
                    }
                }
            }

            new BLL.managers.manager_log().Add(adminInfo.id, adminInfo.user_name, OSEnums.ActionEnum.Edit.ToString(), "移动栏目:" + bll.GetModel(category1).title); //记录日志
            context.Response.Write("{\"status\": 1, \"msg\": \"栏目转移成功!\"}");
        }
Пример #4
0
        public void ProcessRequest(HttpContext context)
        {
            BLL.contents.article_category   bll   = new BLL.contents.article_category();
            Model.contents.article_category model = new Model.contents.article_category();
            int id   = OSRequest.GetQueryInt("id", -2);
            int type = OSRequest.GetQueryInt("type", -2);   //0上 ;1下

            model = bll.GetModel(id);
            DataTable dt_sx = bll.GetList(0, "parent_id=" + model.parent_id, "sort_id asc,id desc").Tables[0];

            if (dt_sx.Rows != null && dt_sx.Rows.Count > 0)
            {
                for (int i = 0; i < dt_sx.Rows.Count; i++)
                {
                    if (Convert.ToInt32(dt_sx.Rows[i]["ID"]) == id)
                    {
                        if (type == 1)
                        {
                            if ((i + 1) < dt_sx.Rows.Count)
                            {
                                int newId = Convert.ToInt32(dt_sx.Rows[i + 1]["ID"]);
                                //位置互换
                                bll.UpdateField(newId, "sort_id=" + model.sort_id + "");
                                bll.UpdateField(id, "sort_id=" + (bll.GetModel(newId).sort_id + 1) + "");
                                context.Response.Write("OK");
                            }
                            else
                            {
                                context.Response.Write("down");
                            }
                        }
                        else if (type == 0)
                        {
                            if ((i - 1) >= 0)
                            {
                                int newId = Convert.ToInt32(dt_sx.Rows[i - 1]["ID"]);
                                //位置互换
                                bll.UpdateField(newId, "sort_id=" + model.sort_id + "");
                                bll.UpdateField(id, "sort_id=" + (bll.GetModel(newId).sort_id - 1) + "");
                                context.Response.Write("OK");
                            }
                            else
                            {
                                context.Response.Write("up");
                            }
                        }
                        else
                        {
                            context.Response.Write("参数错误");
                        }
                    }
                }
            }
        }
Пример #5
0
        protected int get_channel_id()
        {
            int       strid = 1;
            DataTable dt    = bll.GetList(0, "parent_id=0", "id").Tables[0];

            if (dt.Rows != null && dt.Rows.Count > 0)
            {
                strid = dt.Rows.Count;
            }
            return(strid + 1);
        }
Пример #6
0
 public void ProcessRequest(HttpContext context)
 {
     BLL.contents.article_category bll = new BLL.contents.article_category();
     Model.contents.article_category model = new Model.contents.article_category();
     int id = OSRequest.GetQueryInt("id", -2);
     int type = OSRequest.GetQueryInt("type", -2);   //0上 ;1下
     model = bll.GetModel(id);
     DataTable dt_sx = bll.GetList(0, "parent_id=" + model.parent_id, "sort_id asc,id desc").Tables[0];
     if (dt_sx.Rows != null && dt_sx.Rows.Count > 0)
     {
         for (int i = 0; i < dt_sx.Rows.Count; i++)
         {
             if (Convert.ToInt32(dt_sx.Rows[i]["ID"]) == id)
             {
                 if (type == 1)
                 {
                     if ((i + 1) < dt_sx.Rows.Count)
                     {
                         int newId = Convert.ToInt32(dt_sx.Rows[i + 1]["ID"]);
                         //位置互换
                         bll.UpdateField(newId, "sort_id=" + model.sort_id + "");
                         bll.UpdateField(id, "sort_id=" + (bll.GetModel(newId).sort_id + 1) + "");
                         context.Response.Write("OK");
                     }
                     else
                     {
                         context.Response.Write("down");
                     }
                 }
                 else if (type == 0)
                 {
                     if ((i - 1) >= 0)
                     {
                         int newId = Convert.ToInt32(dt_sx.Rows[i - 1]["ID"]);
                         //位置互换
                         bll.UpdateField(newId, "sort_id=" + model.sort_id + "");
                         bll.UpdateField(id, "sort_id=" + (bll.GetModel(newId).sort_id - 1) + "");
                         context.Response.Write("OK");
                     }
                     else
                     {
                         context.Response.Write("up");
                     }
                 }
                 else
                 {
                     context.Response.Write("参数错误");
                 }
             }
         }
     }
 }
Пример #7
0
 protected string get_menu()
 {
     StringBuilder sb = new StringBuilder();
     BLL.contents.article_category bll = new BLL.contents.article_category();
     DataTable dt = bll.GetList(0, "parent_id=0 and is_lock=0", "sort_id asc,id desc").Tables[0];
     if (dt.Rows != null && dt.Rows.Count > 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             sb.Append("<li class=\"topMenuIco_" + (i + 1) + "\"><a href=\"Left.aspx?type=" + dt.Rows[i]["id"] + "\" target=\"leftFrame\">" + dt.Rows[i]["title"] + "</a></li>");
         }
     }
     return sb.ToString();
 }
Пример #8
0
        /// <summary>
        /// 获取菜单项
        /// </summary>
        /// <returns></returns>
        public static string GetMenuAndChildLstByFidAndId(int Fid, int id)
        {
            StringBuilder rStr = new StringBuilder();

            BLL.contents.article_category bll = new BLL.contents.article_category();
            //一级菜单
            DataTable dt = bll.GetList(-1, " parent_id=" + Fid + "   and  is_lock=0  and model_id<5 ", "sort_id").Tables[0];

            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string classStr = string.Empty;
                    if (id == Convert.ToInt32(dt.Rows[i]["id"]))
                    {
                        classStr = "class=\"changechild\"";
                    }
                    //二级菜单
                    DataTable dtChild = bll.GetLists(Convert.ToInt32(dt.Rows[i]["id"]), " parent_id=" + dt.Rows[i]["id"] + "  and  is_lock=0  and id not in(221,147,154,206,207,251,252,253,254,257) and   model_id<5");
                    if (dtChild.Rows.Count > 0)
                    {
                        rStr.Append(" <li " + classStr + "  id=\"child" + dt.Rows[i]["id"] + "\"> <div> <a><b>");
                        rStr.Append(dt.Rows[i]["title"]);
                        rStr.Append(" </b> <span class=\"arrow up\"></span></a></div>");
                        rStr.Append("<ul class=\"body_int_gk_li_div\" style=\"display: block;\">");
                    }
                    else
                    {
                        rStr.Append(" <li " + classStr + " id=\"child" + dt.Rows[i]["id"] + "\"> <a   href=\"" + dt.Rows[i]["link_url"] + "?id=" + dt.Rows[i]["id"] + "\">");
                        rStr.Append(dt.Rows[i]["title"]);
                        rStr.Append(" </a>");
                    }
                    int numChild = 1;
                    for (int ic = 0; ic < dtChild.Rows.Count; ic++)
                    {
                        rStr.Append("<li><a  id=\"child" + numChild + "\" href=\"" + dtChild.Rows[ic]["link_url"]);
                        rStr.Append("?id=" + dtChild.Rows[ic]["id"] + "\">" + dtChild.Rows[ic]["title"].ToString() + "</a></li>");
                        numChild++;
                    }
                    if (dtChild.Rows.Count > 0)
                    {
                        rStr.Append("</ul>");
                    }
                    rStr.Append("</li>");
                }
            }
            return(rStr.ToString());
        }
Пример #9
0
        protected string get_menu()
        {
            StringBuilder sb = new StringBuilder();

            BLL.contents.article_category bll = new BLL.contents.article_category();
            DataTable dt = bll.GetList(0, "parent_id=0 and is_lock=0", "sort_id asc,id desc").Tables[0];

            if (dt.Rows != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    sb.Append("<li class=\"topMenuIco_" + (i + 1) + "\"><a href=\"Left.aspx?type=" + dt.Rows[i]["id"] + "\" target=\"leftFrame\">" + dt.Rows[i]["title"] + "</a></li>");
                }
            }
            return(sb.ToString());
        }
Пример #10
0
 /// <summary>
 /// 第一级栏目ID
 public int ParentID(int category_id)
 {
     int _pid = 0;
     BLL.contents.article_category bll = new BLL.contents.article_category();
     DataTable dt = bll.GetList(0, "class_list like '%," + category_id + ",%'", "class_layer asc, sort_id asc,id desc").Tables[0];
     if (dt.Rows.Count > 0 && dt.Rows != null)
     {
         string _class_list = dt.Rows[0]["class_list"].ToString();
         string[] arr = _class_list.Replace(",1,", "").Trim(',').ToString().Split(',');
         if (arr.Length > 0)
         {
             _pid = Convert.ToInt32(arr[0]);
         }
     }
     return _pid;
 }
Пример #11
0
        /// <summary>
        //栏目样式调用
        public bool Style(int category_id1, int category_id2)
        {
            bool result = false;

            BLL.contents.article_category bll = new BLL.contents.article_category();
            DataTable dt = bll.GetList(0, "id=" + category_id2, "sort_id asc,id desc").Tables[0];

            if (dt.Rows.Count > 0 && dt.Rows != null)
            {
                string _class_list = dt.Rows[0]["class_list"].ToString();
                if (_class_list.IndexOf("," + category_id1 + ",") > 0)
                {
                    result = true;
                }
            }
            return(result);
        }
Пример #12
0
        /// <summary>
        /// 第一级栏目ID
        public int ParentID(int category_id)
        {
            int _pid = 0;

            BLL.contents.article_category bll = new BLL.contents.article_category();
            DataTable dt = bll.GetList(0, "class_list like '%," + category_id + ",%'", "class_layer asc, sort_id asc,id desc").Tables[0];

            if (dt.Rows.Count > 0 && dt.Rows != null)
            {
                string   _class_list = dt.Rows[0]["class_list"].ToString();
                string[] arr         = _class_list.Replace(",1,", "").Trim(',').ToString().Split(',');
                if (arr.Length > 0)
                {
                    _pid = Convert.ToInt32(arr[0]);
                }
            }
            return(_pid);
        }
Пример #13
0
 /// <summary>
 /// 返回面包屑
 public string ChannelMenu(int category_id,string _str)
 {
     StringBuilder sb = new StringBuilder();
     BLL.contents.article_category bll = new BLL.contents.article_category();
     DataTable dt = bll.GetList(0, "id=" + category_id, "sort_id asc,id desc").Tables[0];
     if (dt.Rows.Count > 0 && dt.Rows != null)
     {
         string _class_list = dt.Rows[0]["class_list"].ToString();
         string[] arr = _class_list.Replace(",1,", "").Trim(',').ToString().Split(',');
         if (arr.Length > 0)
         {
             for (int i = 0; i < arr.Length; i++)
             {
                 sb.Append("" + _str + "<a href=\"" + Url(Convert.ToInt32(arr[i])) + "\">" + bll.GetTitle(Convert.ToInt32(arr[i])) + "</a>");
             }
         }
     }
     return sb.ToString();
 }
Пример #14
0
        /// <summary>
        /// 获取菜单项
        /// </summary>
        /// <returns></returns>
        public static string GetMenuAndChildLst()
        {
            StringBuilder rStr = new StringBuilder();

            BLL.contents.article_category bll = new BLL.contents.article_category();
            //一级菜单
            DataTable dt = bll.GetList(-1, " parent_id=1   and  is_lock=0  and model_id<5 ", "sort_id").Tables[0];

            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    rStr.Append(" <li  id=\"menu" + dt.Rows[i]["id"] + "\"> <span  class=\"nav_span_f\"><a  href=\"" + dt.Rows[i]["link_url"] + "\">");
                    rStr.Append(dt.Rows[i]["title"]);
                    rStr.Append(" </span></a>");
                    //二级菜单
                    DataTable dtChild = bll.GetLists(Convert.ToInt32(dt.Rows[i]["id"]), " parent_id=" + dt.Rows[i]["id"] + "  and  is_lock=0  and id not in(96,97,121,122,128,129,130) and   model_id<5");
                    if (dtChild.Rows.Count > 0)
                    {
                        rStr.Append("<div>");
                    }
                    for (int ic = 0; ic < dtChild.Rows.Count; ic++)
                    {
                        if (dtChild.Rows[ic]["id"].ToString().Trim() == "167")
                        {
                            rStr.Append("<a  id=\"child" + dtChild.Rows[ic]["id"] + "\"  target=\"_blank\"  href=\"" + dtChild.Rows[ic]["link_url"]);
                        }
                        else
                        {
                            rStr.Append("<a  id=\"child" + dtChild.Rows[ic]["id"] + "\" href=\"" + dtChild.Rows[ic]["link_url"]);
                        }
                        rStr.Append("?id=" + dtChild.Rows[ic]["id"] + "\"><span>" + dtChild.Rows[ic]["title"].ToString() + "</span></a>");
                    }
                    if (dtChild.Rows.Count > 0)
                    {
                        rStr.Append("</div>");
                    }
                    rStr.Append("</li>");
                }
            }
            return(rStr.ToString());
        }
Пример #15
0
        protected string BindType()
        {
            StringBuilder sbr = new StringBuilder();

            sbr.Append(" <div class=\"subNav\">");
            sbr.Append("<ul>");
            DataTable dt = bll.GetList(0, "is_lock=0 and parent_id=" + type, "sort_id asc,id desc").Tables[0];

            if (dt.Rows != null && dt.Rows.Count > 0)
            {
                sbr.Append("<ul>");
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    sbr.Append("<li><span><img src=\"images/tu4.gif\" width=\"16px\" height=\"16px\"/></span><a href=\"" + dt.Rows[i]["link_url"] + "\" target=\"mainFrame\">" + dt.Rows[i]["title"] + "</a></li>");
                }
                sbr.Append("</ul>");
            }
            sbr.Append("</div>");
            return(sbr.ToString());
        }
Пример #16
0
        /// <summary>
        /// 返回面包屑
        public string ChannelMenu(int category_id, string _str)
        {
            StringBuilder sb = new StringBuilder();

            BLL.contents.article_category bll = new BLL.contents.article_category();
            DataTable dt = bll.GetList(0, "id=" + category_id, "sort_id asc,id desc").Tables[0];

            if (dt.Rows.Count > 0 && dt.Rows != null)
            {
                string   _class_list = dt.Rows[0]["class_list"].ToString();
                string[] arr         = _class_list.Replace(",1,", "").Trim(',').ToString().Split(',');
                if (arr.Length > 0)
                {
                    for (int i = 0; i < arr.Length; i++)
                    {
                        sb.Append("" + _str + "<a href=\"" + Url(Convert.ToInt32(arr[i])) + "\">" + bll.GetTitle(Convert.ToInt32(arr[i])) + "</a>");
                    }
                }
            }
            return(sb.ToString());
        }
Пример #17
0
 /// <summary>
 /// 获取菜单项
 /// </summary>
 /// <returns></returns>
 public static string GetMenuAndChildLst()
 {
     StringBuilder rStr = new StringBuilder();
     BLL.contents.article_category bll = new BLL.contents.article_category();
     //一级菜单
     DataTable dt = bll.GetList(-1, " parent_id=1   and  is_lock=0  and model_id<5 ", "sort_id").Tables[0];
     if (dt != null && dt.Rows.Count > 0) {
         for (int i = 0; i < dt.Rows.Count; i++) {
             rStr.Append(" <li  id=\"menu" + dt.Rows[i]["id"] + "\"> <span  class=\"nav_span_f\"><a  href=\"" + dt.Rows[i]["link_url"] + "\">");
             rStr.Append(dt.Rows[i]["title"]);
             rStr.Append(" </span></a>");
             //二级菜单
             DataTable dtChild = bll.GetLists(Convert.ToInt32(dt.Rows[i]["id"]), " parent_id=" + dt.Rows[i]["id"] + "  and  is_lock=0  and id not in(96,97,121,122,128,129,130) and   model_id<5");
             if (dtChild.Rows.Count > 0) {
                 rStr.Append("<div>");
             }
             for (int ic = 0; ic < dtChild.Rows.Count; ic++) {
                 if (dtChild.Rows[ic]["id"].ToString().Trim() == "167") {
                     rStr.Append("<a  id=\"child" + dtChild.Rows[ic]["id"] + "\"  target=\"_blank\"  href=\"" + dtChild.Rows[ic]["link_url"]);
                 }
                 else {
                     rStr.Append("<a  id=\"child" + dtChild.Rows[ic]["id"] + "\" href=\"" + dtChild.Rows[ic]["link_url"]);
                 }
                 rStr.Append("?id=" + dtChild.Rows[ic]["id"] + "\"><span>" + dtChild.Rows[ic]["title"].ToString() + "</span></a>");
             }
             if (dtChild.Rows.Count > 0) {
                 rStr.Append("</div>");
             }
             rStr.Append("</li>");
         }
     }
     return rStr.ToString();
 }
Пример #18
0
        private void TreeBind()
        {
            BLL.contents.article_category bll = new BLL.contents.article_category();
            DataTable dt = bll.GetList(0,"","sort_id asc,id desc").Tables[0];

            this.ddlParentId.Items.Clear();
            this.ddlParentId.Items.Add(new ListItem("无父级导航", "0"));
            foreach (DataRow dr in dt.Rows)
            {
                string Id = dr["id"].ToString();
                int ClassLayer = int.Parse(dr["class_layer"].ToString());
                string Title = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlParentId.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlParentId.Items.Add(new ListItem(Title, Id));
                }
            }
        }
Пример #19
0
        private void edit_category(HttpContext context)
        {
            //取得管理员登录信息
            Model.managers.manager adminInfo = new Web.UI.ManagePage().GetAdminInfo();
            if (adminInfo == null)
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"未登录或已超时,请重新登录!\"}");
                return;
            }

            int category1 = OSRequest.GetFormInt("Category1");
            int category2 = OSRequest.GetFormInt("Category2");
            if (category1 == category2)
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"移动目录跟目的目录不能相同!\"}");
                return;
            }

            BLL.contents.article_category bll = new BLL.contents.article_category();
            Model.contents.article_category model = bll.GetModel(category2);

            if (model.class_list.IndexOf("," + category1 + ",") > 0)
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"父级本不能向其子级转移!\"}");
                return;
            }

            if (bll.GetModel(category1).parent_id == category2)
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"移动目录已经在目的目录里!\"}");
                return;
            }

            DataTable dt = bll.GetList(0, "class_list like '%," + category1 + ",%'", "class_layer asc").Tables[0];
            if (dt.Rows != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    int id = Convert.ToInt32(dt.Rows[i]["id"]);
                    string class_list = dt.Rows[i]["class_list"].ToString();
                    int new_channel_id = model.channel_id;
                    string new_class_list = model.class_list + class_list.Substring(class_list.IndexOf("," + category1 + ",")).TrimStart(',');
                    string new_class_layer = new_class_list.Trim(',').Split(',').Length.ToString();
                    if (i == 0)
                    {
                        bll.UpdateField(id, "channel_id=" + new_channel_id + ", parent_id=" + category2 + ", class_list='" + new_class_list + "',class_layer=" + new_class_layer);
                    }
                    else
                    {
                        bll.UpdateField(id, "channel_id=" + new_channel_id + ", class_list='" + new_class_list + "',class_layer=" + new_class_layer);
                    }
                }
            }

            new BLL.managers.manager_log().Add(adminInfo.id, adminInfo.user_name, OSEnums.ActionEnum.Edit.ToString(), "移动栏目:" + bll.GetModel(category1).title); //记录日志
            context.Response.Write("{\"status\": 1, \"msg\": \"栏目转移成功!\"}");
        }
Пример #20
0
 /// <summary>
 //栏目样式调用
 public bool Style(int category_id1,int category_id2)
 {
     bool result = false;
     BLL.contents.article_category bll = new BLL.contents.article_category();
     DataTable dt = bll.GetList(0, "id="+category_id2, "sort_id asc,id desc").Tables[0];
     if (dt.Rows.Count > 0 && dt.Rows != null)
     {
         string  _class_list = dt.Rows[0]["class_list"].ToString();
         if(_class_list.IndexOf(","+category_id1+",")>0)
         {
             result = true;
         }
     }
     return result;
 }
Пример #21
0
 /// <summary>
 /// 栏目URL
 public string Url(int category_id)
 {
     string _url = string.Empty;
     BLL.contents.article_category bll = new BLL.contents.article_category();
     DataTable dt = bll.GetList(0, "class_list like '%," + category_id + ",%'", "class_layer desc, sort_id asc,id desc").Tables[0];
     if (dt.Rows.Count > 0 && dt.Rows != null)
     {
         if (!string.IsNullOrEmpty(dt.Rows[0]["link_url"].ToString()))
         {
             _url = dt.Rows[0]["link_url"].ToString();
         }
         else
         {
             if (bll.GetModel(category_id).model_id != 0)
             {
                 string _key1 = BasePage.pageUrl(bll.GetModel(category_id).model_id);
                 _url = new BasePage().linkurl(_key1, category_id);
             }
             else
             {
                 string _key = BasePage.pageUrl(Convert.ToInt32(dt.Rows[0]["model_id"]));
                 string _category_id = dt.Rows[0]["id"].ToString();
                 _url = new BasePage().linkurl(_key, _category_id);
             }
         }
     }
     return _url.ToString();
 }
Пример #22
0
        /// <summary>
        /// 获取菜单项
        /// </summary>
        /// <returns></returns>
        public static string GetMenuAndChildLstByFidAndId(int Fid, int id)
        {
            StringBuilder rStr = new StringBuilder();
            BLL.contents.article_category bll = new BLL.contents.article_category();
            //一级菜单
            DataTable dt = bll.GetList(-1, " parent_id=" + Fid + "   and  is_lock=0  and model_id<5 ", "sort_id").Tables[0];
            if (dt != null && dt.Rows.Count > 0) {
                for (int i = 0; i < dt.Rows.Count; i++) {
                    string classStr = string.Empty;
                    if (id == Convert.ToInt32(dt.Rows[i]["id"])) {
                        classStr = "class=\"changechild\"";
                    }
                    //二级菜单
                    DataTable dtChild = bll.GetLists(Convert.ToInt32(dt.Rows[i]["id"]), " parent_id=" + dt.Rows[i]["id"] + "  and  is_lock=0  and id not in(221,147,154,206,207,251,252,253,254,257) and   model_id<5");
                    if (dtChild.Rows.Count > 0) {

                        rStr.Append(" <li " + classStr + "  id=\"child" + dt.Rows[i]["id"] + "\"> <div> <a><b>");
                        rStr.Append(dt.Rows[i]["title"]);
                        rStr.Append(" </b> <span class=\"arrow up\"></span></a></div>");
                        rStr.Append("<ul class=\"body_int_gk_li_div\" style=\"display: block;\">");
                    }
                    else {
                        rStr.Append(" <li " + classStr + " id=\"child" + dt.Rows[i]["id"] + "\"> <a   href=\"" + dt.Rows[i]["link_url"] + "?id=" + dt.Rows[i]["id"] + "\">");
                        rStr.Append(dt.Rows[i]["title"]);
                        rStr.Append(" </a>");
                    }
                    int numChild = 1;
                    for (int ic = 0; ic < dtChild.Rows.Count; ic++) {
                        rStr.Append("<li><a  id=\"child" + numChild + "\" href=\"" + dtChild.Rows[ic]["link_url"]);
                        rStr.Append("?id=" + dtChild.Rows[ic]["id"] + "\">" + dtChild.Rows[ic]["title"].ToString() + "</a></li>");
                        numChild++;
                    }
                    if (dtChild.Rows.Count > 0) {
                        rStr.Append("</ul>");
                    }
                    rStr.Append("</li>");
                }
            }
            return rStr.ToString();
        }