Exemplo n.º 1
0
        /// <summary>
        /// 查找物品
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnFindCode_Click(object sender, EventArgs e)
        {
            try
            {
                ClearControl();

                FormQueryInfo        form             = QueryInfoDialog.GetOrderFormGoodsDialog(m_billInfo.OrderBill_ID, true);
                IOrderFormInfoServer serviceOrderForm = ServerModuleFactory.GetServerModule <IOrderFormInfoServer>();
                View_B_OrderFormInfo orderInfo        = serviceOrderForm.GetOrderFormInfo(m_billInfo.OrderBill_ID);
                if (form != null && form.ShowDialog() == DialogResult.OK)
                {
                    txtCode.Text = (string)form.GetDataItem("图号型号");
                    txtName.Text = (string)form.GetDataItem("物品名称");
                    txtSpec.Text = (string)form.GetDataItem("规格");

                    IBargainGoodsServer serviceGoodsInfo = ServerModuleFactory.GetServerModule <IBargainGoodsServer>();
                    numUnitPrice.Value = serviceGoodsInfo.GetGoodsUnitPrice(m_billInfo.OrderBill_ID, Convert.ToInt32(form.GetDataItem("物品ID")), orderInfo.供货单位);

                    numGoodsAmount.Value = (decimal)form.GetDataItem("订货数量");

                    View_F_GoodsPlanCost planCost = GetBasicGoodsInfo(txtCode.Text, txtName.Text, txtSpec.Text, numUnitPrice.Value);

                    if (planCost != null)
                    {
                        cmbUnit.Text           = planCost.单位;
                        numPlanUnitPrice.Value = planCost.单价;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageDialog.ShowPromptMessage(ex.Message);
                return;
            }
        }
        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.º 3
0
        /// <summary>
        /// 查找图号型号
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnFindCode_Click(object sender, EventArgs e)
        {
            if (txtBargainNumber.Text.Length == 0)
            {
                txtBargainNumber.Focus();
                MessageDialog.ShowPromptMessage("请先选择合同号后再进行此操作!");
                return;
            }

            FormQueryInfo form = QueryInfoDialog.GetOrderFormGoodsDialog(txtProvider.Text);

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