private void dgrdInOrder_CurrentCellChanged(object sender, EventArgs e) { try { if (dgrdInOrder.CurrentCell != null) { int currentIndex = dgrdInOrder.CurrentCell.RowIndex; DataRowToorder(_inOrderDt.DefaultView.ToTable().Rows[currentIndex], _currentOrder); ShowCurrentOrder(); DataTable batchDt = _storeQuery.LoadBatchWithDelete(_currentOrder.MakerDicID, (int)_outDept.DeptID); DataRow[] dRows = batchDt.Select("BATCHNUM='" + _currentOrder.BatchNum.ToString() + "'"); if (dRows.Length > 0) { txtCurrentNum.Text = dRows[0]["CURRENTNUM"].ToString(); } else { txtCurrentNum.Clear(); } txtBatchNum.SetSelectionCardDataSource(batchDt); } } catch (Exception error) { MessageBox.Show(error.Message); } }
private void dgrdOrderInfo_CurrentCellChanged(object sender, EventArgs e) { try { if (dgrdOrderInfo.CurrentCell != null) { int currentIndex = dgrdOrderInfo.CurrentCell.RowIndex; DataRowToOutorder(_outOrderDt.DefaultView.ToTable().Rows[currentIndex], _currentOrder); ShowCurrentOrder(); if (!chkShowStoreBatch.Checked) { txtBatchNum.SetSelectionCardDataSource(_storQuery.LoadBatchWithDelete(_currentOrder.MakerDicID, (int)_currentDeptId)); } else { txtBatchNum.SetSelectionCardDataSource(_storQuery.LoadBatch(_currentOrder.MakerDicID, (int)_currentDeptId)); } } } catch (Exception error) { MessageBox.Show(error.Message); } }