protected override void Render(HtmlTextWriter writer) { base.Text = ""; string empty = string.Empty; IList <StoreTagInfo> tagList = StoreTagHelper.GetTagList(); if (tagList.Count < 0) { base.Text = "无"; } else { foreach (StoreTagInfo item in tagList) { string text = ""; if (this._selectvalue != null) { foreach (int item2 in this._selectvalue) { if (item2 == item.TagId) { text = "checked=\"checked\""; } } } base.Text = base.Text + "<span style=\"margin-right:10px;\"><input type=\"checkbox\" class=\"icheck\" name=\"productTags\" onclick=\"javascript:CheckTagId()\" value=\"" + item.TagId.ToString() + "\" " + text + "/><label>" + item.TagName.ToString() + "</label></span>"; } base.Render(writer); } }
protected void btnAddTag(object sender, EventArgs e) { StoreTagInfo storeTagInfo = new StoreTagInfo { TagName = this.txtTagName.Text.Trim() }; if (this.hidOldImages.Value != this.hidUploadImages.Value) { storeTagInfo.TagImgSrc = base.UploadImage(this.hidUploadImages.Value, "depot"); this.hidOldImages.Value = storeTagInfo.TagImgSrc; } else { storeTagInfo.TagImgSrc = this.hidOldImages.Value; } if (!string.IsNullOrEmpty(this.hidTagId.Value)) { storeTagInfo.TagId = int.Parse(this.hidTagId.Value); StoreTagInfo tagInfo = StoreTagHelper.GetTagInfo(storeTagInfo.TagId); storeTagInfo.DisplaySequence = tagInfo.DisplaySequence; this.ShowResultData(StoreTagHelper.EditTag(storeTagInfo)); } else { this.ShowResultData(StoreTagHelper.AddTag(storeTagInfo)); } }
private DataGridViewModel <StoreTagInfo> GetDataList() { DataGridViewModel <StoreTagInfo> dataGridViewModel = new DataGridViewModel <StoreTagInfo>(); List <StoreTagInfo> tagList = StoreTagHelper.GetTagList(); dataGridViewModel.rows = tagList.ToList(); dataGridViewModel.total = tagList.Count; return(dataGridViewModel); }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack && this.site.OpenMultStore) { this.ddlTags.DataSource = StoreTagHelper.GetTagList(); this.ddlTags.DataBind(); this.ddlTags.Items.Insert(0, new ListItem { Text = "请选择", Value = "0" }); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack && SettingsManager.GetMasterSettings().OpenMultStore&& string.IsNullOrEmpty(base.Request.QueryString["isWholesale"])) { this.ddlTags.DataSource = StoreTagHelper.GetTagList(); this.ddlTags.DataBind(); this.ddlTags.Items.Insert(0, new ListItem { Text = "请选择", Value = "0" }); } }
public void Delete(HttpContext context) { int value = base.GetIntParam(context, "ids", false).Value; if (value < 1) { throw new HidistroAshxException("错误的参数!"); } if (StoreTagHelper.Delete(value)) { base.ReturnSuccessResult(context, "删除成功!", 0, true); return; } throw new HidistroAshxException("删除失败!"); }
private void bindTagInfo(int tagId) { this.btnAdd.Text = "保存"; StoreTagInfo tagInfo = StoreTagHelper.GetTagInfo(tagId); if (tagInfo != null) { this.hidTagId.Value = tagInfo.TagId.ToString(); this.txtTagName.Text = tagInfo.TagName; this.hidOldImages.Value = tagInfo.TagImgSrc; } else { this.ShowMsg("数据读取有误", false); this.btnAdd.Enabled = false; } }
private void SaveOrder(HttpContext context) { int value = base.GetIntParam(context, "Value", false).Value; if (value > 0) { int value2 = base.GetIntParam(context, "TagId", false).Value; try { if (StoreTagHelper.UpdateDisplaySequence(value2, value)) { base.ReturnSuccessResult(context, "保存排序成功!", 0, true); } } catch (Exception) { throw new HidistroAshxException("修改排序失败!未知错误!"); } return; } throw new HidistroAshxException("错误的参数"); }