Example #1
0
        /// <summary>
        /// 加载菜单树
        /// </summary>
        /// <returns></returns>
        public string LoadMuenu()
        {
            List <Sys_Department> list = null;

            CurrUserInfo = new BasePage().CurrUserInfo();
            list         = bll.GetList(p => p.Department_IsDel == "0").OrderBy(p => p.Department_Sequence).ToList();
            StringBuilder strMenu = new StringBuilder();

            strMenu.Append("{\"total\":" + list.Count + ",\"rows\":[");

            int index = 0;

            foreach (Sys_Department menu in list)
            {
                index++;

                if (menu.Department_ParentCode == "0")
                {
                    strMenu.Append("{\"id\":\"" + menu.Department_Code + "\",\"name\":\"" + menu.Department_Name + "\",\"sort\":\"" + menu.Department_Sequence + "\",\"type\":\"" + Common_BLL.GetDataDictNameByCode(menu.Department_Type) + "\",\"personCharge\":\"" + index + "\",\"teachers\":\"" + index + "\",\"students\":\"" + index + "\"},");
                }
                else
                {
                    strMenu.Append("{\"id\":\"" + menu.Department_Code + "\",\"name\":\"" + menu.Department_Name + "\",\"sort\":\"" + menu.Department_Sequence + "\",\"type\":\"" + Common_BLL.GetDataDictNameByCode(menu.Department_Type) + "\",\"personCharge\":\"" + index + "\",\"teachers\":\"" + index + "\",\"students\":\"" + index + "\",\"_parentId\":\"" + menu.Department_ParentCode + "\"}");

                    if (index != list.Count)
                    {
                        strMenu.Append(",");
                    }
                }
            }

            strMenu.Append("]}");

            return(strMenu.ToString());
        }
        /// <summary>
        /// 岗位信息绑定
        /// </summary>
        private void PostBind()
        {
            chbGwList.Items.Clear();

            string strWhere = "";
            //Sys_Department depModel = bllSys_Department.FindByCode(ddlDepart.SelectedValue);
            List <Sys_Department> depModel = bllSys_Department.GetList(p => p.Department_Code == ddlDepart.SelectedValue).ToList();

            foreach (Sys_Department rwo in depModel)
            {
                strWhere = "Post_DepCode = '" + rwo.Department_Code + "'";
                //chbGwList.DataSource = bllPost.GetList(strWhere).OrderBy(m => m.Post_Sort);
                chbGwList.DataSource = bllPost.GetList(p => p.Post_DepCode == rwo.Department_Code).OrderBy(m => m.Post_Sort).ToList();
            }


            chbGwList.DataTextField  = "Post_Name";
            chbGwList.DataValueField = "PostID";
            chbGwList.DataBind();
        }