Esempio n. 1
0
        private void GetModel()
        {
            BLL.article_category bll = new BLL.article_category();
            model = bll.GetModel(category_id);

            RepBindType.DataSource = bll.GetList(81, 11);
            RepBindType.DataBind();

            RepBindType2.DataSource = bll.GetList(81, 11);
            RepBindType2.DataBind();
        }
Esempio n. 2
0
        private void TreeBind(int _channel_id)
        {
            BLL.article_category bll = new BLL.article_category();
            DataTable            dt  = bll.GetList(0, _channel_id);

            this.ddlCategoryId.Items.Clear();
            this.ddlCategoryId.Items.Add(new ListItem("請選擇類別...", ""));
            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.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                }
            }

            cbMore.DataSource     = dt;
            cbMore.DataTextField  = "title";
            cbMore.DataValueField = "id";
            cbMore.DataBind();
        }
Esempio n. 3
0
        private void TreeBind(int _channel_id)
        {
            BLL.article_category bll = new BLL.article_category();
            DataTable            dt  = bll.GetList(0, _channel_id);

            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));
                }
            }
        }
Esempio n. 4
0
        private void TreeBind(int _channel_id)
        {
            BLL.article_category bll = new BLL.article_category();
            DataTable dt = bll.GetList(0, _channel_id);

            this.ddlCategoryId.Items.Clear();
            this.ddlCategoryId.Items.Add(new ListItem("所有类别", ""));
            this.ddlMoveId.Items.Clear();
            this.ddlMoveId.Items.Add(new ListItem("批量移动...", ""));
            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.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                    this.ddlMoveId.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                    this.ddlMoveId.Items.Add(new ListItem(Title, Id));
                }
            }
        }
Esempio n. 5
0
 //数据绑定
 private void RptBind()
 {
     BLL.article_category bll = new BLL.article_category();
     DataTable dt = bll.GetList(0, this.channel_id);
     this.rptList.DataSource = dt;
     this.rptList.DataBind();
 }
Esempio n. 6
0
        private void TreeBind(int _channel_id)
        {
            //根据当前用户类别进行筛选
            var manager  = GetAdminInfo();
            var strWhere = "";

            BLL.article_category bll = new BLL.article_category();
            DataTable            dt  = bll.GetList(0, _channel_id, strWhere);

            this.ddlCategoryId.Items.Clear();
            this.ddlCategoryId.Items.Add(new ListItem("请选择类别...", ""));
            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.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                }
            }
        }
Esempio n. 7
0
        protected void TreeBind()
        {
            BLL.article_category bll = new BLL.article_category();
            DataTable            dt  = bll.GetList(0, 6);

            this.ddlCategoryId.Items.Clear();
            this.ddlCategoryId.Items.Add(new ListItem("所有产品", ""));
            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.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                }
            }
        }
Esempio n. 8
0
        //数据绑定
        private void RptBind()
        {
            BLL.article_category bll = new BLL.article_category();
            string strWhere          = string.Empty;

            //获取管理员
            Model.manager adminModel = GetAdminInfo();
            if (adminModel.role_type != 1)
            {
                List <int> idlist = new List <int>();
                //获取频道名称
                string channel_name = new BLL.channel().GetChannelName(this.channel_id);
                //获取权限列表
                string    nav_name = "channel_" + channel_name + "_category_";
                DataTable dt2      = new BLL.manager_role_value().GetList(0, string.Format("role_id={0} and action_type='Show' and nav_name like '{1}%'", adminModel.role_id, nav_name), "").Tables[0];
                if (dt2.Rows.Count > 0)
                {
                    foreach (DataRow dr in dt2.Rows)
                    {
                        idlist.Add(int.Parse(dr["nav_name"].ToString().Replace(nav_name, string.Empty)));
                    }
                }
                else
                {
                    idlist.Add(0);
                }
                strWhere = string.Format("id in ({0})", string.Join(",", idlist));
            }
            DataTable dt = bll.GetList(0, this.channel_id, strWhere);

            this.rptList.DataSource = dt;
            this.rptList.DataBind();
        }
Esempio n. 9
0
        private void TreeBind()
        {
            Model.wx_userweixin  weixin = GetWeiXinCode();
            BLL.article_category bll    = new BLL.article_category();
            DataTable            dt     = bll.GetList(" wid=" + weixin.id);

            //最新车讯
            this.ddlZxcx.Items.Clear();
            this.ddlZxcx.Items.Add(new ListItem("请选择最新车讯...", ""));
            foreach (DataRow dr in dt.Rows)
            {
                string Id    = dr["id"].ToString();
                string Title = dr["title"].ToString().Trim();
                this.ddlZxcx.Items.Add(new ListItem(Title, Id));
            }
            //最新优惠
            this.ddlZxyh.Items.Clear();
            this.ddlZxyh.Items.Add(new ListItem("请选择最新优惠...", ""));
            foreach (DataRow dr in dt.Rows)
            {
                string Id    = dr["id"].ToString();
                string Title = dr["title"].ToString().Trim();
                this.ddlZxyh.Items.Add(new ListItem(Title, Id));
            }
            //尊享二手车
            this.ddlEsc.Items.Clear();
            this.ddlEsc.Items.Add(new ListItem("请选择二手车...", ""));
            foreach (DataRow dr in dt.Rows)
            {
                string Id    = dr["id"].ToString();
                string Title = dr["title"].ToString().Trim();
                this.ddlEsc.Items.Add(new ListItem(Title, Id));
            }

            //品牌相册
            BLL.wx_albums_info aiBll = new BLL.wx_albums_info();
            DataTable          aidt  = aiBll.GetList(" wid=" + weixin.id).Tables[0];

            this.ddlPpxc.Items.Clear();
            this.ddlPpxc.Items.Add(new ListItem("请选择品牌相册...", ""));
            foreach (DataRow dr in aidt.Rows)
            {
                string Id    = dr["id"].ToString();
                string Title = dr["aname"].ToString().Trim();
                this.ddlPpxc.Items.Add(new ListItem(Title, Id));
            }

            //LBS
            BLL.wx_lbs_shopInfo lbsBll = new BLL.wx_lbs_shopInfo();
            DataTable           lbsdt  = lbsBll.GetList(" wid=" + weixin.id).Tables[0];

            this.ddlLbs.Items.Clear();
            this.ddlLbs.Items.Add(new ListItem("请选择LBS...", ""));
            foreach (DataRow dr in lbsdt.Rows)
            {
                string Id    = dr["id"].ToString();
                string Title = dr["shopName"].ToString().Trim();
                this.ddlLbs.Items.Add(new ListItem(Title, Id));
            }
        }
Esempio n. 10
0
        private void PPTreeBind()
        {
            BLL.article_category bll = new BLL.article_category();
            DataTable            dt  = bll.GetList(0, 6);

            this.ddlvote_id.Items.Clear();
            this.ddlvote_id.Items.Add(new ListItem("请选择商品品牌..", ""));
            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.ddlvote_id.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlvote_id.Items.Add(new ListItem(Title, Id));
                }
            }
            div_sppp.Visible = true;
        }
Esempio n. 11
0
        //数据绑定
        private void RptBind()
        {
            BLL.article_category bll = new BLL.article_category();
            DataTable            dt  = bll.GetList(0, this.channel_id);

            this.rptList.DataSource = dt;
            this.rptList.DataBind();
        }
Esempio n. 12
0
        private void get_prop_page(HttpContext context)
        {
            try
            {
                StringBuilder strhtml  = new StringBuilder();
                int           category = DTRequest.GetFormInt("category", 0);
                int           page     = DTRequest.GetFormInt("page", 1);

                BLL.property       pro       = new BLL.property();
                BLL.property_value pro_value = new BLL.property_value();

                BLL.article_category catgory = new BLL.article_category();
                string    category_ids       = "";
                DataTable dt_pro             = null;
                if (category == 0)
                {
                    dt_pro = pro.GetList("").Tables[0];
                }
                else
                {
                    DataTable cat_dt = catgory.GetList(0, 2, category.ToString());//查找类别下的所有类别
                    if (cat_dt.Rows.Count > 0)
                    {
                        for (int i = 0; i < cat_dt.Rows.Count; i++)
                        {
                            category_ids += cat_dt.Rows[i][0].ToString() + ",";
                        }
                        category_ids = category_ids.Substring(0, category_ids.Length - 1);
                    }
                    dt_pro = pro.GetList("category_id in(" + category_ids + ")").Tables[0];
                }
                if (dt_pro.Rows.Count > 0)
                {
                    for (int i = 0; i < dt_pro.Rows.Count; i++)
                    {
                        strhtml.Append("<dl>");
                        strhtml.Append("<dt>" + dt_pro.Rows[i]["title"] + "</dt>");
                        DataTable dt_pro_value = pro_value.GetList("property_id='" + dt_pro.Rows[i][0] + "'").Tables[0];
                        if (dt_pro_value.Rows.Count > 0)
                        {
                            for (int j = 0; j < dt_pro_value.Rows.Count; j++)
                            {
                                strhtml.Append("<dd><a style=\"cursor:pointer;\" onclick='getpagedata(" + dt_pro_value.Rows[j][0] + "," + category + "," + page + ")'>" + dt_pro_value.Rows[j]["value"] + "</a><span></span></dd>");
                            }
                        }
                        strhtml.Append("</dl>");
                    }
                    context.Response.Write("{ \"info\":\"获取数据成功!\", \"status\":\"1\" ,\"html\":\"" + myJson.String2Json(strhtml.ToString()) + "\",\"pagelist\":\"\"}");
                    return;
                }
                context.Response.Write("{ \"info\":\"该类别暂未添加属性!\", \"status\":\"0\" }");
            }
            catch (Exception ex)
            {
                context.Response.Write("{ \"info\":\"该类别暂未添加属性!\", \"status\":\"0\" }");
                return;
            }
        }
Esempio n. 13
0
        private void TreeBind(int _channel_id, out string return_term)
        {
            BLL.article_category bll = new BLL.article_category();
            return_term = string.Empty;
            string strWhere = string.Empty;

            //获取管理员
            Model.manager adminModel = GetAdminInfo();
            if (adminModel.role_type != 1)
            {
                List <int> idlist = new List <int>();
                //获取频道名称
                string channel_name = new BLL.channel().GetChannelName(this.channel_id);
                //获取权限列表
                string    nav_name = "channel_" + channel_name + "_category_";
                DataTable dt2      = new BLL.manager_role_value().GetList(0, string.Format("role_id={0} and action_type='Show' and nav_name like '{1}%'", adminModel.role_id, nav_name), "").Tables[0];
                if (dt2.Rows.Count > 0)
                {
                    foreach (DataRow dr in dt2.Rows)
                    {
                        idlist.Add(int.Parse(dr["nav_name"].ToString().Replace(nav_name, string.Empty)));
                    }
                }
                else
                {
                    idlist.Add(0);
                }
                return_term = string.Join(",", idlist);
                strWhere    = string.Format("id in ({0})", return_term);
            }
            DataTable dt = bll.GetList(0, this.channel_id, strWhere);

            this.ddlCategoryId.Items.Clear();
            this.ddlCategoryId.Items.Add(new ListItem("所有类别", ""));
            this.ddlMoveId.Items.Clear();
            this.ddlMoveId.Items.Add(new ListItem("批量移动...", ""));
            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.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                    this.ddlMoveId.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                    this.ddlMoveId.Items.Add(new ListItem(Title, Id));
                }
            }
        }
Esempio n. 14
0
        //数据绑定
        private void RptBind()
        {
            var manager  = GetAdminInfo();
            var strWhere = "";

            BLL.article_category bll = new BLL.article_category();
            DataTable            dt  = bll.GetList(0, this.channel_id, strWhere);

            this.rptList.DataSource = dt;
            this.rptList.DataBind();
        }
Esempio n. 15
0
        //#region 角色类型=================================
        //private void RoleBind(DropDownList ddl, int role_type)
        //{
        //    BLL.activity bll = new BLL.activity();
        //    DataTable dt = bll.GetList("").Tables[0];

        //    ddl.Items.Clear();
        //    ddl.Items.Add(new ListItem("请选择活动...", ""));
        //    foreach (DataRow dr in dt.Rows)
        //    {
        //        if (ddl.Items.Contains(dr["type"] as ListItem))
        //        {
        //            ddl.Items.Add(new ListItem(dr["remark"].ToString(), dr["type"].ToString()));
        //        }
        //    }
        //    ddl.Items.Add(new ListItem("自定义活动", "0"));
        //}
        //#endregion

        //#region 绑定商品类别=================================
        private void WineryBind(CheckBoxList ckBox)
        {
            BLL.article_category bll = new BLL.article_category();
            DataTable            dt  = bll.GetList(0, 2);

            ckBox.Items.Clear();
            foreach (DataRow dr in dt.Rows)
            {
                ckBox.Items.Add(new ListItem(dr["title"].ToString(), dr["id"].ToString()));
            }
        }
Esempio n. 16
0
        public string getGoodsTypelist(int channel_id)
        {
            //select * from dbo.dt_article_category where channel_id = 2

            BLL.article_category art = new BLL.article_category();
            var info = art.GetList(0, channel_id);

            // Vincent._Json json = new _Json();

            //return Convert.ToBase64String(Encoding.UTF8.GetBytes(CreateJsonParameters(info.Tables[0])));
            return(CreateJsonParameters1(info));
        }
Esempio n. 17
0
        //嵌套绑定
        protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            BLL.article_category bll = new BLL.article_category();

            if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
            {
                DropDownList dropDownList0 = (DropDownList)e.Item.FindControl("dropDownList0");
                DropDownList dropDownList1 = (DropDownList)e.Item.FindControl("dropDownList1");
                DropDownList dropDownList2 = (DropDownList)e.Item.FindControl("dropDownList2");
                TextBox      txtStart      = (TextBox)e.Item.FindControl("txtStart");
                TextBox      txtEnd        = (TextBox)e.Item.FindControl("txtEnd");

                txtStart.Text = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd HH:mm:ss");
                txtEnd.Text   = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                //找到分类Repeater关联的数据项
                DataRowView drv = (DataRowView)e.Item.DataItem;
                //提取站点ID
                int _channel_id = Convert.ToInt32(drv["id"]);
                //绑定分类
                DataTable dt = bll.GetList(0, _channel_id);

                dropDownList0.Items.Clear();
                dropDownList0.Items.Add(new ListItem("全部", "0"));
                dropDownList1.Items.Clear();
                dropDownList1.Items.Add(new ListItem("全部", "0"));
                dropDownList2.Items.Clear();
                dropDownList2.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)
                    {
                        dropDownList0.Items.Add(new ListItem(Title, Id));
                        dropDownList1.Items.Add(new ListItem(Title, Id));
                        dropDownList2.Items.Add(new ListItem(Title, Id));
                    }
                    else
                    {
                        Title = "├ " + Title;
                        Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                        dropDownList0.Items.Add(new ListItem(Title, Id));
                        dropDownList1.Items.Add(new ListItem(Title, Id));
                        dropDownList2.Items.Add(new ListItem(Title, Id));
                    }
                }
            }
        }
Esempio n. 18
0
        /// <summary>
        /// 返回频道下所有的文章列表URL地址
        /// </summary>
        ///  <param name="lang">频道分类</param>
        /// <param name="channelname">频道Name</param>
        /// <returns>返回频道下所有的文章列表URL地址</returns>
        private string GetArticleUrlList(string lang, string channelname, string page, string pattern, string path, string querystring, int pagesize)
        {
            StringBuilder sburl = new StringBuilder();
            DataTable     dt    = objarticle_category.GetList(0, channelname);

            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    int strLength = 0;
                    if (!string.IsNullOrEmpty(querystring))
                    {
                        strLength = querystring.Split('&').Length;
                    }

                    int totalCount = objarticle.GetCount(channelname, Convert.ToInt32(dt.Rows[i]["id"].ToString()), 0, "");
                    int pageindex  = GetPageSize(totalCount, pagesize);
                    if (strLength == 1)
                    {
                        pageindex = 1;
                    }
                    for (int q = 1; q <= pageindex; q++)
                    {
                        string querystr    = Regex.Replace(string.Format(path, dt.Rows[i]["id"].ToString(), q), pattern, querystring, RegexOptions.None | RegexOptions.IgnoreCase);
                        string linkurl     = string.Format("{0}/{1}/{2}?{3}", PLKeys.DIRECTORY_REWRITE_ASPX, lang, page, querystr);
                        string HTMLPattern = string.Format("{0}/{1}/{2}", PLKeys.DIRECTORY_REWRITE_HTML, lang, Utils.GetUrlExtension(string.Format(path, dt.Rows[i]["id"].ToString(), q), config.staticextension)); //替换扩展名
                        if (!string.IsNullOrEmpty(sburl.ToString()))
                        {
                            sburl.Append(",");
                        }
                        sburl.AppendFormat(urlstr, config.webpath, lang, linkurl.Replace("&", "^"), HTMLPattern);
                    }
                }
            }

            return(sburl.ToString());
        }
Esempio n. 19
0
        /// <summary>
        /// 取频道下的分类
        /// </summary>
        public DataTable CategoryListByChannelName()
        {
            Tag tag = this.Document.CurrentRenderingTag;

            var attribute = tag.Attributes["channel_name"];

            string channel_name = attribute.Text;

            //--=====begin: 将这个频道下的所有分类的基本信息 ====--
            BLL.article_category cateDal = new BLL.article_category();
            DataTable            dt      = cateDal.GetList(0, channel_name);

            return(dt);
            //--=====end: 将这个频道下的所有分类的基本信息 ====--
        }
 private void SetCategory()
 {
     if (!String.IsNullOrEmpty(this.navigation_name))
     {
         BLL.article_category bll = new BLL.article_category();
         DataTable            dt  = bll.GetList(0, this.channel_id);
         foreach (DataRow dr in dt.Rows)
         {
             if (this.navigation_name.Equals(dr["call_index"].ToString()))
             {
                 this.category_id = Utils.StrToInt(dr["id"].ToString(), 0);
                 break;
             }
         }
     }
 }
Esempio n. 21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            wid    = MXRequest.GetQueryInt("wid");
            openid = MXRequest.GetQueryString("openid");
            if (!IsPostBack)
            {
                BLL.wx_wq_wzlx   wzBll   = new BLL.wx_wq_wzlx();
                Model.wx_wq_wzlx wzModel = wzBll.GetModelList("wid=" + wid)[0];

                BLL.article_category acBll = new BLL.article_category();
                DataTable            ds    = acBll.GetList(" wid=" + wid + " and id=" + wzModel.cxid);
                if (ds.Rows.Count > 0)
                {
                    acModel = acBll.GetModel(MyCommFun.Obj2Int(wzModel.cxid));
                }

                BLL.article aBll = new BLL.article();
                this.rptList.DataSource = aBll.GetList(" category_id=" + acModel.id);
                this.rptList.DataBind();
            }
        }
Esempio n. 22
0
        private void get_category_list(HttpContext context)
        {
            BLL.article_category bll = new BLL.article_category();
            DataTable dt = bll.GetList(0, 2);
            string ret_str = "<option value=''>请选择类别...</option>";
            if (dt != null && dt.Rows.Count > 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.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                        ret_str += "<option value='" + Id + "'>" + Title + "</option>";
                    }
                    else
                    {
                        Title = "├ " + Title;
                        Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                        //this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                        ret_str += "<option value='" + Id + "'>" + Title + "</option>";
                    }
                }
            }

            context.Response.Write(ret_str);
            return;
        }
Esempio n. 23
0
        /// <summary>
        /// 导航区域绑定
        /// </summary>
        protected void BindNav()
        {
            StringBuilder strnav = new StringBuilder();
            BLL.article_category bll = new BLL.article_category();
            DataTable dtCategory = bll.GetList(0, 2);
            if (dtCategory != null && dtCategory.Rows.Count > 0)
            {
                //一级类目
                DataRow[] drFirsts = dtCategory.Select(" parent_id=0 ");
                foreach (DataRow dr in drFirsts)
                {
                    strnav.Append(@"<li class='mod_cate'>");
                    strnav.Append("<h2><a href='#'>" + dr["title"].ToString() + "</a></h2>");
                    DataRow[] drRems = dtCategory.Select(" class_list like '%," + dr["id"].ToString() + ",%' and IsRecommended='1' ");
                    if (drRems != null && drRems.Length > 0)
                    {
                        strnav.Append("<p class='mod_cate_r'>");
                        foreach (DataRow drRem in drRems)
                        {
                            strnav.Append("<a href='#'>"+drRem["title"].ToString()+"</a>");
                        }
                        strnav.Append("</p>");
                    }
                    //推荐类目绑定
                    //<p class="mod_cate_r"><a href="#">计算器</a><a href="#">文件夹</a><a href="#">文件柜</a><a href="#">推荐类目</a></p>
                    strnav.Append(@"<div class='mod_subcate'>");
                    strnav.Append(" <div class='mod_subcate_main'>");
                    strnav.Append(" <div class='inBox'>");
                    strnav.Append(" <div class='inHd'>");
                    strnav.Append("  <ul>");
                    //二级类目绑定
                    //二级类目查找
                    DataRow[] drSeconds = dtCategory.Select(" class_list like '%," + dr["id"].ToString() + ",%' and class_layer=2 ");
                    if (drSeconds != null && drSeconds.Length > 0)
                    {
                        foreach (DataRow drSecond in drSeconds)
                        {
                            strnav.Append("<li>");
                            //<span class='s-m1'></span>
                            strnav.Append("  <a href='#'><img src='" + drSecond["img_url"].ToString() + "' width='30px' height='30px'  ></img>" + drSecond["title"].ToString() + "</a>");
                            strnav.Append(" </li>");

                        }
                        strnav.Append("</ul>");
                        //活动内容待添加
                        strnav.Append(" </div>");
                        strnav.Append("  <div class='inBd'> ");
                        strnav.Append("   <ul> ");
                        int i = 0;
                        foreach (DataRow drSecond in drSeconds)
                        {
                            DataRow[] drThirds = dtCategory.Select(" class_list like '%," + drSecond["id"].ToString() + ",%' and class_layer=3 ");
                            if (drThirds != null && drThirds.Length > 0)
                            {

                                foreach (DataRow drThird in drThirds)
                                {
                                    if (i < 24)
                                    {
                                        strnav.Append("<li>");
                                        strnav.Append("<div class='pic'>");
                                        strnav.Append(" <a href='#'>");
                                        strnav.Append("  <img src='" + drThird["img_url"].ToString() + "'  width='90px' height='90px'/></a>");
                                        strnav.Append(" </div>");
                                        strnav.Append("     <div class='title'><a href='#'>" + drThird["title"].ToString() + "</a></div>");
                                        strnav.Append("</li>");
                                    }
                                    i++;
                                }

                            }
                        }

                        strnav.Append("</ul>");
                        strnav.Append(" </div>");
                        strnav.Append(" </div>");
                        strnav.Append(" </div>");
                        strnav.Append(" </li>");
                    }
                }
            }

            ltNav.Text = strnav.ToString();
        }
Esempio n. 24
0
 private void BindCaseType()
 {
     BLL.article_category bll = new BLL.article_category();
     RepBindProType.DataSource = bll.GetList(0, 7);
     RepBindProType.DataBind();
 }
Esempio n. 25
0
        /// <summary>
        /// 返回频道下所有的文章列表URL地址
        /// </summary>
        ///  <param name="lang">频道分类</param>
        /// <param name="channelname">频道Name</param>
        /// <returns>返回频道下所有的文章列表URL地址</returns>
        private string GetArticleUrlList(string lang, string channelname, string page, string pattern, string path, string querystring, int pagesize)
        {
            StringBuilder sburl       = new StringBuilder();
            int           hanld       = DTRequest.GetQueryInt("hanld");
            int           category_id = 0;

            if (hanld == 3)
            {
                category_id = DTRequest.GetQueryInt("lst");
            }
            DataTable dt = objarticle_category.GetList(category_id, channelname);

            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    int strLength = 0;
                    if (!string.IsNullOrEmpty(querystring))
                    {
                        strLength = querystring.IndexOf("page");
                    }
                    int totalCount = objarticle.ArticleCount(channelname, Convert.ToInt32(dt.Rows[i]["id"].ToString()), "");
                    int pageindex  = GetPageSize(totalCount, pagesize);
                    if (strLength < 0)
                    {
                        pageindex = 1;
                    }
                    bool status = false;
                    if (querystring.IndexOf("call_index") > -1)
                    {
                        status = true;
                    }
                    for (int q = 1; q <= pageindex; q++)
                    {
                        string strvalue = dt.Rows[i]["call_index"].ToString();
                        if (status)
                        {
                            if (string.IsNullOrWhiteSpace(strvalue))
                            {
                                continue;
                            }
                        }
                        else if (!string.IsNullOrWhiteSpace(strvalue))
                        {
                            continue;
                        }
                        else
                        {
                            strvalue = dt.Rows[i]["id"].ToString();
                        }
                        string querystr    = Regex.Replace(string.Format(path, strvalue, q), pattern, querystring, RegexOptions.None | RegexOptions.IgnoreCase);
                        string linkurl     = string.Format("{0}/{1}/{2}?{3}", DTKeys.DIRECTORY_REWRITE_MVC, lang, page, querystr);
                        string HTMLPattern = string.Format("{0}/{1}/{2}", DTKeys.DIRECTORY_REWRITE_HTML, lang, Utils.GetUrlExtension(string.Format(path, strvalue, q), config.staticextension)); //替换扩展名
                        if (!string.IsNullOrEmpty(sburl.ToString()))
                        {
                            sburl.Append(",");
                        }
                        sburl.AppendFormat(urlstr, config.webpath, lang, linkurl.Replace("&", "^"), HTMLPattern);
                    }
                }
            }

            return(sburl.ToString());
        }
Esempio n. 26
0
        private void get_prop_page(HttpContext context)
        {
            try
            {
                StringBuilder strhtml = new StringBuilder();
                int category = DTRequest.GetFormInt("category", 0);
                int page = DTRequest.GetFormInt("page", 1);

                BLL.property pro = new BLL.property();
                BLL.property_value pro_value = new BLL.property_value();

                BLL.article_category catgory = new BLL.article_category();
                string category_ids = "";
                DataTable dt_pro = null;
                if (category == 0)
                    dt_pro = pro.GetList("").Tables[0];
                else
                {
                    DataTable cat_dt = catgory.GetList(0, 2, category.ToString());//查找类别下的所有类别
                    if (cat_dt.Rows.Count > 0)
                    {
                        for (int i = 0; i < cat_dt.Rows.Count; i++)
                        {
                            category_ids += cat_dt.Rows[i][0].ToString() + ",";
                        }
                        category_ids = category_ids.Substring(0, category_ids.Length - 1);
                    }
                    dt_pro = pro.GetList("category_id in(" + category_ids + ")").Tables[0];
                }
                if (dt_pro.Rows.Count > 0)
                {
                    for (int i = 0; i < dt_pro.Rows.Count; i++)
                    {
                        strhtml.Append("<dl>");
                        strhtml.Append("<dt>" + dt_pro.Rows[i]["title"] + "</dt>");
                        DataTable dt_pro_value = pro_value.GetList("property_id='" + dt_pro.Rows[i][0] + "'").Tables[0];
                        if (dt_pro_value.Rows.Count > 0)
                        {
                            for (int j = 0; j < dt_pro_value.Rows.Count; j++)
                            {
                                strhtml.Append("<dd><a style=\"cursor:pointer;\" onclick='getpagedata(" + dt_pro_value.Rows[j][0] + "," + category + "," + page + ")'>" + dt_pro_value.Rows[j]["value"] + "</a><span></span></dd>");
                            }
                        }
                        strhtml.Append("</dl>");
                    }
                    context.Response.Write("{ \"info\":\"获取数据成功!\", \"status\":\"1\" ,\"html\":\"" + myJson.String2Json(strhtml.ToString()) + "\",\"pagelist\":\"\"}");
                    return;
                }
                context.Response.Write("{ \"info\":\"该类别暂未添加属性!\", \"status\":\"0\" }");
            }
            catch (Exception ex)
            {
                context.Response.Write("{ \"info\":\"该类别暂未添加属性!\", \"status\":\"0\" }");
                return;
            }
        }
Esempio n. 27
0
 private void get_category(HttpContext context)
 {
     int parent_category = DTRequest.GetQueryInt("category_id");
     BLL.article_category bll = new BLL.article_category();
     DataTable dt = bll.GetList(parent_category, "goods");
     if (dt != null && dt.Rows.Count > 0)
     {
         context.Response.Write(myJson.getJson(dt));
         return;
     }
     else
     {
         context.Response.Write("Null");
         return;
     }
 }
Esempio n. 28
0
 private void BindMenu()
 {
     BLL.article_category bll = new BLL.article_category();
     RepMenuList.DataSource = bll.GetList(0, 7);
     RepMenuList.DataBind();
 }
Esempio n. 29
0
        /// <summary>
        /// 导航区域绑定
        /// </summary>
        protected void BindNav()
        {
            StringBuilder strnav = new StringBuilder();

            BLL.article_category bll        = new BLL.article_category();
            DataTable            dtCategory = bll.GetList(0, 2);

            if (dtCategory != null && dtCategory.Rows.Count > 0)
            {
                //一级类目
                DataRow[] drFirsts = dtCategory.Select(" parent_id=0 ");
                foreach (DataRow dr in drFirsts)
                {
                    strnav.Append(@"<li class='mod_cate'>");
                    strnav.Append("<h2><a href='#'>" + dr["title"].ToString() + "</a></h2>");
                    DataRow[] drRems = dtCategory.Select(" class_list like '%," + dr["id"].ToString() + ",%' and IsRecommended='1' ");
                    if (drRems != null && drRems.Length > 0)
                    {
                        strnav.Append("<p class='mod_cate_r'>");
                        foreach (DataRow drRem in drRems)
                        {
                            strnav.Append("<a href='#'>" + drRem["title"].ToString() + "</a>");
                        }
                        strnav.Append("</p>");
                    }
                    //推荐类目绑定
                    //<p class="mod_cate_r"><a href="#">计算器</a><a href="#">文件夹</a><a href="#">文件柜</a><a href="#">推荐类目</a></p>
                    strnav.Append(@"<div class='mod_subcate'>");
                    strnav.Append(" <div class='mod_subcate_main'>");
                    strnav.Append(" <div class='inBox'>");
                    strnav.Append(" <div class='inHd'>");
                    strnav.Append("  <ul>");
                    //二级类目绑定
                    //二级类目查找
                    DataRow[] drSeconds = dtCategory.Select(" class_list like '%," + dr["id"].ToString() + ",%' and class_layer=2 ");
                    if (drSeconds != null && drSeconds.Length > 0)
                    {
                        foreach (DataRow drSecond in drSeconds)
                        {
                            strnav.Append("<li>");
                            //<span class='s-m1'></span>
                            strnav.Append("  <a href='#'><img src='" + drSecond["img_url"].ToString() + "' width='30px' height='30px'  ></img>" + drSecond["title"].ToString() + "</a>");
                            strnav.Append(" </li>");
                        }
                        strnav.Append("</ul>");
                        //活动内容待添加
                        strnav.Append(" </div>");
                        strnav.Append("  <div class='inBd'> ");
                        strnav.Append("   <ul> ");
                        int i = 0;
                        foreach (DataRow drSecond in drSeconds)
                        {
                            DataRow[] drThirds = dtCategory.Select(" class_list like '%," + drSecond["id"].ToString() + ",%' and class_layer=3 ");
                            if (drThirds != null && drThirds.Length > 0)
                            {
                                foreach (DataRow drThird in drThirds)
                                {
                                    if (i < 24)
                                    {
                                        strnav.Append("<li>");
                                        strnav.Append("<div class='pic'>");
                                        strnav.Append(" <a href='#'>");
                                        strnav.Append("  <img src='" + drThird["img_url"].ToString() + "'  width='90px' height='90px'/></a>");
                                        strnav.Append(" </div>");
                                        strnav.Append("     <div class='title'><a href='#'>" + drThird["title"].ToString() + "</a></div>");
                                        strnav.Append("</li>");
                                    }
                                    i++;
                                }
                            }
                        }

                        strnav.Append("</ul>");
                        strnav.Append(" </div>");
                        strnav.Append(" </div>");
                        strnav.Append(" </div>");
                        strnav.Append(" </li>");
                    }
                }
            }

            ltNav.Text = strnav.ToString();
        }
Esempio n. 30
0
        /// <summary>
        /// 取频道下的分类
        /// </summary>
        public DataTable CategoryListByChannelName()
        {
            Tag tag = this.Document.CurrentRenderingTag;

            var attribute = tag.Attributes["channel_name"];

            string channel_name = attribute.Text;

            //--=====begin: 将这个频道下的所有分类的基本信息 ====--
            BLL.article_category cateDal = new BLL.article_category();
            DataTable dt = cateDal.GetList(0, channel_name);
            return dt;
            //--=====end: 将这个频道下的所有分类的基本信息 ====--
        }