Example #1
0
        public List <Link> GetLink()
        {
            BLL.Cookie.TeUser U = GetCookie.GetUserCookie();

            string condition = string.Format(@"[UserType]=1  and UserCode ='{0}' ", U.userCode);

            DataSet dataSet  = UserManager.GetUserRoleInfoList(condition);
            string  RoleCode = "";

            for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++)
            {
                RoleCode += "'" + dataSet.Tables[0].Rows[i]["RoleCode"].ToString() + "',";
            }
            if (RoleCode != "")
            {
                RoleCode = RoleCode.Substring(0, RoleCode.Length - 1);
                StringBuilder strSql = new StringBuilder();
                strSql.Append("SELECT DISTINCT ");
                strSql.Append("[Code],[oaName],[link],[sort],[img],[State]");
                strSql.Append(" FROM ViewRoleLink where ");
                strSql.Append(string.Format("RoleCode In ({0}) order by sort asc", RoleCode));
                using (BLL.NETDISKDBEntities Db = new BLL.NETDISKDBEntities())
                {
                    DataSet     Dt      = SqlQueryForDataTatable1(Db.Database, strSql.ToString());
                    List <Link> result1 = List.ToList <Link>(Dt, 0);
                    return(result1.ToList());
                }
            }
            else
            {
                return(null);
            }
        }
Example #2
0
        /// <summary>
        /// 人员列表
        /// </summary>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">一页展示多少条</param>
        /// <param name="Name">名称</param>
        /// <param name="Count">总数返回</param>
        /// <returns></returns>
        public List <SMSModel.UserRoleInfoList> GetUserRoleList(int pageIndex, int pageSize, string condition, ref int Count)
        {
            DataSetToList List = new DataSetToList();

            DataSet dataSet = UserManager.GetUserRoleInfoList(condition);

            List <SMSModel.UserRoleInfoList> RoleInfolist = List.ToList <SMSModel.UserRoleInfoList>(dataSet, 0);

            Count = RoleInfolist.Count();
            int startRow = (pageIndex - 1) * pageSize;

            return(RoleInfolist.Skip(startRow).Take(pageSize).ToList());
        }
Example #3
0
        /// <summary>
        /// 角色列表
        /// </summary>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">一页展示多少条</param>
        /// <param name="Name">名称</param>
        /// <param name="Count">总数返回</param>
        /// <returns></returns>
        public List <SMSModel.RoleInfo> GetPageList(int pageIndex, int pageSize, string RoleName, ref int Count)
        {
            DataSetToList List = new DataSetToList();

            StringBuilder where = new StringBuilder();
            where.Append(" 1=1 ");

            //where.Append( " Code Like '2%' " );
            if (!string.IsNullOrEmpty(RoleName))
            {
                where.Append(" and Name like '%" + RoleName + "%' ");
            }
            where.Append(" order by Code asc ");

            DataSet dt = UserManager.GetRoleList(where.ToString());

            List <SMSModel.RoleInfo> RoleInfolist = List.ToList <SMSModel.RoleInfo>(dt, 0);

            Count = RoleInfolist.Count();
            int startRow = (pageIndex - 1) * pageSize;

            return(RoleInfolist.Skip(startRow).Take(pageSize).ToList());
        }