Esempio n. 1
0
        /// <summary>
        /// 分页获得数据信息
        /// </summary>
        /// <param name="limit">页码大小</param>
        /// <param name="offset">从第几条数据开始</param>
        /// <param name="UserName">用户名</param>
        /// <param name="Role">角色ID</param>
        /// <returns></returns>
        public JsonResult GetUserList(int limit, int offset, string UserName, string SelectItem, string UsersSelectItems)
        {
            Business.Sys_UserAdmin Sys_UserAdmin = new Business.Sys_UserAdmin();
            StringBuilder          sb            = new StringBuilder();

            if (!string.IsNullOrEmpty(UserName))
            {
                sb.Append(" and UserName='******'");
            }
            if (!string.IsNullOrEmpty(SelectItem))
            {
                sb.Append(" and RoleCode='" + SelectItem + "'");
            }
            if (!string.IsNullOrEmpty(UsersSelectItems))
            {
                sb.Append(" and  charindex('," + UsersSelectItems + ",',','+cast(WorkUsersId as varchar)+','  )>0 ");
            }

            return(Json(new { total = Sys_UserAdmin.GetUserAdminListCount(sb.ToString()), rows = Sys_UserAdmin.UserAdminList(limit, offset, sb.ToString()) }, JsonRequestBehavior.AllowGet));
        }