private void getType() { IList <FactType> com = FactTypeManager.getFactTypeAll(); this.rpCusType.DataSource = com; this.rpCusType.DataBind(); }
public string LoadZtreeData() { result += "[{id:999, pId: 0, name:'全部分类" + "', icon:'../../Images/public/bfolder.gif', open: true },"; IList <FactType> typelist = FactTypeManager.getFactTypeAll(); foreach (FactType ct in typelist) { result += "{id:" + ct.Id + ", pId: 999, name: '" + ct.TypeName + "',icon:'../../Images/public/folder.gif'},"; } result = result.TrimEnd(',') + "]"; return(result); }
/// <summary> /// 加载类别 /// </summary> public void BindTypes() { ddltype.Items.Clear(); IList <FactType> typelist = FactTypeManager.getFactTypeAll(); for (int i = 0; i < typelist.Count; i++) { ListItem list = new ListItem(typelist[i].TypeName, typelist[i].Id.ToString()); ddltype.Items.Add(list); } ListItem ltem = new ListItem("选择类别", "-1"); //添加第一行默认值 ddltype.Items.Insert(0, ltem); //添加第一行默认值 }