//美化列表 protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { Literal LitFirst = (Literal)e.Item.FindControl("LitFirst"); HiddenField hidLayer = (HiddenField)e.Item.FindControl("hidLayer"); string LitStyle = "<span style=\"display:inline-block;width:{0}px;\"></span>{1}{2}"; string LitImg1 = "<span class=\"folder-open\"></span>"; string LitImg2 = "<span class=\"folder-line\"></span>"; LinkButton lb = (LinkButton)e.Item.FindControl("lbedit"); LinkButton lbadd = (LinkButton)e.Item.FindControl("lbadd"); Cms.BLL.C_Column cm = new Cms.BLL.C_Column(); string classname = cm.GetModel(27).className; bool blEdit = adminUser.setpurview(classname, "Edit"); bool bladd = adminUser.setpurview(classname, "Edit"); if (!bladd) { lbadd.Visible = false; } if (!blEdit) { lb.Visible = false; } int classLayer = Convert.ToInt32(hidLayer.Value); if (classLayer == 1) { LitFirst.Text = LitImg1; } else { LitFirst.Text = string.Format(LitStyle, (classLayer - 2) * 24, LitImg2, LitImg1); } } }
private void RptBind() { Cms.BLL.sc_stores bll = new Cms.BLL.sc_stores(); DataTable dt = bll.GetList("").Tables[0]; this.rptList.DataSource = dt; this.rptList.DataBind(); Cms.BLL.C_Column cm = new Cms.BLL.C_Column(); string classname = cm.GetModel(27).className; bool bladd = adminUser.setpurview(classname, "add"); bool blEdit = adminUser.setpurview(classname, "Edit"); bool blDelete = adminUser.setpurview(classname, "Delete"); if (!bladd) { btnadd.Visible = false; } if (!blEdit) { btnSave.Visible = false; } if (!blDelete) { btnDelete.Visible = false; } }
private void RptBind(int id) { Cms.BLL.C_article_category bll = new Cms.BLL.C_article_category(); DataTable dt = bll.GetList(0, this.channel_id, "where channel_id=" + id); this.rptList.DataSource = dt; this.rptList.DataBind(); Cms.BLL.C_Column cm = new Cms.BLL.C_Column(); string classname = cm.GetModel(27).className; bool bladd = adminUser.setpurview(classname, "add"); bool blEdit = adminUser.setpurview(classname, "Edit"); bool blDelete = adminUser.setpurview(classname, "Delete"); if (!bladd) { btnadd.Visible = false; } if (!blEdit) { btnSave.Visible = false; } if (!blDelete) { btnDelete.Visible = false; } }
/// <summary> /// 权限控制编辑 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e) { LinkButton lbedit = e.Item.FindControl("lbedit") as LinkButton; Cms.BLL.C_Column cm = new Cms.BLL.C_Column(); string classname = cm.GetModel(84).className; bool blEdit = adminUser.setpurview(classname, "Edit"); if (!blEdit) { lbedit.Visible = false; } }
protected void btnDelete_Click(object sender, EventArgs e) { Cms.BLL.C_Column bll = new Cms.BLL.C_Column(); 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).className); //记录日志 bll.Delete(id); } } JscriptMsg("删除数据成功!", "channel_list.aspx", "Success"); }
//美化列表 protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { Literal LitFirst = (Literal)e.Item.FindControl("LitFirst"); LinkButton lb = (LinkButton)e.Item.FindControl("lbedit"); Cms.BLL.C_Column cm = new Cms.BLL.C_Column(); string classname = cm.GetModel(27).className; bool blEdit = adminUser.setpurview(classname, "Edit"); if (!blEdit) { lb.Visible = false; } } }
/// <summary> /// 设置权限 /// </summary> public void setqx() { Cms.BLL.C_Column cm = new Cms.BLL.C_Column(); string classname = cm.GetModel(int.Parse("1")).className; bool bladd = adminUser.setpurview(classname, "add"); bool blEdit = adminUser.setpurview(classname, "Edit"); bool blDelete = adminUser.setpurview(classname, "Delete"); if (!bladd) { btnadd.Visible = false; } if (!blEdit) { btnSave.Visible = false; } if (!blDelete) { btnDelete.Visible = false; } }
public void Del() { if (Request.QueryString["action"] != null) { if (Request.QueryString["action"].ToString() == "del") { int classid = Convert.ToInt32(Request.QueryString["classid"].ToString()); string strclassname = Request.QueryString["classname"].ToString(); Cms.BLL.C_Column bllcolumn = new Cms.BLL.C_Column(); adminUser.AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), bllcolumn.GetModel(classid).className); //记录日志 if (bllcolumn.Delete(classid)) { JscriptMsg("删除栏目信息成功!", "channel_list.aspx", "Success"); } else { JscriptMsg("删除栏目信息失败!", "channel_list.aspx", "Error"); } } } }
protected void btnDelete_Click(object sender, EventArgs e) { Cms.BLL.C_Column bll = new Cms.BLL.C_Column(); 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_Column 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.className); //记录日志 bll.Delete(id); } } } JscriptMsg("删除数据成功!", "Column_list.aspx", "Success"); }
public void Bind() { string where = "select * from wx_ConcernReply order by id desc"; this.AspNetPager1.AlwaysShow = true; this.AspNetPager1.PageSize = 10; this.AspNetPager1.RecordCount = bllorder.GetRecordCount(""); this.RepeaterDataBind(where); Cms.BLL.C_Column cm = new Cms.BLL.C_Column(); string classname = cm.GetModel(81).className; bool bladd = adminUser.setpurview(classname, "add"); bool blEdit = adminUser.setpurview(classname, "Edit"); bool blDelete = adminUser.setpurview(classname, "Delete"); if (!bladd) { btnadd.Visible = false; } if (!blDelete) { btnDelete.Visible = false; } }
public void DataBind(int classId) { Cms.BLL.C_Column bllcolumn = new Cms.BLL.C_Column(); Cms.Model.C_Column model = bllcolumn.GetModel(classId); DataSet ds = bllcolumn.GetList("classId=" + classId + ""); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; this.parentId.SelectedValue = model.parentId.ToString(); //上级栏目ID this.modelId.SelectedValue = model.modelId.ToString(); //栏目模型ID this.className.Text = model.className.ToString(); //栏目名称 this.sub_title.Text = model.sub_title.ToString(); //副名称 this.engName.Text = model.engName.ToString(); //栏目英文名称 this.orderNumber.Text = model.orderNumber.ToString(); //栏目排序 this.photoUrl.Value = model.photoUrl.ToString(); //栏目缩略图 this.photoUrlone.Value = model.photoUrlone.ToString(); //栏目图标True this.photoUrltwo.Value = model.photoUrltwo.ToString(); //栏目图标False string ShowChannel = model.isShowChannel.ToString(); if (ShowChannel == "0") { isShowChannel.Checked = false;//是否参与导航 0是参与导航 } else { isShowChannel.Checked = true;//是否参与导航 1是不参与导航 } string ShowNext = model.isShowNext.ToString(); if (ShowNext == "0") { isShowNext.Checked = false;//是否显示子栏目 0是显示 } else { isShowNext.Checked = true;//是否显示子栏目 1是隐藏 best_tab_item.Visible = true; best_tab_content.Visible = true; } string Blank = model.isBlank.ToString(); if (Blank == "0") { isBlank.Checked = false;//是否打开新窗口 0是不打开新窗口 } else { isBlank.Checked = true;//是否打开新窗口 1是打开新窗口 } string Hidden = model.isHidden.ToString(); if (Hidden == "0") { isHidden.Checked = false;//是否隐藏 0是显示 } else { isHidden.Checked = true; //是否隐藏 1是隐藏 } this.linkUrl.Text = model.linkUrl.ToString(); //外链地址 this.tplChannel.Text = model.tplChannel.ToString(); this.tplContent.Text = model.tplContent.ToString(); this.listinfopath.Text = model.listinfopath.ToString(); //后台列表信息地址 this.txtCallIndex.Text = model.name.ToString(); //调用别名 this.columnchose.Text = model.related.ToString(); //关联栏目 this.intro.Text = model.intro.ToString(); //栏目简介 this.content.Value = model.content.ToString(); //栏目内容 this.seoTitle.Text = model.seoTitle.ToString(); //SEO标题 this.seoKeyword.Text = model.seoKeyword.ToString(); //SEO关键字 this.seoDescription.Text = model.seoDescription.ToString(); //SEO描述 string wisShowChannel = model.w_isShowChannel.ToString(); //是否参与手机导航 0是参与导航 if (wisShowChannel == "0") { w_isShowChannel.Checked = false;//是否参与手机导航 1是不参与导航 } else { w_isShowChannel.Checked = true;//是否参与导航 1是不参与导航 wap_tab_item.Visible = true; wap_tab_content.Visible = true; } this.w_linkUrl.Text = model.w_linkUrl.ToString(); //手机链接地址 this.w_intro.Text = model.w_intro.ToString(); //手机站简介 this.w_content.Value = model.w_content.ToString(); //手机站内容 string eisShowChannel = model.e_isShowChannel.ToString(); //是否参与英文导航 0是参与导航 if (eisShowChannel == "0") { e_isShowChannel.Checked = false;//是否参与英文导航 1是不参与导航 } else { e_isShowChannel.Checked = true;//是否参与英文导航 1是不参与导航 english_tab_item.Visible = true; english_tab_content.Visible = true; } this.e_linkUrl.Text = model.e_linkUrl.ToString(); //手英文链接地址 this.e_intro.Text = model.e_intro.ToString(); //英文站简介 this.e_content.Value = model.e_content.ToString(); //英文站内容 this.e_seoTitle.Text = model.e_seoTitle.ToString(); //英文站SEO标题 this.e_seoKeyword.Text = model.e_seoKeyword.ToString(); //英文站SEO关键字 this.e_seoDescription.Text = model.e_seoDescription.ToString(); //英文站SEO描述 if (model.is_albums == 1) { cbIsAlbums.Checked = true; } if (model.is_attach == 1) { cbIsAttach.Checked = true; } txtPageSize.Text = model.page_size.ToString(); #region 赋值操作权限类型============================= string[] actionTypeArr = model.action_type.Split(','); for (int i = 0; i < cblActionType.Items.Count; i++) { for (int n = 0; n < actionTypeArr.Length; n++) { if (actionTypeArr[n].ToLower() == cblActionType.Items[i].Value.ToLower()) { cblActionType.Items[i].Selected = true; } } } #endregion #region 赋值扩展字段============================= if (model.channel_fields != null) { for (int i = 0; i < cblAttributeField.Items.Count; i++) { Cms.Model.C_Column_field modelt = model.channel_fields.Find(p => p.field_id == int.Parse(cblAttributeField.Items[i].Value)); //查找对应的字段ID if (modelt != null) { cblAttributeField.Items[i].Selected = true; } } } #endregion } }
protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("Fielddocid")).Value); Cms.BLL.C_article bll = new Cms.BLL.C_article(); Cms.Model.C_article model = bll.GetModel(id); LinkButton lb = (LinkButton)e.Item.FindControl("lbedit"); Cms.BLL.C_Column cm = new Cms.BLL.C_Column(); string classid = DTRequest.GetQueryString("classid"); string classname = cm.GetModel(int.Parse(classid)).className; bool blEdit = adminUser.setpurview(classname, "Edit"); if (!blEdit) { lb.Visible = false; } 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; } }