Пример #1
0
 private bool DoEdit(int _id)
 {
     try
     {
         Rain.BLL.article_category   articleCategory = new Rain.BLL.article_category();
         Rain.Model.article_category model           = articleCategory.GetModel(_id);
         int num = int.Parse(this.ddlParentId.SelectedValue);
         model.channel_id = this.channel_id;
         model.call_index = this.txtCallIndex.Text.Trim();
         model.title      = this.txtTitle.Text.Trim();
         if (num != model.id)
         {
             model.parent_id = num;
         }
         model.sort_id         = int.Parse(this.txtSortId.Text.Trim());
         model.seo_title       = this.txtSeoTitle.Text;
         model.seo_keywords    = this.txtSeoKeywords.Text;
         model.seo_description = this.txtSeoDescription.Text;
         model.link_url        = this.txtLinkUrl.Text.Trim();
         model.img_url         = this.txtImgUrl.Text.Trim();
         model.content         = this.txtContent.Value;
         if (articleCategory.Update(model))
         {
             this.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改" + this.channel_name + "频道栏目分类:" + model.title);
             return(true);
         }
     }
     catch
     {
         return(false);
     }
     return(false);
 }
Пример #2
0
 protected string get_category_title(int category_id, string default_value)
 {
     Rain.BLL.article_category articleCategory = new Rain.BLL.article_category();
     if (articleCategory.Exists(category_id))
     {
         return(articleCategory.GetTitle(category_id));
     }
     return(default_value);
 }
Пример #3
0
        private void LoopChannelMenu(StringBuilder strTxt, string urlKey, int category_id)
        {
            Rain.BLL.article_category articleCategory = new Rain.BLL.article_category();
            int parentId = articleCategory.GetParentId(category_id);

            if (parentId > 0)
            {
                this.LoopChannelMenu(strTxt, urlKey, parentId);
            }
            strTxt.Append("&nbsp;&gt;&nbsp;<a href=\"" + this.linkurl(urlKey, (object)category_id, (object)1) + "\">" + articleCategory.GetTitle(category_id) + "</a>");
        }
Пример #4
0
 protected override void ShowPage()
 {
     this.page        = DTRequest.GetQueryInt("page", 1);
     this.category_id = DTRequest.GetQueryInt("category_id");
     Rain.BLL.article_category articleCategory = new Rain.BLL.article_category();
     this.model.title = "所有类别";
     if (this.category_id <= 0 || !articleCategory.Exists(this.category_id))
     {
         return;
     }
     this.model = articleCategory.GetModel(this.category_id);
 }
Пример #5
0
 private void ShowInfo(int _id)
 {
     Rain.Model.article_category model = new Rain.BLL.article_category().GetModel(_id);
     this.ddlParentId.SelectedValue = model.parent_id.ToString();
     this.txtCallIndex.Text         = model.call_index;
     this.txtTitle.Text             = model.title;
     this.txtSortId.Text            = model.sort_id.ToString();
     this.txtSeoTitle.Text          = model.seo_title;
     this.txtSeoKeywords.Text       = model.seo_keywords;
     this.txtSeoDescription.Text    = model.seo_description;
     this.txtLinkUrl.Text           = model.link_url;
     this.txtImgUrl.Text            = model.img_url;
     this.txtContent.Value          = model.content;
 }
Пример #6
0
        private void TreeBind(int _channel_id)
        {
            DataTable list = new Rain.BLL.article_category().GetList(0, _channel_id);

            this.ddlCategoryId.Items.Clear();
            this.ddlCategoryId.Items.Add(new ListItem("请选择类别...", ""));
            foreach (DataRow row in (InternalDataCollectionBase)list.Rows)
            {
                string str1 = row["id"].ToString();
                int    num  = int.Parse(row["class_layer"].ToString());
                string text = row["title"].ToString().Trim();
                if (num == 1)
                {
                    this.ddlCategoryId.Items.Add(new ListItem(text, str1));
                }
                else
                {
                    string str2 = "├ " + text;
                    this.ddlCategoryId.Items.Add(new ListItem(Utils.StringOfChar(num - 1, " ") + str2, str1));
                }
            }
        }