// Upload tracking number to ebay. // While uploading tracking number, ebay requires two fields: // - tracking number // - carrier // Use Ebay API CompleteSale to fulfill this task, see page: // https://developer.ebay.com/DevZone/XML/docs/Reference/ebay/CompleteSale.html private void ToolStripMenuItemUploadTrackingNum_Click(object sender, EventArgs e) { DataGridViewSelectedRowCollection selectedRows = this.dataGridViewAllOrders.SelectedRows; if (selectedRows.Count != 1) { return; } String orderLineItemId = selectedRows[0].Cells[OrderDgv_OrderLineItemIndex].Value.ToString(); EbayTransactionType trans = EbayTransactionDAL.GetOneTransaction(orderLineItemId); if (trans == null) { return; } if (trans.ShippingTrackingNo != "") { MessageBox.Show("该订单已经上传跟踪号", "抱歉", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } FrmUploadTrackingNumber frmUploadTrackingNumber = new FrmUploadTrackingNumber(); frmUploadTrackingNumber.account = AccountUtil.GetAccount(trans.SellerName); frmUploadTrackingNumber.ebayTrans = trans; frmUploadTrackingNumber.Show(); trans = EbayTransactionDAL.GetOneTransaction(orderLineItemId); selectedRows[0].Cells[OrderDgv_TrackingNoIndex].Value = trans.ShippingTrackingNo; }
// Upload tracking number to ebay. // While uploading tracking number, ebay requires two fields: // - tracking number // - carrier // Use Ebay API CompleteSale to fulfill this task, see page: // https://developer.ebay.com/DevZone/XML/docs/Reference/ebay/CompleteSale.html private void ToolStripMenuItemUploadTrackingNum_Click(object sender, EventArgs e) { DataGridViewSelectedRowCollection selectedRows = this.dataGridViewAllOrders.SelectedRows; if (selectedRows.Count != 1) return; String orderLineItemId = selectedRows[0].Cells[OrderDgv_OrderLineItemIndex].Value.ToString(); EbayTransactionType trans = EbayTransactionDAL.GetOneTransaction(orderLineItemId); if (trans == null) return; if (trans.ShippingTrackingNo != "") { MessageBox.Show("该订单已经上传跟踪号", "抱歉", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } FrmUploadTrackingNumber frmUploadTrackingNumber = new FrmUploadTrackingNumber(); frmUploadTrackingNumber.account = AccountUtil.GetAccount(trans.SellerName); frmUploadTrackingNumber.ebayTrans = trans; frmUploadTrackingNumber.Show(); trans = EbayTransactionDAL.GetOneTransaction(orderLineItemId); selectedRows[0].Cells[OrderDgv_TrackingNoIndex].Value = trans.ShippingTrackingNo; }