private void btnSingleDelete_Click(object sender, EventArgs e) { if (dataGridView1.CurrentRow != null && _salesOrder != null && _salesOrder.order != null) { if (_salesOrder.order.Status == 1) { int selectedIndex = dataGridView1.CurrentRow.Index; FormBackGoods form = new FormBackGoods(_salesOrder); form.ShowDialog(); if (form.IsChanged) { Guid orderId = new Guid(dataGridView1.Rows[selectedIndex].Cells["OrderID"].Value.ToString()); SalesOrder salesOrder = SalesOrderService.GetInstance().GetSalesOrderByBillSearch(orderId); _salesOrder = salesOrder; //更新账单信息 dataGridView1.Rows[selectedIndex].Cells["TotalSellPrice"].Value = salesOrder.order.TotalSellPrice.ToString("f2"); dataGridView1.Rows[selectedIndex].Cells["ActualSellPrice"].Value = salesOrder.order.ActualSellPrice.ToString("f2"); dataGridView1.Rows[selectedIndex].Cells["DiscountPrice"].Value = salesOrder.order.DiscountPrice.ToString("f2"); dataGridView1.Rows[selectedIndex].Cells["CutOffPrice"].Value = salesOrder.order.CutOffPrice.ToString("f2"); dataGridView1.Rows[selectedIndex].Cells["ServiceFee"].Value = salesOrder.order.ServiceFee.ToString("f2"); dataGridView1.Rows[selectedIndex].Cells["PaymentMoney"].Value = salesOrder.order.PaymentMoney.ToString("f2"); dataGridView1.Rows[selectedIndex].Cells["NeedChangePay"].Value = salesOrder.order.NeedChangePay.ToString("f2"); dataGridView1.Rows[selectedIndex].Cells["MoreOrLess"].Value = (salesOrder.order.ActualSellPrice + salesOrder.order.ServiceFee - (salesOrder.order.PaymentMoney - salesOrder.order.NeedChangePay)).ToString("f2"); BindDataGridView2(salesOrder); BindDataGridView3(salesOrder); } } } }