public void GetSellerTransactions() { GetSellerTransactionsCall gst = new GetSellerTransactionsCall(this.apiContext); // Time filter System.DateTime calTo = System.DateTime.Now; System.DateTime calFrom = calTo.AddHours(-1); TimeFilter tf = new TimeFilter(calFrom, calTo); gst.ModTimeFilter = tf; // Pagination PaginationType pt = new PaginationType(); pt.EntriesPerPage = 100; pt.EntriesPerPageSpecified = true; pt.PageNumber = 1; pt.PageNumberSpecified = true; gst.Pagination = pt; gst.Execute(); TestData.SellerTransactions = gst.ApiResponse.TransactionArray; }
private void BtnGetSellerTransactions_Click(object sender, System.EventArgs e) { try { LstTransactions.Items.Clear(); GetSellerTransactionsCall apicall = new GetSellerTransactionsCall(Context); TimeFilter timefilter = new TimeFilter(); if (GMT.Checked.Equals(true)) { timefilter.TimeFromUTC = DatePickModFrom.Value; timefilter.TimeToUTC = DatePickModTo.Value; } else { timefilter.TimeFrom = DatePickModFrom.Value; timefilter.TimeTo = DatePickModTo.Value; } TransactionTypeCollection transactions = apicall.GetSellerTransactions(timefilter); // TransactionTypeCollection transactions = apicall.GetSellerTransactions(DatePickModFrom.Value, DatePickModTo.Value); foreach (TransactionType trans in transactions) { string[] listparams = new string[6]; listparams[0] = trans.Item.ItemID; listparams[1] = trans.TransactionID; listparams[2] = trans.TransactionPrice.Value.ToString(); listparams[3] = trans.AmountPaid.Value.ToString(); listparams[4] = trans.QuantityPurchased.ToString(); listparams[5] = trans.Buyer.UserID; ListViewItem vi = new ListViewItem(listparams); LstTransactions.Items.Add(vi); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }