private void btnFindCode_Click(object sender, EventArgs e)
        {
            if (lblBillStatus.Text != "新建单据")
            {
                return;
            }

            FormQueryInfo form;

            if (chkPayment.Checked)
            {
                if (txtOrderForm.Text.Length == 0)
                {
                    txtOrderForm.Focus();
                    MessageDialog.ShowPromptMessage(@"请先选择订单/合同号后再进行此操作!");
                    return;
                }

                form = QueryInfoDialog.GetOrderFormGoodsDialog(txtOrderForm.Text, true);
            }
            else
            {
                form = QueryInfoDialog.GetPlanCostGoodsDialog(true);
            }

            if (form == null || form.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            else
            {
                txtCode.Text = form.GetDataItem("图号型号").ToString();
                txtName.Text = form.GetDataItem("物品名称").ToString();
                txtSpec.Text = form.GetDataItem("规格").ToString();

                View_F_GoodsPlanCost tempGoodsInfo = UniversalFunction.GetGoodsInfo(txtCode.Text, txtName.Text, txtSpec.Text);
                txtCode.Tag = tempGoodsInfo.序号;

                DataRow dr = m_serverBom.GetBomInfo(txtCode.Text.Trim(), txtName.Text.Trim());

                if (dr == null)
                {
                    txtVersion.Text = "";
                }
                else
                {
                    txtVersion.Text = dr["Version"].ToString();
                }
            }
        }
Exemplo n.º 2
0
        void txtName_OnCompleteSearch()
        {
            txtName.Text = txtName.DataResult["物品名称"].ToString();
            txtCode.Text = txtName.DataResult["图号型号"].ToString();
            txtSpec.Text = txtName.DataResult["规格"].ToString();

            DataRow dr = m_serverBom.GetBomInfo(txtCode.Text.Trim(), txtName.Text.Trim());

            if (dr == null)
            {
                txtVersion.Text = "";
            }
            else
            {
                txtVersion.Text = dr["Version"].ToString();
            }
        }