protected void repLabelContent_ItemCommand(object sender, RepeaterCommandEventArgs e) { B_LabelContent bll = new B_LabelContent(); if(e.CommandName=="Delete") { Label lblLabelCategoryId = e.Item.FindControl("lblLabelCategoryId") as Label; bll.Delete(lblLabelCategoryId.Text.ToString()); } if (e.CommandName == "DeleteAll") { string strLabelCategoryId = string.Empty; foreach (RepeaterItem rowview in repLabelContent.Items) { CheckBox _cb = rowview.FindControl("CheckBox1") as CheckBox; bool isChecked = _cb.Checked; Label lblid = rowview.FindControl("lblLabelCategoryId") as Label; if (isChecked) { strLabelCategoryId += lblid.Text+ ","; } } if (strLabelCategoryId.EndsWith(",")) { strLabelCategoryId = strLabelCategoryId.Substring(0, strLabelCategoryId.Length - 1); } if (strLabelCategoryId == string.Empty || strLabelCategoryId.Trim().Length == 0) { Function.ShowSysMsg(0, "<li>请选择要删除标签所对应的复选框</li><li><a href='javascript:history.back()'>返回上一页</a></li>"); } else bll.Delete(strLabelCategoryId.ToString()); } StyleBind(); }
protected void repLabelContent_ItemCommand(object sender, RepeaterCommandEventArgs e) { B_LabelContent bll = new B_LabelContent(); if (e.CommandName == "Delete") { Label lblLabelCategoryId = e.Item.FindControl("lblLabelCategoryId") as Label; bll.Delete(lblLabelCategoryId.Text.ToString()); } StyleBind(); }
public DataTable GetLabelList(string categoryId) { DataTable dt = null; if (int.Parse(categoryId) >= 0) { B_LabelContent bll = new B_LabelContent(); int recordCount = 0; dt = bll.GetLbCategoryIdList(int.Parse(categoryId), 1, 1000000, ref recordCount); } else { B_SuperLabel bll = new B_SuperLabel(); dt = bll.GetList(1, 1000000).Tables[0]; } return dt; }
protected void Page_Load(object sender, EventArgs e) { AdminGroupBll.Power_Judge(6); Response.Cache.SetNoStore(); if (Request.QueryString["labelContentId"] != null && Request.QueryString["labelContentId"] != "") { try { labelContentId = int.Parse(Request.QueryString["labelContentId"]); } catch { } } if (labelContentId == 0) { return; } B_LabelContent bll = new B_LabelContent(); string content = bll.GetLabelContent(labelContentId); Response.Write(content); }
protected void btnDeleteAll_Click(object sender, EventArgs e) { B_LabelContent bll = new B_LabelContent(); string strLabelCategoryId = string.Empty; foreach (RepeaterItem rowview in repLabelContent.Items) { CheckBox _cb = rowview.FindControl("CheckBox1") as CheckBox; bool isChecked = _cb.Checked; Label lblid = rowview.FindControl("lblLabelCategoryId") as Label; if (isChecked) { strLabelCategoryId += lblid.Text + ","; } } if (strLabelCategoryId.EndsWith(",")) { strLabelCategoryId = strLabelCategoryId.Substring(0, strLabelCategoryId.Length - 1); } bll.Delete(strLabelCategoryId.ToString()); StyleBind(); }
protected void btnSave_Click(object sender, EventArgs e) { M_LabelContent model = new M_LabelContent(); B_LabelContent bll = new B_LabelContent(); B_KyCommon bllCom = new B_KyCommon(); bool flag = false; if (txtLabelName.Text.Length==1 || !(txtLabelName.Text.ToString().Substring(0, 2).ToLower() == "s_")) { model.Name = lblPrefix.Text.ToString() + txtLabelName.Text.Trim() + lblPostfix.Text.ToString(); model.LbCategoryId = int.Parse(dllLbCategory.SelectedValue.ToString()); model.Content = lblContent.Value; model.AnomalyStyle = string.Empty; model.ModeType = int.Parse(hidModelId.Value.ToString()); flag = bllCom.CheckHas(model.Name, "Name", "KyLabelContent"); if (btnSave.Text == "修改标签") { model.LabelCategoryID = int.Parse(Request.QueryString["labelCategoryId"]); model.AnomalyStyle = string.Empty; bll.Update(model); Response.Redirect(SkipPageUrl); } else { if (!flag) { bll.Add(model); Response.Redirect(SkipPageUrl); } else Response.Write("<script>alert('此标签已存在');</script>"); } } else { Response.Write("<script>alert('此标签与超级标签冲突');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { AdminGroupBll.Power_Judge(6); if(!IsPostBack) { SkipPageUrl = Request.ServerVariables["HTTP_REFERER"].ToString(); ModelBind(); //绑定模型列表 lblInfo.Text = "创建标签"; BindStyleCategory(); if (Request.QueryString["labelCategoryId"]!=null) { lblInfo.Text = "修改标签"; btnSave.Text = "修改标签"; btnReset.Visible = false; M_LabelContent model = new M_LabelContent(); B_LabelContent bll = new B_LabelContent(); model = bll.GetLabelContentId(int.Parse(Request.QueryString["labelCategoryId"])); txtLabelName.Text = model.Name.Replace("{Ky_", "").Replace("}", ""); lblContent.Value = model.Content; for (int i = 0; i < dllLbCategory.Items.Count;i++ ) { if (dllLbCategory.Items[i].Value==model.LbCategoryId.ToString()) { dllLbCategory.Items[i].Selected = true; } } } } }
private string GetLabelContent(string lbName) { if (!this.lbCache.Contains(lbName)) { string labelContentByName = new B_LabelContent().GetLabelContentByName(lbName); this.lbCache.Add(lbName, labelContentByName); } return this.lbCache[lbName].ToString(); }
private void LabelContentBind(int labelCagegoryId, int cursorPage, int pageSize, ref int recordCount) { B_LabelContent bll = new B_LabelContent(); repLabelContent.DataSource = bll.GetLbCategoryIdList(labelCagegoryId,cursorPage,pageSize,ref recordCount); repLabelContent.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { AdminGroupBll.Power_Judge(10); AjaxPro.Utility.RegisterTypeForAjax(typeof(system_label_AnomalyContent)); if(!IsPostBack) { SkipPageUrl = Request.ServerVariables["HTTP_REFERER"].ToString(); ChannelBind(); RepChannelBind(Chid); if (Request.QueryString["labelCategoryId"] != null) { btnSave.Text = "修改标签"; btnReset.Visible = false; M_LabelContent model = new M_LabelContent(); B_LabelContent bll = new B_LabelContent(); model = bll.GetLabelContentId(int.Parse(Request.QueryString["labelCategoryId"])); txtName.Text = model.Name.Replace("{Ky_", "").Replace("}", ""); txtContent.Value = model.AnomalyStyle; } } }
protected void btnSave_Click(object sender, EventArgs e) { M_LabelContent model = new M_LabelContent(); B_LabelContent bll = new B_LabelContent(); B_KyCommon bllCom = new B_KyCommon(); bool flag = false; if (!(txtName.Text.ToString().Substring(0, 2).ToLower() == "s_")) { model.Name = lblPrefix.Text.ToString() + txtName.Text.Trim() + lblPostfix.Text.ToString(); model.LbCategoryId = 1; model.Content = GetContent(txtContent.Value); model.AnomalyStyle = txtContent.Value; ChannelM = ChannelBll.GetChannel(Chid); int modelId = ChannelM.ModelType; model.ModeType = modelId; flag = bllCom.CheckHas(model.Name, "Name", "KyLabelContent"); if (btnSave.Text == "修改标签") { model.LabelCategoryID = int.Parse(Request.QueryString["labelCategoryId"]); bll.Update(model); Response.Redirect(SkipPageUrl); } else { if (!flag) { bll.Add(model); Response.Redirect(SkipPageUrl); } else Response.Write("<script>alert('此标签己存在');</script>"); } } else { Response.Write("<script>alert('此标签与超级标签冲突');</script>"); } }