public string GetCategoryName(object target) { string str = string.Empty; if (!StringPlus.IsNullOrEmpty(target)) { int categoryId = Globals.SafeInt(target, 0); Maticsoft.Model.Shop.Products.CategoryInfo model = new Maticsoft.BLL.Shop.Products.CategoryInfo().GetModel(categoryId); str = (model == null) ? "" : model.Name; } return str; }
private void BindDropList() { DataSet list = new Maticsoft.BLL.Shop.Products.CategoryInfo().GetList(" Depth = 1"); if (!DataSetTools.DataSetIsNull(list)) { this.dropCategories.DataSource = list; this.dropCategories.DataTextField = "Name"; this.dropCategories.DataValueField = "CategoryId"; this.dropCategories.DataBind(); } this.dropCategories.Items.Insert(0, new ListItem(Site.PleaseSelect, "0")); }
private void BindCategories() { DataSet list = new CategoryInfo().GetList(" Depth = 1 "); if (!DataSetTools.DataSetIsNull(list)) { this.dropCategory.DataSource = list; this.dropCategory.DataTextField = "Name"; this.dropCategory.DataValueField = "CategoryId"; this.dropCategory.DataBind(); } this.dropCategory.Items.Insert(0, string.Empty); }
private void BindCategories() { DataSet list = new Maticsoft.BLL.Shop.Products.CategoryInfo().GetList(" Depth = 1 "); if (!DataSetTools.DataSetIsNull(list)) { this.drpProductCategory.DataSource = list; this.drpProductCategory.DataTextField = "Name"; this.drpProductCategory.DataValueField = "CategoryId"; this.drpProductCategory.DataBind(); } this.drpProductCategory.Items.Insert(0, new ListItem("请选择", string.Empty)); }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { if (!base.UserPrincipal.HasPermissionID(base.GetPermidByActID(this.Act_DelData)) && (base.GetPermidByActID(this.Act_DelData) != -1)) { this.liDel.Visible = false; this.btnDelete.Visible = false; } if (!base.UserPrincipal.HasPermissionID(base.GetPermidByActID(this.Act_AddData)) && (base.GetPermidByActID(this.Act_AddData) != -1)) { this.btnAdd.Visible = false; } DataSet list = new Maticsoft.BLL.Shop.Products.CategoryInfo().GetList(" Depth = 1"); if (!DataSetTools.DataSetIsNull(list)) { this.dropCategories.DataSource = list; this.dropCategories.DataTextField = "Name"; this.dropCategories.DataValueField = "CategoryId"; this.dropCategories.DataBind(); this.dropCategories.Items.Insert(0, new ListItem("请选择", "")); } if ((this.Session["Style"] != null) && (this.Session["Style"].ToString() != "")) { string str = this.Session["Style"] + "xtable_bordercolorlight"; if ((base.Application[str] != null) && (base.Application[str].ToString() != "")) { this.gridView.BorderColor = ColorTranslator.FromHtml(base.Application[str].ToString()); this.gridView.HeaderStyle.BackColor = ColorTranslator.FromHtml(base.Application[str].ToString()); } } } }