Example #1
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            this.ChkAdminLevel("channel_" + this.channel_name + "_category", DTEnums.ActionEnum.Delete.ToString());
            article_category articleCategory = new article_category();

            for (int index = 0; index < this.rptList.Items.Count; ++index)
            {
                int int32 = Convert.ToInt32(((HiddenField)this.rptList.Items[index].FindControl("hidId")).Value);
                if (((CheckBox)this.rptList.Items[index].FindControl("chkId")).Checked)
                {
                    articleCategory.Delete(int32);
                }
            }
            this.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "删除" + this.channel_name + "频道栏目分类数据");
            this.JscriptMsg("删除数据成功!", Utils.CombUrlTxt("category_list.aspx", "channel_id={0}", this.channel_id.ToString()));
        }
Example #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            this.ChkAdminLevel("channel_" + this.channel_name + "_category", DTEnums.ActionEnum.Edit.ToString());
            article_category articleCategory = new article_category();

            for (int index = 0; index < this.rptList.Items.Count; ++index)
            {
                int int32 = Convert.ToInt32(((HiddenField)this.rptList.Items[index].FindControl("hidId")).Value);
                int result;
                if (!int.TryParse(((TextBox)this.rptList.Items[index].FindControl("txtSortId")).Text.Trim(), out result))
                {
                    result = 99;
                }
                articleCategory.UpdateField(int32, "sort_id=" + result.ToString());
            }
            this.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "保存" + this.channel_name + "频道栏目分类排序");
            this.JscriptMsg("保存排序成功!", Utils.CombUrlTxt("category_list.aspx", "channel_id={0}", this.channel_id.ToString()));
        }
Example #3
0
        /// <summary>
        /// 重写虚方法,此方法将在Init事件前执行
        /// </summary>
        protected override void ShowPage()
        {
            BLL.article_category cbll = new BLL.article_category();
            categoryid = DTRequest.GetQueryInt("category_id", 0);
            if (categoryid > 0)
            {
                categorymodel = cbll.GetModel(categoryid);
            }

            category_dt = get_category_list("hezuomingqi", 0);

            int j = 0;
            int k = 0;

            foreach (DataRow dr in category_dt.Rows)
            {
                if (categoryid == 0 && k == 0)
                {
                    int.TryParse(dr["id"].ToString(), out categoryid);
                    categorymodel = cbll.GetModel(categoryid);
                }
                if (j == 1)
                {
                    int.TryParse(dr["id"].ToString(), out next_categoryid);
                    break;
                }
                if (dr["id"].ToString() == categoryid.ToString())
                {
                    j++;
                }
            }
            if (next_categoryid > 0)
            {
                next_categorymodel = cbll.GetModel(next_categoryid);
            }
            hezuoqy_dt      = get_article_list("hezuomingqi", 25, "category_id=" + categoryid);
            next_hezuoqy_dt = get_article_list("hezuomingqi", 25, "category_id=" + next_categoryid);
        }