protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(base.Request["isAjax"]) && (base.Request["isAjax"] == "true")) { string str5; string str = base.Request["Mode"].ToString(); string str2 = ""; string str3 = "false"; if (((str5 = str) != null) && (str5 == "Add")) { str2 = "标签名称不允许为空"; if (!string.IsNullOrEmpty(base.Request["TagValue"].Trim())) { str2 = "添加标签名称失败,请确认标签名是否已存在"; int num = CatalogHelper.AddTags(Globals.HtmlEncode(base.Request["TagValue"].ToString())); if (num > 0) { str3 = "true"; str2 = num.ToString(); } } base.Response.Clear(); base.Response.ContentType = "application/json"; base.Response.Write("{\"Status\":\"" + str3 + "\",\"msg\":\"" + str2 + "\"}"); base.Response.End(); } } this.btnaddtag.Click += new EventHandler(this.btnaddtag_Click); this.btnupdatetag.Click += new EventHandler(this.btnupdatetag_Click); this.rp_prducttag.ItemCommand += new RepeaterCommandEventHandler(this.rp_prducttag_ItemCommand); if (!base.IsPostBack) { this.ProductTagsBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(base.Request["isAjax"]) && base.Request["isAjax"] == "true") { string text = base.Request["Mode"].ToString(); string text2 = ""; string text3 = "false"; string a = text; if (a == "Add") { text2 = "标签名称不允许为空"; if (!string.IsNullOrEmpty(base.Request["TagValue"].Trim())) { text2 = "添加标签名称失败,请确认标签名是否已存在"; string tagName = Globals.HtmlEncode(base.Request["TagValue"].ToString()); int num = CatalogHelper.AddTags(tagName); if (num > 0) { text3 = "true"; text2 = num.ToString(); } } base.Response.Clear(); base.Response.ContentType = "application/json"; base.Response.Write("{\"Status\":\"" + text3 + "\",\"msg\":\"" + text2 + "\"}"); base.Response.End(); } } }
protected void btnaddtag_Click(object sender, System.EventArgs e) { string text = Globals.HtmlEncode(this.txtaddtagname.Text.Trim()); if (string.IsNullOrEmpty(text)) { this.ShowMsg("标签名称不允许为空!", false); return; } if (CatalogHelper.AddTags(text) > 0) { this.ShowMsg("添加商品标签成功!", true); this.ProductTagsBind(); return; } this.ShowMsg("添加商品标签失败,请确认是否存在重名标签名称", false); }
protected void Page_Load(object sender, System.EventArgs e) { if (!string.IsNullOrEmpty(base.Request["isAjax"]) && base.Request["isAjax"] == "true") { string text = base.Request["Mode"].ToString(); string text2 = "false"; string a; if ((a = text) != null && a == "Add") { string text3 = "标签名称不允许为空"; if (!string.IsNullOrEmpty(base.Request["TagValue"].Trim())) { text3 = "添加标签名称失败,请确认标签名是否已存在"; string tagName = Globals.HtmlEncode(base.Request["TagValue"].ToString()); int num = CatalogHelper.AddTags(tagName); if (num > 0) { text2 = "true"; text3 = num.ToString(); } } base.Response.Clear(); base.Response.ContentType = "application/json"; base.Response.Write(string.Concat(new string[] { "{\"Status\":\"", text2, "\",\"msg\":\"", text3, "\"}" })); base.Response.End(); } } this.btnaddtag.Click += new System.EventHandler(this.btnaddtag_Click); this.btnupdatetag.Click += new System.EventHandler(this.btnupdatetag_Click); this.rp_prducttag.ItemCommand += new System.Web.UI.WebControls.RepeaterCommandEventHandler(this.rp_prducttag_ItemCommand); if (!base.IsPostBack) { this.ProductTagsBind(); } }