public virtual object GetOnlineUsers(HttpContext context) { YZRequest request = new YZRequest(context); //获得数据 ActiveUserCollection activeUsers = new ActiveUserCollection(); int rowcount; int allOnlineUserCount = 0; using (BPMConnection cn = new BPMConnection()) { cn.WebOpen(); activeUsers = LoginManager.GetActiveUsers(cn, 1200, null, request.GetSortString("LastActiveDate DESC"), request.Start, request.Limit, out rowcount); allOnlineUserCount = LoginManager.GetActiveUserCount(cn, 1200); } List <object> data = new List <object>(); foreach (ActiveUser user in activeUsers) { data.Add( new { Account = user.Account, DisplayName = user.DisplayName, OfficePhone = user.OfficePhone, EMail = user.EMail, LastActiveDate = user.LastActiveDate } ); } return(new { success = true, total = rowcount, allOnlineUserCount = allOnlineUserCount, children = data }); }
public virtual object GetSystemUsers(HttpContext context) { YZRequest request = new YZRequest(context); IYZDbProvider provider = YZDbProviderManager.DefaultProvider; //获得数据 ActiveUserCollection activeUsers = new ActiveUserCollection(); int rowcount; using (BPMConnection cn = new BPMConnection()) { cn.WebOpen(); activeUsers = LoginManager.GetSystemUsers(cn, 30, this.GetFilterStringSystemUsers(request, provider), request.GetSortString("LastActiveDate DESC"), request.Start, request.Limit, out rowcount); } List <object> data = new List <object>(); foreach (ActiveUser user in activeUsers) { data.Add( new { Account = user.Account, DisplayName = user.DisplayName, OfficePhone = user.OfficePhone, EMail = user.EMail, LastActiveDate = user.LastActiveDate } ); } return(new { success = true, total = rowcount, children = data }); }