private void ShowInfo(int _id) { Cms.BLL.C_type bll = new Cms.BLL.C_type(); Cms.Model.C_type model = bll.GetModel(_id); this.parentId.SelectedValue = model.parent_id.ToString();//上级栏目ID txtCallIndex.Text = model.call_index; txtTitle.Text = model.title; txtSortId.Text = model.sort_id.ToString(); txtLinkUrl.Text = model.link_url; txtImgUrl.Value = model.img_url; txtContent.Value = model.content; this.isHidden.SelectedValue = model.isHidden.ToString();//显示状态 }
protected void btnDelete_Click(object sender, EventArgs e) { Cms.BLL.C_type bll = new Cms.BLL.C_type(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { Cms.Model.C_type model = bll.GetModel(id); if (model != null) { //int count = Cms.DBUtility.DbHelperSQL.ExecuteSql("delete from C_article where parentId=" + id);//删除文章 adminUser.AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), model.title); //记录日志 bll.Delete(id); } } } JscriptMsg("删除数据成功!", "list.aspx", "Success"); }
private bool DoEdit(int _id) { try { Cms.BLL.C_type bll = new Cms.BLL.C_type(); Cms.Model.C_type model = bll.GetModel(_id); model.parent_id = Convert.ToInt32(this.parentId.SelectedValue);//上级栏目ID string class_layer = getclasslayer(Convert.ToInt32(this.parentId.SelectedValue), 1); model.class_layer = Convert.ToInt32(class_layer); model.call_index = txtCallIndex.Text.Trim(); model.title = txtTitle.Text.Trim(); //如果选择的父ID不是自己,则更改 model.sort_id = int.Parse(txtSortId.Text.Trim()); model.link_url = txtLinkUrl.Text.Trim(); model.img_url = txtImgUrl.Value.Trim(); model.content = txtContent.Value; model.isHidden = Convert.ToInt32(this.isHidden.SelectedValue); //显示状态 model.isTop = 0; //0 不置顶 model.isRecommend = 0; //0 不推荐 model.isHot = 0; //不属于热门 model.is_msg = 0; //不属于评论 model.is_slide = 0; //不属于幻灯片 if (bll.Update(model)) { adminUser.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), model.title); //记录日志 return(true); } } catch { return(false); } return(false); }
public void Del() { if (Request.QueryString["action"] != null) { if (Request.QueryString["action"].ToString() == "del") { int id = Convert.ToInt32(Request.QueryString["id"].ToString()); string name = Request.QueryString["name"].ToString(); Cms.BLL.C_type bllcolumn = new Cms.BLL.C_type(); Cms.Model.C_type model = bllcolumn.GetModel(id); adminUser.AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), model.title); //记录日志 if (model != null && bllcolumn.Delete(id)) { JscriptMsg("删除栏目信息成功!", "Column_list.aspx", "Success"); } else { JscriptMsg("删除栏目信息失败!", "Column_list.aspx", "Error"); } } } }