示例#1
0
 public void GetDispute()
 {
     GetDisputeCall api = new GetDisputeCall(this.apiContext);
     api.DisputeID = "Test";
     // Make API call.
     ApiException gotException = null;
     try
     {
     api.Execute();
     }
     catch(ApiException ex)
     {
         gotException = ex;
     }
     Assert.IsNotNull(gotException);
 }
		private void BtnGetDispute_Click(object sender, System.EventArgs e)
		{
			try
			{
				LstMessages.Items.Clear();
				TxtItemId.Text =  "";
				TxtTitle.Text =  "";
				TxtSeller.Text =  "";
				TxtBuyer.Text =  "";
				TxtCreatedTime.Text =  "";

				GetDisputeCall apicall = new GetDisputeCall(Context);
				DisputeType dispute = apicall.GetDispute(TxtDisputeId.Text);
			
				TxtItemId.Text = dispute.Item.ItemID;
				TxtTitle.Text = dispute.Item.Title;
				TxtSeller.Text = dispute.SellerUserID;
				TxtBuyer.Text = dispute.BuyerUserID;
				TxtCreatedTime.Text = dispute.DisputeCreatedTime.ToString();

				foreach (DisputeMessageType message in dispute.DisputeMessage)
				{
					string[] listparams = new string[5];
					listparams[0] = message.MessageSource.ToString();
					listparams[1] = message.MessageCreationTime.ToString();
					listparams[2] = message.MessageText;

					ListViewItem vi = new ListViewItem(listparams);
					this.LstMessages.Items.Add(vi);

				}

			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message);
			}

		}