Exemplo n.º 1
0
        static void Main(string[] args)
        {

            Console.WriteLine("+++++++++++++++++++++++++++++++++++++++");
            Console.WriteLine("+ Welcome to eBay SDK for .Net Sample +");
            Console.WriteLine("+ - HelloWorld                        +");
            Console.WriteLine("+++++++++++++++++++++++++++++++++++++++");

            //[Step 1] Initialize eBay ApiContext object
            ApiContext apiContext = GetApiContext();


            //[Step 2] Create Call object and execute the Call
            GeteBayOfficialTimeCall apiCall = new GeteBayOfficialTimeCall(apiContext);
            Console.WriteLine("Begin to call eBay API, please wait ...");
            DateTime officialTime = apiCall.GeteBayOfficialTime();
            Console.WriteLine("End to call eBay API, show call result:");

            //[Step 3] Handle the result returned
            Console.WriteLine("eBay official Time: " + officialTime);
            Console.WriteLine();
            Console.WriteLine("Press any key to close the program.");
            Console.ReadKey();

        }
		public void GeteBayOfficialTime()
		{
			GeteBayOfficialTimeCall api = new GeteBayOfficialTimeCall(this.apiContext);
			System.DateTime time = api.GeteBayOfficialTime();
			Assert.IsTrue(time > DateTime.Now.AddMonths(-1));
			
		}
Exemplo n.º 3
0
        private void BtnGeteBayOfficialTime_Click(object sender, System.EventArgs e)
        {
            try
            {
                GeteBayOfficialTimeCall apicall = new GeteBayOfficialTimeCall(Context);

                DatePickOfficialTime.Value = apicall.GeteBayOfficialTime();
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 4
0
 public static void RampUp()
 {
     try
     {
         ApiContext ctx = GetContext();
         GeteBayOfficialTimeCall call = new GeteBayOfficialTimeCall(ctx);
         call.Site = SiteCodeType.US;
         call.Execute();
     }
     catch (Exception e)
     {
         ShowException("GeteBayOfficialTimeCall()", e);
     }
 }
Exemplo n.º 5
0
        private void btnExecute_Click(object sender, System.EventArgs e)
        {
            this.lbInfo.Text = "Making call to eBay. Please wait...";

            this.txtStatus.Text = "";
            this.txteBayOfficialTime.Text = "";

            eBay.Service.Call.GeteBayOfficialTimeCall api = null;
            try
            {
                api = new GeteBayOfficialTimeCall(this.formMain.ApiContext);
                api.GeteBayOfficialTime();
                this.txtStatus.Text = api.AbstractResponse.Ack.ToString();
                this.txteBayOfficialTime.Text = api.AbstractResponse.Timestamp.ToString();
                this.lbInfo.Text = "Congratulation ! You have completed the setup and are ready to use eBay APIs.";
            }
            catch(Exception ex)
            {
                this.txtStatus.Text = "Failure";
                MessageBox.Show("Operation failed!\n"+ex.Message, "Status", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 6
0
 private bool initialize()
 {
     GeteBayOfficialTimeCall apiCall = new GeteBayOfficialTimeCall(context);
     try
     {
         string eBayTime = apiCall.GeteBayOfficialTime().ToString();
         Console.WriteLine(eBayTime);
         return true;
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message + "\r\nPlease check Configuration","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
         return false;
     }
 }
Exemplo n.º 7
0
 public DateTime OfficialTime()
 {
     var officialTimeCall = new GeteBayOfficialTimeCall(this.ApiContext);
     return officialTimeCall.GeteBayOfficialTime();
 }