/// <summary> /// 绑定用户类型 /// </summary> private void DdlUserTypeBind() { this.ddlUserType.DataSource = bllSys_DataDict.GetList(p => p.DataDict_ParentCode == "04").OrderBy(m => m.DataDict_Sequence).ToList(); this.ddlUserType.DataTextField = "DataDict_Name"; this.ddlUserType.DataValueField = "DataDict_Code"; this.ddlUserType.DataBind(); }
/// <summary> /// 加载菜单树 /// </summary> /// <returns></returns> public string LoadMuenu() { List <Sys_DataDict> list = bll.GetList(p => p.DataDict_IsDel == false).OrderBy(p => p.DataDict_Sequence).ToList(); StringBuilder strMenu = new StringBuilder(); strMenu.Append("{\"total\":" + list.Count + ",\"rows\":["); int index = 0; foreach (Sys_DataDict menu in list) { index++; if (menu.DataDict_Code == "0") { strMenu.Append("{\"id\":\"" + menu.DataDict_Code + "\",\"name\":\"" + menu.DataDict_Name + "\",\"code\":\"" + menu.DataDict_Code + "\",\"sort\":\"" + menu.DataDict_Sequence + "\"},"); } else { strMenu.Append("{\"id\":\"" + menu.DataDict_Code + "\",\"name\":\"" + menu.DataDict_Name + "\",\"code\":\"" + menu.DataDict_Code + "\",\"sort\":\"" + menu.DataDict_Sequence + "\",\"_parentId\":\"" + menu.DataDict_ParentCode + "\"}"); if (index != list.Count) { strMenu.Append(","); } } } strMenu.Append("]}"); return(strMenu.ToString()); }
public void BindDDL() { Sys_DataDictBLL balDataDict = new Sys_DataDictBLL(); List <Sys_DataDict> listDataDict = balDataDict.GetList(p => p.DataDict_ParentCode == "26").OrderBy(p => p.DataDict_Sequence).ToList(); this.ddlNotice_Type.DataSource = listDataDict; this.ddlNotice_Type.DataTextField = "DataDict_Name"; this.ddlNotice_Type.DataValueField = "DataDict_Code"; this.ddlNotice_Type.DataBind(); }
/// <summary> /// 绑定控件信息 /// </summary> /// <param name="lc"></param> /// <param name="rootcode"></param> public void BindListControl(System.Web.UI.WebControls.ListControl lc, string rootcode) { var list = bllDataDict.GetList(p => p.DataDict_ParentCode == rootcode).OrderBy(p => p.DataDict_Sequence).ToList();//(" DataDict_ParentCode= " + rootcode + "order by DataDict_Sequence asc"); ; //var model = new Sys_DataDict { DataDict_Name = "-请选择-", DataDict_Code = "" }; //list.Insert(0, model); lc.DataSource = list; lc.DataTextField = "DataDict_Name"; lc.DataValueField = "DataDict_Name"; lc.DataBind(); lc.Items.Insert(0, new ListItem("-请选择-", "")); }
public void BindDDL() { Sys_DataDictBLL balDataDict = new Sys_DataDictBLL(); listDataDict = balDataDict.GetList(p => p.DataDict_ParentCode == "26").OrderBy(p => p.DataDict_Sequence).ToList(); listDataDict.Insert(0, new Sys_DataDict { DataDict_Name = "--全部--", DataDict_Code = "" }); //this.ddlNotice_Type.DataTextField = "DataDict_Name"; //this.ddlNotice_Type.DataValueField = "DataDict_Code"; //ListItem item = new ListItem(); //item.Text = "请选择"; //item.Value = ""; //ddlNotice_Type.Items.Insert(0, item); //this.ddlNotice_Type.SelectedValue = base.RequstStr("type"); }
public void GetDataDictDDL() { if (!string.IsNullOrEmpty(Request["Code"])) { string code = Request["Code"].ToString().Trim(); Sys_DataDictBLL balDataDict = new Sys_DataDictBLL(); List <Sys_DataDict> listDataDict = balDataDict.GetList(p => p.DataDict_IsDel == false && p.DataDict_ParentCode == code).OrderBy(p => p.DataDict_Sequence).ToList(); string hashNull = "1"; if (!string.IsNullOrEmpty(Request["HashNull"])) { hashNull = Request["HashNull"]; } if (hashNull.Equals("1")) { listDataDict.Insert(0, new Sys_DataDict { DataDict_Name = "--请选择--", DataDict_Code = string.Empty }); } Response.Write(new JavaScriptSerializer().Serialize(listDataDict)); } }