yangle
2023-05-24 b129762a4bb5ec2cde5edf16bc9cbda57c73587d
WarM/ÌõÂë´òÓ¡/Kf_WeighToBarCode.cs
@@ -21,7 +21,6 @@
            InitializeComponent();
        }
        public frmBillQueryCondition_New frmCondition;
        public string ViewName = "Sc_ICMOBillStatus_Tmp";
        public string ModCaption = "称重入库";
        public const string ModName = "85";
        public Int64 HInterID = 0;
@@ -36,6 +35,8 @@
        public Int64 HSourceEntryID = 0;
        public string HSourceBillNo = "";
        public string HSourceBillType = "";
        public Int64 ProcessExchangeInterID = 0;
        public Int64 HSupID = 0;
        public double HSourceQty = 0;
        public string HMaker = DBUtility.ClsPub.CurUserName;
        public Int64 HStockOrgID = DBUtility.ClsPub.HOrgID;
@@ -56,6 +57,7 @@
            cmbHBarCodeType.Items.Clear();
            cmbHBarCodeType.Items.Add("唯一条码");
            DBUtility.Xt_BaseBillFun.Sub_ClearBill(gbUp);
            txtHBarCode.Text = "";
            grdMain.DataSource = null;
            grdSub.DataSource = null;
        }
@@ -65,7 +67,6 @@
        {
            frmCondition = new frmBillQueryCondition_New();
            this.Text = ModCaption;
            initGrid();
            Sub_GetSystemParameter();
        }
@@ -106,6 +107,11 @@
                HInterID = DBUtility.ClsPub.CreateBillID_Prod(HBillType, ref DBUtility.ClsPub.sExeReturnInfo);           //得到新单据ID
                HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(HBillType, ref DBUtility.ClsPub.sExeReturnInfo, true);    //得到新单据号
            }
            else if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1)
            {
                HInterID = DBUtility.ClsPub.CreateBillID_Prod(HBillType, ref DBUtility.ClsPub.sExeReturnInfo);           //得到新单据ID
                HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(HBillType, ref DBUtility.ClsPub.sExeReturnInfo, true);    //得到新单据号
            }
            else
            {
                HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]);
@@ -130,14 +136,18 @@
            GraphicsGrid();
        }
        private void grdSub_Paint(object sender, PaintEventArgs e)
        {
            GraphicsGrid();
        }
        private void GraphicsGrid()
        {
            DBUtility.Xt_BaseBillFun.GraphicsGrid(grdMain);
        }
        private void grdSub_Paint(object sender, PaintEventArgs e)
        {
            GraphicsGridSub();
        }
        private void GraphicsGridSub()
        {
            DBUtility.Xt_BaseBillFun.GraphicsGrid(grdSub);
        }
@@ -557,6 +567,7 @@
            string HRemark = "";
            string HMaterName = "";
            string HMaterModel = "";
            string ProcessExchangeBillNo = "";
            HBarCode = TM;
            HBarCodeType = DBUtility.ClsPub.isStrNull(cmbHBarCodeType.Text);
@@ -567,6 +578,7 @@
            HRemark = DBUtility.ClsPub.isStrNull(txtHRemark.Text);
            HMaterName = DBUtility.ClsPub.isStrNull(txtHMaterName.Text);
            HMaterModel = DBUtility.ClsPub.isStrNull(txtHMaterModel.Text);
            ProcessExchangeBillNo = DBUtility.ClsPub.isStrNull(txtHBillNo.Text);
            try
            {
@@ -579,18 +591,23 @@
                ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
                ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate,HMaterialJQty,HMaterialMQty " +
                ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HGiveAwayFlag " +
                ",HOrderInterID,HOrderEntryID,HOrderBillNo " +
                ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " +
                ") Values ("
                + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString()
                + ",'" + HBatchNo + "',0,0,'" + HMaker + "',getdate(),0," + HQty.ToString()
                + ",'" + HBatchNo + "'," + HSupID.ToString() + ",0,'" + HMaker + "',getdate(),0," + HQty.ToString()
                + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "',''"
                + ", 1,1," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'"
                + ", 0,'',getdate(),'','" + sDate + "'," + HMaterialJQty.ToString() + "," + HMaterialMQty.ToString()
                + ", " + HStockOrgID.ToString() + "," + HStockOrgID.ToString() + ",''," + HInterID.ToString() + ",0"
                + ", " + ProcessExchangeInterID.ToString() + ",0,'" + ProcessExchangeBillNo + "'"
                + ",'" + HMaterName + "','" + HMaterModel + "',''," + HAuxPropID.ToString() + ",'','')");
                //回填最大流水号
                oCn.RunProc("exec h_p_WMS_SetMaxNo_QTY '" + sTMNumber + "',1 ");
                //回填源单临时表HInterID
                oCn.RunProc("update a set a.HInterID=" + HInterID.ToString() + " from KF_WeighSource_Temp a where a.HInterID<>" + HInterID.ToString() + " and a.HMaker='" + HMaker + "' and convert(varchar(10),a.HMakeDate,120)=convert(varchar(10),getdate(),120)");
                //写入条码出入库临时表
                oCn.RunProc("Insert into KF_PonderationBillMain_Temp " +
@@ -644,6 +661,8 @@
            HSourceBillNo = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("生产订单")].Value);
            HSourceBillType = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HSourceBillType")].Value);
            HSourceQty = DBUtility.ClsPub.isDoule(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("数量")].Value);
            ProcessExchangeInterID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("ProcessExchangeInterID")].Value);
            HSupID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HSupID")].Value);
        }
        //返回源单列表信息