private void BindData() { BLL.common_category catebll = new BLL.common_category(); DataTable dt = catebll.GetList(" group_id = " + (int)EnumCollection.category_group.新闻动态 + " order by sort asc "); this.rptCategory.DataSource = dt; this.rptCategory.DataBind(); if (this.cate <= 0) { Model.common_category cateModel = catebll.GetModel(1, " group_id = " + (int)EnumCollection.category_group.新闻动态, " sort asc "); if (cateModel != null) { this.cate = cateModel.id; } } this.pageIndex = RequestHelper.GetQueryInt("page", 1); BLL.common_article bll = new BLL.common_article(); string whereStr = " group_id = " + (int)EnumCollection.article_group.新闻动态 + " and category_id = " + this.cate; dt = bll.GetListByPage("*", "View_NewsList", whereStr, " add_time desc ", pageIndex, pageSize); this.rptNews.DataSource = dt; this.rptNews.DataBind(); int totalCount = bll.GetRecordCount("View_NewsList", whereStr); string pageUrl = Utils.CombUrlTxt("news_list.aspx", "page={0}", "__id__"); PageContent.InnerHtml = PageListHelper.OutPageList(totalCount, pageIndex, pageSize, pageUrl); }
private void ShowInfo(int _id) { BLL.common_category bll = new BLL.common_category(); Model.common_category model = bll.GetModel(_id); txtImg.Text = model.img_src; txtSort.Text = model.sort.ToString(); txtName.Text = model.name; }
private void BindInfo() { BLL.common_category bll = new BLL.common_category(); Model.common_category model = bll.GetModel(this.id); if (model == null) { JscriptMsg("信息不存在或已被删除!", "back"); return; } txtgroup_id.Text = model.group_id + ""; txtcategory_level.Text = model.category_level + ""; txtparent_id.Text = model.parent_id + ""; txtimg_src.Text = model.img_src + ""; txtname.Text = model.name + ""; txtsort.Text = model.sort + ""; txtadd_time.Text = model.add_time + ""; }
//保存 protected void btnSubmit_Click(object sender, EventArgs e) { ChkAdminLevel("_ybd_common_category", EnumCollection.ActionEnum.Modify.ToString()); //检查权限 BLL.common_category bll = new BLL.common_category(); Model.common_category model = bll.GetModel(this.id); model.group_id = Convert.ToInt32(txtgroup_id.Text); model.category_level = Convert.ToInt32(txtcategory_level.Text); model.parent_id = Convert.ToInt32(txtparent_id.Text); model.img_src = Convert.ToString(txtimg_src.Text); model.name = Convert.ToString(txtname.Text); model.sort = Convert.ToInt32(txtsort.Text); model.add_time = Convert.ToDateTime(txtadd_time.Text); if (bll.Update(model)) { AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "修改全局分类信息,主键:" + id); //记录日志 JscriptMsg("修改全局分类信息成功!", "Manage.aspx"); } else { JscriptMsg("保存过程中发生错误!", ""); } }