private void sorteListTableDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (IsANonHeaderLinkCell(e)) { } else if (IsANonHeaderButtonCell(e)) { if (isFirst) { sorteGoodList goodsList = new sorteGoodList(this); ConstantUtil.sortelist = this; ConstantUtil.Branchds = ds; ConstantUtil.index = e.RowIndex; ConstantUtil.street = sorteListTableDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex + 2].Value.ToString(); ConstantUtil.main = goodsList; goodsList.Show(); this.Hide(); } else { ConstantUtil.main.Show(); ConstantUtil.index = e.RowIndex; ConstantUtil.main.setSelectValue(); this.Hide(); } isFirst = false; } }
private void sorteList_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { leaveButton_Click(this, EventArgs.Empty); } else if (e.KeyCode == Keys.F1) { if ("1".Equals(isExist)) { MessageBox.Show("已选择唯一分拣单,无需重复选择", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); return; } else if ("0".Equals(isExist)) { MessageBox.Show("尚未创建分拣单", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); return; } else { SorteForm sorteForm = new SorteForm(this); sorteForm.StartPosition = FormStartPosition.CenterScreen; sorteForm.Show(); } } else if (e.KeyCode == Keys.Enter) { int index = sorteListTableDataGridView.CurrentCell.RowIndex; if (isFirst) { sorteGoodList goodsList = new sorteGoodList(this); ConstantUtil.main = goodsList; } else { ConstantUtil.main.setSelectValue(); } ConstantUtil.sortelist = this; ConstantUtil.Branchds = ds; ConstantUtil.index = index; ConstantUtil.street = sorteListTableDataGridView.Rows[index].Cells[0].Value.ToString(); ConstantUtil.main.Show(); this.Hide(); isFirst = false; } }