zzr99
2021-12-30 00eb415bd3e41fdbe0ea2f1297fd57010eaaa6df
WebAPI/Controllers/²©ÈÕ×Ô¶¯É¨ÂëÏß/ScanlineAPIController.cs
@@ -108,6 +108,14 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("Select * from Gy_BarCodeBill where HBarCode='" + list.packagebarcode.ToString().Trim() + "' and HStopflag='1'", "Gy_BarCodeBill");
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    objJsonResult.status = -1;
                    objJsonResult.msg = "此箱条码已作废";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Models.ClsSc_PackUnionBillMain oItem = new ClsSc_PackUnionBillMain();
                oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
@@ -120,7 +128,7 @@
                oItem.HCheckItemNowID = 0;
                oItem.HCheckItemNextID = 0;
                oItem.HCheckFlowID = 0;
                oItem.HRemark = "自动包装线生辰箱条码";
                oItem.HRemark = "自动包装线生成箱条码";
                oItem.HBacker = "";
                oItem.HBackDate = "";
                oItem.HMaker = "";
@@ -219,14 +227,31 @@
        {
            try
            {
                ds = oCN.RunProcReturn("Select * from Gy_BarCodeBill where HBarCode='" + packagebarcode.ToString().Trim() + "'", "Gy_BarCodeBill");
                if (ds == null && ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.status = -1;
                    objJsonResult.msg = "无效箱条码";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("Select * from Gy_BarCodeBill where HBarCode='" + packagebarcode.ToString().Trim() + "' and HStopflag='1'", "Gy_BarCodeBill");
                if (ds != null && ds.Tables[0].Rows.Count>0)
                {
                    objJsonResult.status = -1;
                    objJsonResult.msg = "此箱条码已作废";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //
                oCN.BeginTran();
                //删除子表
                oCN.RunProc("Delete From Sc_PackUnionBillSub  where HBarCode_Pack=" + packagebarcode.ToString());
                oCN.RunProc("Delete From Sc_PackUnionBillSub  where HBarCode_Pack='"+ packagebarcode.ToString() + "'");
                //删除主表
                oCN.RunProc("Delete From Sc_PackUnionBillMain  where HBarCode_Pack=" + packagebarcode.ToString());
                oCN.RunProc("Delete From Sc_PackUnionBillMain  where HBarCode_Pack='" + packagebarcode.ToString() + "'");
                //作废条码档案表
                oCN.RunProc("Update  Gy_BarCodeBill set HStopflag='1'  where HBarCode=" + packagebarcode.ToString());
                oCN.RunProc("Update  Gy_BarCodeBill set HStopflag='1'  where HBarCode='"+ packagebarcode .ToString()+ "'");
                oCN.Commit();