private void dtgvOrders_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewRow curRow = dtgvOrders.CurrentRow; if (null != curRow) { Order order = new Order(); order.Amount = StringUtil.Obj2Decimal(curRow.Cells[colAmount.Name].Value); order.OrderNO__PK = StringUtil.Obj2Str(curRow.Cells[colOrderNO.Name].Value); order.CustName = StringUtil.Obj2Str(curRow.Cells[colCustName.Name].Value); StockInOrderDetailForm detailForm = new StockInOrderDetailForm(order, stockinManager); detailForm.ShowDialog(); } }
private void dtgvOrders_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (null == dtgvOrders.CurrentRow) { return; } if (cboxBillSuppliers.SelectedIndex == -1) { return; } Customer supplier = cboxBillSuppliers.SelectedItem as Customer; Order order = new Order(); order.CustName = supplier.CName; order.CustID = supplier.CID__PK; order.OrderNO__PK = StringUtil.Obj2Str(dtgvOrders.CurrentRow.Cells["colOrderNO"].Value); order.Amount = StringUtil.Obj2Decimal(dtgvOrders.CurrentRow.Cells["colAmount"].Value); order.Direct = StringUtil.Obj2Str(dtgvOrders.CurrentRow.Cells["colDirect"].Value); if (DIRECT.STOCK_IN == order.Direct) { if (null == stockinManager) { stockinManager = InterfaceProxyGenerator.CreateInterfaceProxy <IStockInManager>(MainForm.usr); } StockInOrderDetailForm detailForm = new StockInOrderDetailForm(order, stockinManager); detailForm.ShowDialog(); } else if (DIRECT.REFUND2SUPPLIER == order.Direct) { if (null == refundManager) { refundManager = InterfaceProxyGenerator.CreateInterfaceProxy <IRefund2SupplierManager>(MainForm.usr); } RefundOrderDetailForm detailForm = new RefundOrderDetailForm(order, refundManager); detailForm.ShowDialog(); } }