//获取仓库大类编码和名称 private void GetParent() { string sql = "SELECT DISTINCT WS_ID,WS_NAME FROM TBWS_WAREHOUSE WHERE WS_FATHERID='ROOT' ORDER BY WS_ID"; DataTable dt = DBCallCommon.GetDTUsingSqlText(sql); DDLParent.DataSource = dt; DDLParent.DataTextField = "WS_NAME"; DDLParent.DataValueField = "WS_ID"; DDLParent.DataBind(); ListItem item = new ListItem("ROOT", "ROOT"); DDLParent.Items.Add(item); }
/// <summary> /// 绑定模块信息 /// </summary> public void LoadModel() { List <Expression> expression = new List <Expression>(); expression.Add(new Expression("ParentID", "=", "0")); DDLParent.DataSource = AdminService.ResourcesService.Search(expression, " OrderBy asc"); DDLParent.DataTextField = "ResourceName"; DDLParent.DataValueField = "ID"; DDLParent.DataBind(); ListItem liP = new ListItem(); liP.Text = "==根目录=="; liP.Value = "0"; DDLParent.Items.Insert(0, liP); }