private bool DoEdit(int _id) { string channel_id = this.Request.QueryString["channel_id"] ?? "";//栏目ID try { Cms.BLL.C_article_category bll = new Cms.BLL.C_article_category(); Cms.Model.C_article_category model = bll.GetModel(_id); int parentId = int.Parse(ddlParentId.SelectedValue); string class_layer = getclasslayer(Convert.ToInt32(this.ddlParentId.SelectedValue), 1); model.class_layer = Convert.ToInt32(class_layer); model.channel_id = Convert.ToInt32(ddlchannel_id.SelectedValue); model.call_index = txtCallIndex.Text.Trim(); model.title = txtTitle.Text.Trim(); //如果选择的父ID不是自己,则更改 if (parentId != model.id) { model.parent_id = parentId; } model.sort_id = int.Parse(txtSortId.Text.Trim()); model.seo_title = txtSeoTitle.Text; model.seo_keywords = txtSeoKeywords.Text; model.seo_description = txtSeoDescription.Text; 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; //不属于幻灯片 model.adword = adword.Text; model.Fold = Fold.Text; model.activetime = activetime.Text; model.Special = Special.Text; model.video = video.Text; if (bll.Update(model)) { adminUser.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), model.title); //记录日志 return(true); } } catch { return(false); } return(false); }
protected void btnDelete_Click(object sender, EventArgs e) { // ChkAdminLevel("channel_" + this.channel_name + "_category", DTEnums.ActionEnum.Delete.ToString()); //检查权限 Cms.BLL.C_article_category bll = new Cms.BLL.C_article_category(); 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) { adminUser.AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), bll.GetModel(id).title); //记录日志 bll.Delete(id); } } JscriptMsg("删除数据成功!", Utils.CombUrlTxt("category_list.aspx", "channel_id={0}", this.channel_id.ToString()), "Success"); }
protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value); Cms.BLL.C_article_category bll = new Cms.BLL.C_article_category(); Cms.Model.C_article_category model = bll.GetModel(id); switch (e.CommandName) { case "lbtnIsMsg": if (model.is_msg == 1) this.updateSate(id, "is_msg=0"); else this.updateSate(id, "is_msg=1"); break; case "lbtnIsTop": if (model.isTop == 1) this.updateSate(id, "isTop=0"); else this.updateSate(id, "isTop=1"); break; case "lbtnIsRed": if (model.isRecommend == 1) this.updateSate(id, "isRecommend=0"); else this.updateSate(id, "isRecommend=1"); break; case "lbtnIsHot": if (model.isHot == 1) this.updateSate(id, "isHot=0"); else this.updateSate(id, "isHot=1"); break; case "lbtnIsSlide": if (model.is_slide == 1) this.updateSate(id, "is_slide=0"); else this.updateSate(id, "is_slide=1"); break; } }
private void ShowInfo(int _id) { Cms.BLL.C_article_category bll = new Cms.BLL.C_article_category(); Cms.Model.C_article_category model = bll.GetModel(_id); ddlParentId.SelectedValue = model.parent_id.ToString(); ddlchannel_id.SelectedValue = model.channel_id.ToString(); txtCallIndex.Text = model.call_index; txtTitle.Text = model.title; txtSortId.Text = model.sort_id.ToString(); txtSeoTitle.Text = model.seo_title; txtSeoKeywords.Text = model.seo_keywords; txtSeoDescription.Text = model.seo_description; txtLinkUrl.Text = model.link_url; txtImgUrl.Value = model.img_url; txtContent.Value = model.content; this.isHidden.SelectedValue = model.isHidden.ToString();//显示状态 adword.Text = model.adword; Fold.Text = model.Fold; activetime.Text = model.activetime; Special.Text = model.Special; video.Text = model.video; }