public static GetAccountListResponse Unmarshall(UnmarshallerContext context) { GetAccountListResponse getAccountListResponse = new GetAccountListResponse(); getAccountListResponse.HttpResponse = context.HttpResponse; getAccountListResponse.RequestId = context.StringValue("GetAccountList.RequestId"); getAccountListResponse.Total = context.IntegerValue("GetAccountList.Total"); getAccountListResponse.PageNo = context.IntegerValue("GetAccountList.PageNo"); getAccountListResponse.PageSize = context.IntegerValue("GetAccountList.PageSize"); List <GetAccountListResponse.GetAccountList_AccountNotificationInfo> getAccountListResponse_data = new List <GetAccountListResponse.GetAccountList_AccountNotificationInfo>(); for (int i = 0; i < context.Length("GetAccountList.Data.Length"); i++) { GetAccountListResponse.GetAccountList_AccountNotificationInfo accountNotificationInfo = new GetAccountListResponse.GetAccountList_AccountNotificationInfo(); accountNotificationInfo.Region = context.StringValue("GetAccountList.Data[" + i + "].Region"); accountNotificationInfo.UpdateTime = context.StringValue("GetAccountList.Data[" + i + "].UpdateTime"); accountNotificationInfo.Status = context.StringValue("GetAccountList.Data[" + i + "].Status"); getAccountListResponse_data.Add(accountNotificationInfo); } getAccountListResponse.Data = getAccountListResponse_data; return(getAccountListResponse); }
public override async Task <GetAccountListResponse> GetAccountList(GetAccountListRequest getAccountListRequest, ServerCallContext context) { Log.Information("GetAccountListRequest called via gRPC remote service {@getAccountListRequest}", getAccountListRequest); // We don't use the GetAccountListQuery in the controller method otherwise Swagger tries to use a POST on our GET call var accountListQuery = _mapper.Map <GetAccountListQuery>(getAccountListRequest); var result = await _mediator.Send(accountListQuery); var getAccountListResponse = new GetAccountListResponse { Count = result.Count, HasMoreResults = result.HasMoreResults, ContinuationToken = result.ContinuationToken }; foreach (var account in result.Accounts) { getAccountListResponse.Accounts.Add(_mapper.Map <GetAccountListResponse.Types.Account>(account)); } return(getAccountListResponse); //----------------------------------------------------- // TODO: DocumentDB will soon have skip/take // For now we use continuation token to get next batch from list // For even more robust query capabilities you should use the 'search' route //----------------------------------------------------- }
/// <summary> /// Gets all accounts. /// </summary> /// <returns></returns> public JsonResult GetAllAccounts() { GetAccountListResponse response = accountService.GetAllAccounts(); return(Json(new { success = true, response = response.Accounts }, JsonRequestBehavior.AllowGet)); }
public async Task <GetAccountListResponse> GetListOfAccounts(GetAccountListRequest query) { var searchResponse = await _elasticSearchWrapper.Search <QueryableAccount, GetAccountListRequest>(query).ConfigureAwait(false); var accountListResponse = GetAccountListResponse.Create(searchResponse.Documents.Select(queryableAccount => queryableAccount.ToAccount())?.ToList()); accountListResponse.SetTotal(searchResponse.Total); return(accountListResponse); }
public GetAccountListResponse Post([FromBody] GetAccountListRequest value) { var responseobject = new GetAccountListResponse() { status = "S", AccountMasterLists = new Files().GetAccounts() }; // GetBankListResponse response = new GetBankListResponse( ); getaccountlist data = new getaccountlist(); data.datestamp = DateTime.Now; data.androidId = value.Deviceinfo.androidid; data.appName = value.Deviceinfo.appName; data.appVersionCode = value.Deviceinfo.appVersionCode; data.appVersionName = value.Deviceinfo.AppVersionName; data.bluetoothMac = value.Deviceinfo.bluetoothMac; data.capability = value.Deviceinfo.capability; data.deviceId = value.Deviceinfo.deviceId; data.deviceType = value.Deviceinfo.deviceType; data.geoCode = value.Deviceinfo.geoCode; data.ip = value.Deviceinfo.ip; data.location = value.Deviceinfo.location; data.mobileNo = value.Deviceinfo.mobileNo; data.os = value.Deviceinfo.os; data.regId = value.Deviceinfo.regId; data.selectedSimSlot = value.Deviceinfo.selectedSimSlot; data.simId = value.Deviceinfo.simId; data.wifiMac = value.Deviceinfo.WifiMac; data.pspId = value.RequestInfo.pspid; data.pspRefNo = value.RequestInfo.pspRefNo; data.profileId = value.RequestInfo.profileId; data.bankCode = value.bankCode; data.name = value.UserInfo.name; data.virtualAddress = value.UserInfo.virtualAddress; data.requestType = value.requestType; data.request = "POST"; data.apiname = ControllerContext.RouteData.Values["controller"].ToString(); string strcon = "Server=DESKTOP-N5AIHVF\\SRSSQL;Database=WEBAPI;Trusted_Connection=True;"; SqlConnection con = new SqlConnection(strcon); con.Open(); SqlCommand cmd = new SqlCommand("Insert into getaccountlist ( data.datestamp , data.apiname, data.request, data.androidId, data.appName, data.appVersionCode, data.appVersionName, data.bluetoothMac, data.capability, data.deviceId, data.deviceType, data.geoCode, data.ip, data.location, data.mobileNo, data.os, data.regId, data.selectedSimSlot, data.simId, data.wifiMac, data.pspId, data.pspRefNo, data.profileId,data.bankCode, data.name, data.virtualAddress, data.requestType) values('" + data.datestamp + "', '" + data.apiname + "', '" + data.request + "','" + data.androidId + "', '" + data.appName + "', '" + data.appVersionCode + "', '" + data.appVersionName + "', '" + data.bluetoothMac + "', '" + data.capability + "', '" + data.deviceId + "', '" + data.deviceType + "', '" + data.geoCode + "', '" + data.ip + "', '" + data.location + "', '" + data.mobileNo + "', '" + data.os + "', '" + data.regId + "', '" + data.selectedSimSlot + "', '" + data.simId + "', '" + data.wifiMac + "', '" + data.pspId + "', '" + data.pspRefNo + "', '" + data.profileId + "', '" + data.bankCode + "', '" + data.name + "', '" + data.virtualAddress + "', '" + data.requestType + "')", con); cmd.ExecuteNonQuery(); con.Close(); return(responseobject); }