/// <summary> /// 单元格双击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvGoods_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewCell cell = dgvGoods.Rows[e.RowIndex].Cells[e.ColumnIndex]; string colName = dgvGoods.Columns[e.ColumnIndex].Name; if (addGoods == 1) { if (colName == "GoodsName") { if (!string.IsNullOrEmpty(txtInStore.Text)) { FrmChooseGoods fGoods = new FrmChooseGoods(); fGoods.Tag = new ChooseModel() { FGet = this, UName = uName, TypeCode = "DgvGoods-StartStock" }; fGoods.SetChooseGoods += SetDgvGoods; fGoods.ShowDialog(); } else { MsgBoxHelper.MsgErrorShow("请先选择入货仓库!"); return; } } } }
/// <summary> /// 双击打开商品选择页面 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvGoods_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { Action act = () => { if (e.RowIndex >= 0) { DataGridViewCell cell = dgvGoods.Rows[e.RowIndex].Cells[e.ColumnIndex]; string colName = dgvGoods.Columns[e.ColumnIndex].Name; if (addGoods == 1) { if (colName == "GoodsName") { if (!string.IsNullOrEmpty(txtOutStore.Text)) { //显示商品选择页面 FrmChooseGoods fGoods = new FrmChooseGoods(); fGoods.Tag = new ChooseModel() { FGet = this, UName = uName, TypeCode = "DgvGoods-SaleOutStore" }; fGoods.SetChooseGoods += SetDgvGoods; fGoods.ShowDialog(); } else { MsgBoxHelper.MsgErrorShow("请先选择出货仓库!"); return; } } } } }; act.TryCatch("删除商品明细出现异常!"); }