private void ToolStripMenuItemSelectShippingService_Click(object sender, EventArgs e) { FrmSelectShippingService frmSelectShippingService = new FrmSelectShippingService(); frmSelectShippingService.ShowDialog(); KeyValuePair <string, string> shippingServicePair = frmSelectShippingService.SelectedShippingService; if (shippingServicePair.Key == null) { return; } string shippingServiceCode = shippingServicePair.Key; string shippingServiceDesc = shippingServicePair.Value; DataGridViewSelectedRowCollection selectedRows = this.dataGridViewAllOrders.SelectedRows; List <string> orderLineItemIds = new List <string>(); foreach (DataGridViewRow row in selectedRows) { String orderLineItemId = row.Cells[OrderDgv_OrderLineItemIndex].Value.ToString(); if (orderLineItemId == "") { continue; } orderLineItemIds.Add(orderLineItemId); row.Cells[OrderDgv_ShippingServiceIndex].Value = shippingServiceDesc; } EbayTransactionDAL.UpdateTransactionsShippingService(orderLineItemIds, shippingServiceCode, shippingServiceDesc); MessageBox.Show("设置物流方式成功", "", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void ToolStripMenuItemSelectShippingService_Click(object sender, EventArgs e) { FrmSelectShippingService frmSelectShippingService = new FrmSelectShippingService(); frmSelectShippingService.ShowDialog(); KeyValuePair<string, string> shippingServicePair = frmSelectShippingService.SelectedShippingService; if (shippingServicePair.Key == null) return; string shippingServiceCode = shippingServicePair.Key; string shippingServiceDesc = shippingServicePair.Value; DataGridViewSelectedRowCollection selectedRows = this.dataGridViewAllOrders.SelectedRows; List<string> orderLineItemIds = new List<string>(); foreach (DataGridViewRow row in selectedRows) { String orderLineItemId = row.Cells[OrderDgv_OrderLineItemIndex].Value.ToString(); if (orderLineItemId == "") continue; orderLineItemIds.Add(orderLineItemId); row.Cells[OrderDgv_ShippingServiceIndex].Value = shippingServiceDesc; } EbayTransactionDAL.UpdateTransactionsShippingService(orderLineItemIds, shippingServiceCode, shippingServiceDesc); MessageBox.Show("设置物流方式成功", "", MessageBoxButtons.OK, MessageBoxIcon.Information); }