Пример #1
0
        /// <summary>
        /// PC端系统用户集合分页查询
        /// 请勿删除
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="recordCount"></param>
        /// <returns></returns>
        public List <SysUserModel> GetSysUserList(int?pageIndex, int?pageSize, string UserName, ref int recordCount)
        {
            SysUserDal dal = new SysUserDal();

            recordCount = dal.GetCount(UserName);
            return(dal.GetSysUserList(pageIndex, pageSize, UserName));
        }
Пример #2
0
        public ActionResult GetListJson(DataTablesParameters query)
        {
            string UserName  = Request.GetSqlParamer("UserName");
            string LoginName = Request.GetSqlParamer("LoginName");

            string sWhere = " 1=1 ";

            if (!string.IsNullOrWhiteSpace(UserName))
            {
                sWhere += $" and UserName like '{UserName}%'";
            }

            if (!string.IsNullOrWhiteSpace(LoginName))
            {
                sWhere += $" and LoginName like '{LoginName}%'";
            }

            SysUserDal sysUserDal = flexibleContext.GetService <SysUserDal>();
            var        list       = sysUserDal.GetModels(
                where : sWhere,
                orderBy: query.OrderBy,
                currentPage: query.Start / 10 + 1,
                itemsPerPage: query.Length
                );

            int recordsCount = sysUserDal.GetCount(sWhere);

            var resultJson = new DataTablesResult <SysUser>(query.Draw, recordsCount, recordsCount, list);

            return(Json(resultJson));
        }