public void QueryClientsAsync( int pageIndex, int pageSize, Guid?groupId, Guid?workId, string minerIp, string minerName, MineStatus mineState, string coin, string pool, string wallet, string version, string kernel, Action <QueryClientsResponse, Exception> callback) { var request = new QueryClientsRequest { LoginName = SingleUser.LoginName, PageIndex = pageIndex, PageSize = pageSize, GroupId = groupId, WorkId = workId, MinerIp = minerIp, MinerName = minerName, MineState = mineState, Coin = coin, Pool = pool, Wallet = wallet, Version = version, Kernel = kernel }; request.SignIt(SingleUser.PasswordSha1); PostAsync(SControllerName, nameof(IControlCenterController.QueryClients), null, request, callback); }
public void QueryClients( int pageIndex, int pageSize, Guid?mineWorkId, string minerIp, string minerName, MineStatus mineState, string mainCoin, string mainCoinPool, string mainCoinWallet, string dualCoin, string dualCoinPool, string dualCoinWallet, Action <QueryClientsResponse> callback) { Task.Factory.StartNew(() => { Guid messageId = Guid.NewGuid(); try { using (var service = CreateService()) { var request = new QueryClientsRequest { LoginName = LoginName, PageIndex = pageIndex, PageSize = pageSize, MineWorkId = mineWorkId, MinerIp = minerIp, MinerName = minerName, MineState = mineState, MainCoin = mainCoin, MainCoinPool = mainCoinPool, MainCoinWallet = mainCoinWallet, DualCoin = dualCoin, DualCoinPool = dualCoinPool, DualCoinWallet = dualCoinWallet, Timestamp = DateTime.Now }; request.SignIt(Password); QueryClientsResponse response = service.QueryClients(request); callback?.Invoke(response); } } catch (CommunicationException e) { Global.DebugLine(e.Message, ConsoleColor.Red); callback?.Invoke(QueryClientsResponse.ClientError(messageId, e.Message)); } catch (Exception e) { Global.Logger.Error(e.Message, e); callback?.Invoke(QueryClientsResponse.ClientError(messageId, e.Message)); } }); }