Ejemplo n.º 1
0
        public ActionResult GetUserList(string username, string email, int page = 1, int limit = 10)
        {
            var result = ResModelFactory.ResDefaultData <SystemUserInfoViewModel>();
            AdminUserService service = new AdminUserService();
            int count = 0;
            //Expression<Func<Admin_User, bool>> where = p => true;
            //if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(email))
            //{
            //    where = p => p.UserName == username & p.Email == email;
            //}
            //else if (!string.IsNullOrEmpty(username) && string.IsNullOrEmpty(email))
            //{
            //    where = p => p.UserName == username;
            //}
            //else if (string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(email))
            //{
            //    where = p => p.Email == email;
            //}
            //var list = service.GetPages(limit, page, out count, where, o => o.CreateDate, false);
            var list = service.GetSysUsers(username, email, page, limit, out count);

            result.count = count;
            result.data  = list.ToArray();
            return(Json(result, JsonRequestBehavior.AllowGet));
        }