扫描物料条码,调拨单物料ID取对应源单物料ID值;扫描源单条码调用方法取消事物回滚
1个文件已修改
57 ■■■■■ 已修改文件
DAL/WMS/ClsKF_PonderationBillMain_Temp_Ctl.cs 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/WMS/ClsKF_PonderationBillMain_Temp_Ctl.cs
@@ -368,11 +368,18 @@
                oModel.HQtyMust = 0;
                //如果是有原单则获取 原单中的 物料内码(递入 单据内码、原单类型、原单主内码、原单子内码 ,从TEMP表里获取 对应原单的物料内码);  
                //如果原单不存在则 保留原来的 物料内码.
                //Int64 sSourceMaterID = GetSourceBillMaterID(oModel.HInterID, oModel.HSourceInterID, oModel.HSourceEntryID, oModel.HSourceBillType);
                //if (sSourceMaterID != -1)
                //{
                //    oModel.HMaterID = sSourceMaterID;
                //}
                if (oModel.HBillType == "1207" || oModel.HBillType == "1250" || oModel.HBillType == "1251")
                {
                    Int64 sSourceMaterID = GetSourceBillMaterID(oModel.HInterID, oModel.HSourceInterID, oModel.HSourceEntryID, oModel.HSourceBillType);
                    if (sSourceMaterID != -1)
                    {
                        oModel.HMaterID = sSourceMaterID;
                    }
                    if (oModel.HSourceInterID == 0)
                    {
                        oModel.HSourceBillType = "";
                    }
                }
                //
                oCn.RunProc("Insert into " + MvarItemKey + " " +
                    " (HInterID,HBillNo,HBillType,HMaterID,HProcID,HWhID,HSCWHID" +
@@ -802,57 +809,57 @@
            try
            {
                DataSet oDs = new DataSet();
                oCn.BeginTran();
                //oCn.BeginTran();
                oCn.RunProc("exec h_p_WMS_ERPSourceBillToLocal '" + sSourceBillNo + "','" + sSourceBillType + "'");
                oDs = oCn.RunProcReturn("exec h_p_IF_SourceBill_Check_Add " + sNewInterID.ToString() + ",'" + sNewBillNo + "','" + sNewBillType + "','" + sSourceBillNo + "','" + sSourceBillType + "','" + sRedBlueflag + "'", "h_p_IF_SourceBill_Check_Add");
                if (oDs.Tables[0].Rows.Count == 0 || oDs == null)
                {
                    oCn.Commit();
                    oCn.CnClose();
                    oCn.CnDispose();
                    //oCn.Commit();
                    //oCn.CnClose();
                    //oCn.CnDispose();
                    sReturn = "null未知错误!";
                    return false;
                }
                if (DBUtility.ClsPub.isLong(oDs.Tables[0].Rows[0][0]) == 1)
                {
                    oCn.Commit();
                    oCn.CnClose();
                    oCn.CnDispose();
                    //oCn.Commit();
                    //oCn.CnClose();
                    //oCn.CnDispose();
                    sReturn = "您扫描的源单已经被关联!不能再次操作!";
                    return false;
                }
                else if (DBUtility.ClsPub.isLong(oDs.Tables[0].Rows[0][0]) == 2)
                {
                    //输入源单信息不准确,请输入较完整的单据号
                    oCn.Commit();
                    oCn.CnClose();
                    oCn.CnDispose();
                    //oCn.Commit();
                    //oCn.CnClose();
                    //oCn.CnDispose();
                    sReturn = "输入源单信息不准确,请输入较完整的单据号!";
                    return false;
                }
                else if (DBUtility.ClsPub.isLong(oDs.Tables[0].Rows[0][0]) == 3)
                {
                    //已存在相同单据内码或单据号的单据
                    oCn.Commit();
                    oCn.CnClose();
                    oCn.CnDispose();
                    //oCn.Commit();
                    //oCn.CnClose();
                    //oCn.CnDispose();
                    sReturn = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                else if (DBUtility.ClsPub.isLong(oDs.Tables[0].Rows[0][0]) == 9)
                {
                    //保存成功
                    oCn.Commit();
                    oCn.CnClose();
                    oCn.CnDispose();
                    //oCn.Commit();
                    //oCn.CnClose();
                    //oCn.CnDispose();
                    sReturn = "保存成功!";
                    return true;
                }
                else
                {
                    oCn.Commit();
                    oCn.CnClose();
                    oCn.CnDispose();
                    //oCn.Commit();
                    //oCn.CnClose();
                    //oCn.CnDispose();
                    sReturn = "else未知错误!";
                    return false;
                }
@@ -861,7 +868,7 @@
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                //oCn.RollBack();
                throw (e);
            }
        }