private void btnFindCode_Click(object sender, EventArgs e) { if (txtBargainNumber.Text.Length == 0) { txtBargainNumber.Focus(); MessageDialog.ShowPromptMessage("请先选择合同号后再进行此操作!"); return; } FormQueryInfo form = QueryInfoDialog.GetBargainGoodsForOrderFormDialog(txtBargainNumber.Text, true); if (form != null && form.ShowDialog() == DialogResult.OK) { txtCode.Text = form.GetDataItem("图号型号").ToString(); txtName.Text = form.GetDataItem("物品名称").ToString(); txtSpec.Text = form.GetDataItem("规格").ToString(); txtCode.Tag = Convert.ToInt32(form.GetDataItem("物品ID").ToString()); } }