|  |  | 
 |  |  |             WebS.WebService1 oWebs = new WebS.WebService1(); | 
 |  |  |             if (oWebs.set_SavePOStockInBackBill_New(oMain, sHSourceType, ref sErrMsg)) | 
 |  |  |             { | 
 |  |  |                 sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 //sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 return true; | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  | 
 |  |  |             WebS.WebService1 oWebs = new WebS.WebService1(); | 
 |  |  |             if (oWebs.set_SaveEntrustInBackBill_New(oMain, sHSourceType, ref sErrMsg)) | 
 |  |  |             { | 
 |  |  |                 sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 //sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 return true; | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  | 
 |  |  |             WebS.WebService1 oWebs = new WebS.WebService1(); | 
 |  |  |             if (oWebs.set_SaveProductInBackBill_New(oMain, sHSourceType, ref sErrMsg)) | 
 |  |  |             { | 
 |  |  |                 sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 //sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 return true; | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  | 
 |  |  |             WebS.WebService1 oWebs = new WebS.WebService1(); | 
 |  |  |             if (oWebs.set_SaveMateOutBackBill_New(oMain, sHSourceType, ref sErrMsg)) | 
 |  |  |             { | 
 |  |  |                 sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 //sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 return true; | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  | 
 |  |  |             WebS.WebService1 oWebs = new WebS.WebService1(); | 
 |  |  |             if (oWebs.set_SaveSellOutBackBill_New(oMain, sHSourceType, ref sErrMsg)) | 
 |  |  |             { | 
 |  |  |                 sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 //sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 return true; | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         //根据托条码  获取条码档案列表唯一码信息 | 
 |  |  |         public DataSet GetBarCode(string HBarCode) | 
 |  |  |         { | 
 |  |  |             SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); | 
 |  |  |             // | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 DataSet DS = oCn.RunProcReturn("select HBarCode,HQty from Sc_PackUnionBillSub where HBarCode_Pack ='" + HBarCode.ToString() + "'", "Sc_PackUnionBillSub", ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                 //DataSet DS = oCn.RunProcReturn("Select * from h_v_Sc_AssemblyBill Where HInterID=" + HInterID.ToString() + " and HBillType='" + sBillType + "' " + sWhere, "h_v_Sc_AssemblyBill", ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                 if (DS.Tables[0].Rows.Count == 0) | 
 |  |  |                     return null; | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     return DS; | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |             catch (Exception e) | 
 |  |  |             { | 
 |  |  |                 throw (e); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         public DataSet GetHBW(long HBadType) | 
 |  |  |         { | 
 |  |  |             SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); | 
 |  |  | 
 |  |  |             WebS.WebService1 oWebs = new WebS.WebService1(); | 
 |  |  |             if (oWebs.set_SaveMoveStockBill(oMain, sHSourceType, ref sErrMsg)) | 
 |  |  |             { | 
 |  |  |                 sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 //sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 return true; | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  | 
 |  |  |             //return false; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         //public bool set_SaveMoveStockBill_PD(WebAPI.WebS.ClsKf_MoveStockBillMain oMain, string sHSourceType, ref string sErrMsg) | 
 |  |  |         //{ | 
 |  |  |         //    WebS.WebService1 oWebs = new WebS.WebService1(); | 
 |  |  |         //    if (oWebs.set_SaveMoveStockBill_PD(oMain, sHSourceType, ref sErrMsg)) | 
 |  |  |         //    { | 
 |  |  |         //        sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |         //        return true; | 
 |  |  |         //    } | 
 |  |  |         //    else | 
 |  |  |         //    { | 
 |  |  |         //        sErrMsg = "单据号:" + oMain.HBillNo + ", 单据ID:" + oMain.HInterID + ";" + sErrMsg; | 
 |  |  |         //        return false; | 
 |  |  |         //    } | 
 |  |  |  | 
 |  |  |         //} | 
 |  |  |  | 
 |  |  |         public bool set_MoveStockStepOutBill(WebAPI.WebS.ClsKf_MoveStockStepOutBillMain oMain, string sHSourceType, ref string sErrMsg) | 
 |  |  |         { | 
 |  |  |             WebS.WebService1 oWebs = new WebS.WebService1(); | 
 |  |  |             if (oWebs.set_SaveMoveStockStepOutBill_New(oMain, sHSourceType, ref sErrMsg)) | 
 |  |  |             { | 
 |  |  |                 sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 //sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 return true; | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  | 
 |  |  |             //return dal.GetInfoByID_View(HInterID, sBillType, sWhere); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         public bool Get_CheckQtyByBarCode(string sBarcode, long HWHID, long HSPID, long HAuxPropID, string sBatchNo, string HMTONo, double sQty, ref double sRelQty) | 
 |  |  |         { | 
 |  |  |             DAL.ClsKF_PonderationBillMain_Temp_View dal = new DAL.ClsKF_PonderationBillMain_Temp_View(); | 
 |  |  |             if (dal.CheckQtyByBarCode(sBarcode, HWHID, HSPID, HAuxPropID, sBatchNo, HMTONo, sQty, ref sRelQty)) | 
 |  |  |             { | 
 |  |  |                 return true; | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  |             { | 
 |  |  |                 return false; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         public DataSet GetSPInfoByIDandHWHIDandOrg(long sItemID, long sHWHID, long HUSEORGID, ref string sErrMsg) | 
 |  |  |         { | 
 |  |  |             BLL.ClsIF_StockPlace_View bll = new BLL.ClsIF_StockPlace_View(); | 
 |  |  | 
 |  |  |                 //判断是否反写成功 | 
 |  |  |                 if (set_UpdateHStatus(oMain.HInterID, oMain.HExplanation.ToString())) | 
 |  |  |                 { | 
 |  |  |                     sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                     //sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                     return true; | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     sErrMsg = "保存成功!" + oMain.HBillNo + "状态反写失败!"; | 
 |  |  |                     //sErrMsg = "保存成功!" + oMain.HBillNo + "状态反写失败!"; | 
 |  |  |                     return true; | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  | 
 |  |  |                 return false; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         //public bool set_SavePOInStockBill_NEW_Json(WebAPI.WebS.ClsCg_POInStockBillMain oMain, ref string sErrMsg) | 
 |  |  |         //{ | 
 |  |  |         //    //BLL.ClsKf_POStockInBill bll = new BLL.ClsKf_POStockInBill(); | 
 |  |  |         //    //return bll.set_SavePOStockInBill_New(oMain, sHSourceType, ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |         //    WebS.WebService1 oWebs = new WebS.WebService1(); | 
 |  |  |         //    if (oWebs.set_SavePOInStockBill_Json(oMain, ref sErrMsg)) | 
 |  |  |         //    { | 
 |  |  |         //        //判断是否反写成功 | 
 |  |  |         //        //if (set_UpdateHStatus(oMain.HInterID, oMain.HExplanation.ToString())) | 
 |  |  |         //        //{ | 
 |  |  |         //        sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |         //        return true; | 
 |  |  |         //        //} | 
 |  |  |         //        //else | 
 |  |  |         //        //{ | 
 |  |  |         //        //    sErrMsg = "保存成功!" + oMain.HBillNo + "状态反写失败!"; | 
 |  |  |         //        //    return true; | 
 |  |  |         //        //} | 
 |  |  |         //    } | 
 |  |  |         //    else | 
 |  |  |         //    { | 
 |  |  |         //        sErrMsg = "单据号:" + oMain.HBillNo + ", 单据ID:" + oMain.HInterID + ";" + sErrMsg; | 
 |  |  |         //        return false; | 
 |  |  |         //    } | 
 |  |  |         //} | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  | 
 |  |  |                 //    sErrMsg = "保存成功!" + oMain.HBillNo + "状态反写失败!"; | 
 |  |  |                 //    return true; | 
 |  |  |                 //} | 
 |  |  |                 sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 //sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 return true; | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  | 
 |  |  |              WebS.WebService1 oWebs = new WebS.WebService1(); | 
 |  |  |              if (oWebs.set_SaveMateOutBill_New(oMain, sHSourceType, ref sErrMsg)) | 
 |  |  |              { | 
 |  |  |                  sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                  //sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                  return true; | 
 |  |  |              } | 
 |  |  |              else | 
 |  |  | 
 |  |  |                 //判断是否反写成功 | 
 |  |  |                 if (set_UpdateHStatus(oMain.HInterID, oMain.HExplanation.ToString())) | 
 |  |  |                 { | 
 |  |  |                     sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                     //sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                     return true; | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     sErrMsg = "保存成功!" + oMain.HBillNo + "状态反写失败!"; | 
 |  |  |                     //sErrMsg = "保存成功!" + oMain.HBillNo + "状态反写失败!"; | 
 |  |  |                     return true; | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  | 
 |  |  |               WebS.WebService1 oWebs = new WebS.WebService1(); | 
 |  |  |              if (oWebs.set_SaveEntrustOutBackBill_New(oMain, sHSourceType, ref sErrMsg)) | 
 |  |  |              { | 
 |  |  |                  sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                  //sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                  return true; | 
 |  |  |              } | 
 |  |  |              else | 
 |  |  | 
 |  |  |              WebS.WebService1 oWebs = new WebS.WebService1(); | 
 |  |  |              if (oWebs.set_SaveEntrustOutBill_New(oMain, sHSourceType, ref sErrMsg)) | 
 |  |  |              { | 
 |  |  |                  sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                  //sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                  return true; | 
 |  |  |              } | 
 |  |  |              else | 
 |  |  | 
 |  |  |          } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |          //生成其他入库单  | 
 |  |  |          //public bool set_SaveOtherInBill_New(Model.ClsKf_OtherInBillMain oMain, string sHSourceType, ref string sErrMsg) | 
 |  |  |          //{ | 
 |  |  |          //    //获取系统参数 | 
 |  |  |          //    Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); | 
 |  |  |          //    if (oSystemParameter.ShowBill(ref sErrMsg) == false) | 
 |  |  |          //    { | 
 |  |  |          //        sErrMsg = "获取系统参数失败! " + sErrMsg; | 
 |  |  |          //        return false; | 
 |  |  |          //    } | 
 |  |  |          //    // | 
 |  |  |          //    if (oSystemParameter.omodel.Kf_OtherInBill_ERPMode.ToUpper() == "WISE") //判断同步模式是金蝶WISE | 
 |  |  |          //    { | 
 |  |  |          //        if (SaveOtherInBill_K3(oMain, sHSourceType, oSystemParameter.omodel, ref sErrMsg)) | 
 |  |  |          //        { | 
 |  |  |          //            //"保存成功!"; | 
 |  |  |          //            sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |          //            return true; | 
 |  |  |          //        } | 
 |  |  |          //        else | 
 |  |  |          //        { | 
 |  |  |          //            //"保存失败!"; | 
 |  |  |          //            sErrMsg = sErrMsg; | 
 |  |  |          //            return false; | 
 |  |  |          //        } | 
 |  |  |          //    } | 
 |  |  |          //    if (oSystemParameter.omodel.Kf_OtherInBill_ERPMode.ToUpper() == "CLOUD")  //判断同步模式是金蝶CLOUD | 
 |  |  |          //    { | 
 |  |  |          //       ////上传前必填项判断 | 
 |  |  |          //       //if (oMain.HDeptID == 0) | 
 |  |  |          //       //{ | 
 |  |  |          //       //    sErrMsg = "部门没有选择!"; | 
 |  |  |          //       //    return false; | 
 |  |  |          //       //} | 
 |  |  |          //       //同步生成CLOUD单据 | 
 |  |  |          //       //if (SaveOtherInBill_CLD(oMain, sHSourceType, oSystemParameter.omodel, ref sErrMsg) == true) | 
 |  |  |          //       //{ | 
 |  |  |          //       //    //"保存成功!"; | 
 |  |  |          //       //    return true; | 
 |  |  |          //       //} | 
 |  |  |          //       //else | 
 |  |  |          //       //{ | 
 |  |  |          //       //    //"保存失败!"; | 
 |  |  |          //       //    return false; | 
 |  |  |          //       //} | 
 |  |  |          //   } | 
 |  |  |         //生成其他入库单  | 
 |  |  |         //public bool set_SaveOtherInBill_New(Model.ClsKf_OtherInBillMain oMain, string sHSourceType, ref string sErrMsg) | 
 |  |  |         //{ | 
 |  |  |         //    //获取系统参数 | 
 |  |  |         //    Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); | 
 |  |  |         //    if (oSystemParameter.ShowBill(ref sErrMsg) == false) | 
 |  |  |         //    { | 
 |  |  |         //        sErrMsg = "获取系统参数失败! " + sErrMsg; | 
 |  |  |         //        return false; | 
 |  |  |         //    } | 
 |  |  |         //    // | 
 |  |  |         //    if (oSystemParameter.omodel.Kf_OtherInBill_ERPMode.ToUpper() == "WISE") //判断同步模式是金蝶WISE | 
 |  |  |         //    { | 
 |  |  |         //        if (SaveOtherInBill_K3(oMain, sHSourceType, oSystemParameter.omodel, ref sErrMsg)) | 
 |  |  |         //        { | 
 |  |  |         //            //"保存成功!"; | 
 |  |  |         //            sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |         //            return true; | 
 |  |  |         //        } | 
 |  |  |         //        else | 
 |  |  |         //        { | 
 |  |  |         //            //"保存失败!"; | 
 |  |  |         //            sErrMsg = sErrMsg; | 
 |  |  |         //            return false; | 
 |  |  |         //        } | 
 |  |  |         //    } | 
 |  |  |         //    if (oSystemParameter.omodel.Kf_OtherInBill_ERPMode.ToUpper() == "CLOUD")  //判断同步模式是金蝶CLOUD | 
 |  |  |         //    { | 
 |  |  |         //       ////上传前必填项判断 | 
 |  |  |         //       //if (oMain.HDeptID == 0) | 
 |  |  |         //       //{ | 
 |  |  |         //       //    sErrMsg = "部门没有选择!"; | 
 |  |  |         //       //    return false; | 
 |  |  |         //       //} | 
 |  |  |         //       //同步生成CLOUD单据 | 
 |  |  |         //       //if (SaveOtherInBill_CLD(oMain, sHSourceType, oSystemParameter.omodel, ref sErrMsg) == true) | 
 |  |  |         //       //{ | 
 |  |  |         //       //    //"保存成功!"; | 
 |  |  |         //       //    return true; | 
 |  |  |         //       //} | 
 |  |  |         //       //else | 
 |  |  |         //       //{ | 
 |  |  |         //       //    //"保存失败!"; | 
 |  |  |         //       //    return false; | 
 |  |  |         //       //} | 
 |  |  |         //   } | 
 |  |  |  | 
 |  |  |          //    sErrMsg = "保存其他入库单失败!" + sErrMsg; | 
 |  |  |          //    return false; | 
 |  |  |          //} | 
 |  |  |         //    sErrMsg = "保存其他入库单失败!" + sErrMsg; | 
 |  |  |         //    return false; | 
 |  |  |         //} | 
 |  |  |  | 
 |  |  |          public bool set_SaveOtherInBill_New(WebAPI.WebS.ClsKf_OtherInBillMain oMain, string sHSourceType,WebS.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg) | 
 |  |  |          { | 
 |  |  |         public bool set_SaveOtherInBill_New(WebAPI.WebS.ClsKf_OtherInBillMain oMain, string sHSourceType, WebS.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg) | 
 |  |  |         { | 
 |  |  |             WebS.WebService1 oWebs = new WebS.WebService1();//set_SaveOtherInBill_CLD_New | 
 |  |  |             if (oWebs.set_SaveOtherInBill_CLD_New(oMain, sHSourceType,oSystemParameterMain,ref sErrMsg)) | 
 |  |  |             if (oWebs.set_SaveOtherInBill_CLD_New(oMain, sHSourceType, oSystemParameterMain, ref sErrMsg)) | 
 |  |  |             { | 
 |  |  |                 sErrMsg = "保存成功!" + oMain.HBillNo; | 
 |  |  |                 return true; | 
 |  |  | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |         #region [获取默认打印模板] | 
 |  |  |         /// <summary> | 
 |  |  |         /// 默认打印模板 | 
 |  |  |         /// </summary> | 
 |  |  |         /// <param name="sWhere"></param> | 
 |  |  |         /// <param name="sErr"></param> | 
 |  |  |         /// <returns></returns> | 
 |  |  |         public DataSet GetDefaultOpenTmp(string sWhere, ref string sErr) | 
 |  |  |         { | 
 |  |  |             SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); | 
 |  |  |             DataSet ds = new DataSet(); | 
 |  |  |             ds = oCn.RunProcReturn("select * from h_v_IF_OpenTmpList " + sWhere, "h_v_IF_OpenTmpList"); | 
 |  |  |             return ds; | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |         //返回条码临时表 | 
 |  |  |         /// <summary> | 
 |  |  |         /// 返回条码临时表 | 
 |  |  | 
 |  |  |             return dal.GetKf_ICStockBillList(sHBillType, HMaker, HOrgID); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         //返回缓存列表查询已上传列表信息 | 
 |  |  |         public DataSet GetQueryBillUpdateLoad_Json(string BillType, string HBillNo, string HSourceBillNo) | 
 |  |  |         { | 
 |  |  |             DAL.ClsKF_PonderationBillMain_Temp_View dal = new DAL.ClsKF_PonderationBillMain_Temp_View(); | 
 |  |  |             return dal.GetKf_ICStockBillQueryList(BillType, HBillNo, HSourceBillNo); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |     } | 
 |  |  | } |