zzr99
2021-12-23 bd2d1fb06fe96c991447d87d366e0f7f3024da79
WarM/ÌõÂë´òÓ¡/Gy_BarCodeBill.cs
@@ -1832,7 +1832,14 @@
            //grdMain.Rows[i].Cells[HSourceNumberCol].Value = oTable.Rows[0]["生产线代码"].ToString();
            grdMain.Rows[i].Cells[HSourceNameCol].Value = oTable.Rows[0]["生产线"].ToString();
            grdMain.Rows[i].Cells[HEndDateCol].Value = oTable.Rows[0]["计划完工日期"].ToString();
            grdMain.Rows[i].Cells[HMinQtyCol].Value = oTable.Rows[0]["最小包装数"].ToString();
            if (cmbHBarCodeType.Text == "批次条码" && CampanyName == "博日科技")
            {
                grdMain.Rows[i].Cells[HMinQtyCol].Value = ClsPub.isDoule(oTable.Rows[0]["未生成条码数量"]);
            }
            else
            {
                grdMain.Rows[i].Cells[HMinQtyCol].Value = oTable.Rows[0]["最小包装数"].ToString();
            }
            //--
            //设置可编辑列
            string sAllowCol = HQtyCol.ToString() +
@@ -1882,7 +1889,14 @@
            grdMain.Rows[i].Cells[HUnitNameCol].Value = oTable.Rows[0]["计量单位"].ToString();
            grdMain.Rows[i].Cells[HRemarkCol].Value = oTable.Rows[0]["备注"].ToString();
            grdMain.Rows[i].Cells[HMTONoCol].Value = oTable.Rows[0]["计划跟踪号"].ToString();
            grdMain.Rows[i].Cells[HMinQtyCol].Value = oTable.Rows[0]["最小包装数"].ToString();
            if (cmbHBarCodeType.Text == "批次条码" && CampanyName == "博日科技")
            {
                grdMain.Rows[i].Cells[HMinQtyCol].Value = ClsPub.isDoule(oTable.Rows[0]["未生成条码数量"]);
            }
            else
            {
                grdMain.Rows[i].Cells[HMinQtyCol].Value = oTable.Rows[0]["最小包装数"].ToString();
            }
            grdMain.Rows[i].Cells[HMakerCol].Value = ClsPub.CurUserName;
            if (cmbSourceBillType.Text.Trim() == "收料通知单"|| cmbSourceBillType.Text.Trim() == "采购订单"
                || cmbSourceBillType.Text.Trim() == "委外订单" || cmbSourceBillType.Text.Trim() == "采购入库单")
@@ -2505,6 +2519,106 @@
            }
        }
        private void txtHSourceBillNo_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)Keys.Return)//回车带出源单信息
            {
                long sHOrgID = -1;
                DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View();
                if (oClsGy_ORGANIZATIONS_View.GetInfoByName(cmbHOrgID.Text))
                {
                    sHOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID;
                }
                if (txtHSourceBillNo.Text.Length < 4)
                {
                    MessageBox.Show("请输入4位以上数据!");
                    return;
                }
                //根据源单类型 å’Œæºå•号 èŽ·å–ä¿¡æ¯
                if (cmbSourceBillType.Text.Trim() == "生产订单")
                {
                    DAL.Cls_S_IFCLD_ICMOList oIFCLD_ICMOList = new DAL.Cls_S_IFCLD_ICMOList();
                    if (oIFCLD_ICMOList.RefreshBySourceBillNo(" Where å•据号 like '%" + txtHSourceBillNo.Text + "' and HOrgID =" + sHOrgID.ToString()))  //选择原单
                    {
                        FillSelectData(oIFCLD_ICMOList.oBillSelectColl);
                        txtHSourceBillNo.Text = "";
                    }
                    else
                    {
                        MessageBox.Show("未查询到任务数据,请确认所选组织、源单类型与源单单号是否正确!");
                        return;
                    }
                }
                else if (cmbSourceBillType.Text.Trim() == "生产汇报单")
                {
                    DAL.Cls_S_IF_ICMOReportBillList oIF_ICMOReportBillList = new DAL.Cls_S_IF_ICMOReportBillList();
                    if (oIF_ICMOReportBillList.RefreshBySourceBillNo(" Where å•据号 like '%" + txtHSourceBillNo.Text + "' "))  //选择原单
                    {
                        FillSelectData(oIF_ICMOReportBillList.oBillSelectColl);
                        txtHSourceBillNo.Text = "";
                    }
                    else
                    {
                        MessageBox.Show("未查询到任务数据,请确认所选组织、源单类型与源单单号是否正确!");
                        return;
                    }
                }
                else if (cmbSourceBillType.Text.Trim() == "收料通知单")
                {
                    DAL.Cls_S_IF_POInStockBillList oIF_POInStockBillList = new DAL.Cls_S_IF_POInStockBillList();
                    if (oIF_POInStockBillList.RefreshBySourceBillNo(" Where å•据号 like '%" + txtHSourceBillNo.Text + "' "))  //选择原单
                    {
                        FillSelectData(oIF_POInStockBillList.oBillSelectColl);
                        txtHSourceBillNo.Text = "";
                    }
                    else
                    {
                        MessageBox.Show("未查询到任务数据,请确认所选组织、源单类型与源单单号是否正确!");
                        return;
                    }
                }
                else if (cmbSourceBillType.Text.Trim() == "采购订单")
                {
                    DAL.Cls_S_IF_POOrderBillList oIF_POOrderBillList = new DAL.Cls_S_IF_POOrderBillList();
                    if (oIF_POOrderBillList.RefreshBySourceBillNo(" Where å•据号 like '%" + txtHSourceBillNo.Text + "' "))  //选择原单
                    {
                        FillSelectData(oIF_POOrderBillList.oBillSelectColl);
                        txtHSourceBillNo.Text = "";
                    }
                    else
                    {
                        MessageBox.Show("未查询到任务数据,请确认所选组织、源单类型与源单单号是否正确!");
                        return;
                    }
                }
                else if (cmbSourceBillType.Text.Trim() == "委外订单")
                {
                    DAL.Cls_S_IF_EntrustOrderBillList oIF_EntrustOrderBillList = new DAL.Cls_S_IF_EntrustOrderBillList();
                    if (oIF_EntrustOrderBillList.RefreshBySourceBillNo(" Where å•据号 like '%" + txtHSourceBillNo.Text + "' "))  //选择原单
                    {
                        FillSelectData(oIF_EntrustOrderBillList.oBillSelectColl);
                        txtHSourceBillNo.Text = "";
                    }
                    else
                    {
                        MessageBox.Show("未查询到任务数据,请确认所选组织、源单类型与源单单号是否正确!");
                        return;
                    }
                }
                else
                {
                    MessageBox.Show("所选源单类型,不支持此功能!");
                    return;
                }
            }
        }
    }
}