예제 #1
0
        /// <summary>
        /// 显示员工列表
        /// </summary>
        /// <returns></returns>
        public List <UserInfo> Show(string name = "", int id = -1)
        {
            string          sql  = "select UserInfo.ID,UName,RealName,Phone,Email,Name,Status from UserInfo join Depart on Depart.ID=DepartId";
            List <UserInfo> list = SqlDbHelper.GetList <UserInfo>(sql);

            if (name != null)
            {
                list = list.Where(m => m.RealName.Contains(name)).ToList();
            }
            if (id != -1)
            {
                list = list.Where(m => m.DepartId.Equals(id)).ToList();
            }
            return(list);
        }
예제 #2
0
        /// <summary>
        /// 绑定下拉列表
        /// </summary>
        /// <returns></returns>
        public List <Depart> Bind()
        {
            List <Depart> list = SqlDbHelper.GetList <Depart>("select * from Depart");

            return(list);
        }