| | |
| | | //",HInnerBillNo='" + omodel.HInnerBillNo + "'" + |
| | | //" where HInterID=" + lngBillKey.ToString()); |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Xs_SeOrderBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Xs_SeOrderBill_BeforeSaveCtrl"); |
| | | if (ds == null) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | return false; |
| | | } |
| | | //========================================================= |
| | | |
| | | oCn.BeginTran(); |
| | | string mainSql = "UpDate Xs_SeOrderBillMain set " + |
| | | " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== |
| | | " HBillSubType='" + omodel.HBillSubType + "'" + |
| | | ",HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== |
| | | ",HDate='" + omodel.HDate + "'" + |
| | | ",HYear='" + omodel.HYear.ToString() + "'" + |
| | | ",HPeriod='" + omodel.HPeriod.ToString() + "'" + |
| | |
| | | ",HEmpID=" + omodel.HEmpID.ToString() + |
| | | ",HCurID=" + omodel.HCurID.ToString() + |
| | | ",HExRate=" + omodel.HExRate.ToString() + |
| | | ",HEarnestRate=" + omodel.HEarnestRate.ToString() + |
| | | ",HManagerID=" + omodel.HManagerID.ToString() + |
| | | ",HSellSID=" + omodel.HSellSID.ToString() + |
| | | ",HSSID=" + omodel.HSSID.ToString() + |
| | |
| | | ",HPayCusID=" + omodel.HPayCusID + |
| | | ",HExplanation='" + omodel.HExplanation + "'" + |
| | | ",HLinkMan='" + omodel.HLinkMan + "'" + |
| | | ",HWHID='" + omodel.HWHID + "'" + |
| | | ",HProjectID='" + omodel.HProjectID + "'" + |
| | | ",HLinkPhone='" + omodel.HLinkPhone + "'" + |
| | | " where HInterID=" + lngBillKey.ToString(); |
| | | |
| | |
| | | // ") "); |
| | | |
| | | string subSql = "Insert into Xs_SeOrderBillSub" + |
| | | "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HUnitID,HQty,HPrice,HTaxPrice,HMoney" + |
| | | ",HDiscountRate,HRelTaxPrice,HTaxRate,HTaxMoney,HlineTotal,HlineTotalBB,HDate,HOutStockQty,HInvoiceQty,HRemark,HOrderLevID ) " + |
| | | "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationQty_SellOutCheck,HRelationMoney_SellOutCheck,HRelationQty_ICMO,HRelationQty_SellBack,HRelationQty_SellBackCheck,HRelationMoney,HMaterID,HUnitID,HQty,HPrice,HTaxPrice,HMoney" + |
| | | ",HDiscountRate,HRelTaxPrice,HTaxRate,HTaxMoney,HlineTotal,HlineTotalBB,HDate,HOutStockQty,HInvoiceQty,HRemark,HOrderLevID" + |
| | | ",HCusMaterNumber,HCusModel,HCusMaterName,HisStockGoods,HWHID,HRemark_TL,HRemark_SJG) " + |
| | | "values(" + |
| | | "" + omodel.HInterID + |
| | | "," + oSub.HEntryID + |
| | |
| | | ",'" + (oSub.HSourceBillNo == null ? "" : oSub.HSourceBillNo) + |
| | | "','" + (oSub.HSourceBillType == null ? "" : oSub.HSourceBillType) + |
| | | "'," + oSub.HRelationQty + |
| | | "," + oSub.HRelationQty_SellOutCheck + |
| | | "," + oSub.HRelationMoney_SellOutCheck + |
| | | "," + oSub.HRelationQty_ICMO + |
| | | "," + oSub.HRelationQty_SellBack + |
| | | "," + oSub.HRelationQty_SellBackCheck + |
| | | "," + oSub.HRelationMoney + |
| | | "," + oSub.HMaterID + |
| | | "," + oSub.HUnitID + |
| | |
| | | "," + oSub.HInvoiceQty + |
| | | ",'" + oSub.HRemark + |
| | | "','" + oSub.HOrderLevID + |
| | | "')"; |
| | | "','" + oSub.HCusMaterNumber + |
| | | "','" + oSub.HCusModel + |
| | | "','" + oSub.HCusMaterName + |
| | | "'," + (oSub.HisStockGoods?1:0) + |
| | | ",'" + oSub.HWhID + "'" + |
| | | ",'" + oSub.HRemark_TL + "'" + |
| | | ",'" + oSub.HRemark_SJG + "'" + |
| | | ")"; |
| | | oCn.RunProc(subSql); |
| | | } |
| | | |
| | | //=========================ä¿ååæ§å¶ |
| | | DataSet ds2 = oCn.RunProcReturn("h_p_Xs_SeOrderBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Xs_SeOrderBill_AfterSaveCtrl"); |
| | | if (ds2 == null) |
| | | { |
| | | sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //============================ |
| | | |
| | | // |
| | | //foreach (Model.ClsXs_SeOrderBillSub oSub in DetailColl) |
| | | //{ |
| | |
| | | { |
| | | try |
| | | { |
| | | DataSet ds; |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Xs_SeOrderBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Xs_SeOrderBill_BeforeSaveCtrl"); |
| | | if (ds == null) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | return false; |
| | | } |
| | | //========================================================= |
| | | |
| | | ////å¾å°mainid |
| | | //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | |
| | | //æå
¥ä¸»è¡¨ |
| | | string mainSql = "Insert Into Xs_SeOrderBillMain" + |
| | | "(HYear,HPeriod,HBillType,HBillSubType,HBillStatus,HExplanation" + |
| | | ",HInterID,HBillNo,HDate,HInnerBillNo,HAddress,HDeptID,HCusID,HEmpID,HCurID,HExRate,HManagerID,HSellSID,HSSID,HSSDate,HPayCusID,HRemark,HOrgID,HMaker,HMakeDate,HLinkMan,HLinkPhone" + |
| | | ",HERPInterID,HERPBillType,HSALEORGID,HSALEGROUPID,HRECEIVEID,HSETTLEID,HCHARGEID,HHEADLOCID,HRECCONTACTID,HCORRESPONDORGID,HBUSINESSTYPE) " + |
| | | ",HInterID,HBillNo,HDate,HInnerBillNo,HAddress,HDeptID,HCusID,HEmpID,HCurID,HExRate,HEarnestRate,HManagerID,HSellSID,HSSID,HSSDate,HPayCusID,HRemark,HOrgID,HMaker,HMakeDate,HLinkMan,HLinkPhone" + |
| | | ",HERPInterID,HERPBillType,HSALEORGID,HSALEGROUPID,HRECEIVEID,HSETTLEID,HCHARGEID,HHEADLOCID,HRECCONTACTID,HCORRESPONDORGID,HBUSINESSTYPE,HProjectID,HWHID) " + |
| | | "values(" + |
| | | "" + omodel.HYear + |
| | | "," + omodel.HPeriod + |
| | | ",'" + this.BillType + |
| | | "','" + this.HBillSubType + |
| | | "','" + omodel.HBillSubType + |
| | | "'," + omodel.HBillStatus + |
| | | ",'" + omodel.HExplanation + |
| | | |
| | |
| | | "," + omodel.HEmpID + |
| | | "," + omodel.HCurID + |
| | | "," + omodel.HExRate + |
| | | "," + omodel.HEarnestRate + |
| | | "," + omodel.HManagerID + |
| | | "," + omodel.HSellSID + |
| | | "," + omodel.HSSID + |
| | |
| | | ",'" + omodel.HRemark + |
| | | "'," + omodel.HOrgID + |
| | | ",'" + omodel.HMaker + |
| | | "','" + omodel.HMakeDate + |
| | | "',getdate()" + |
| | | |
| | | "','" + omodel.HLinkMan + |
| | | ",'" + omodel.HLinkMan + |
| | | "','" + omodel.HLinkPhone + |
| | | |
| | | "'," + omodel.HERPInterID + |
| | |
| | | "," + omodel.HRECCONTACTID + |
| | | "," + omodel.HCORRESPONDORGID + |
| | | ",'" + omodel.HBUSINESSTYPE + |
| | | |
| | | "','" + omodel.HProjectID + |
| | | "','" + omodel.HWHID + |
| | | "')"; |
| | | |
| | | oCn.RunProc(mainSql); |
| | |
| | | // "," + oSub.HTaxPrice.ToString() + "," + oSub.HDiscountRate.ToString() + "," + oSub.HRelTaxPrice.ToString() + "," + oSub.HOutStockQty.ToString() + "," + oSub.HInvoiceQty.ToString() + |
| | | // ") "); |
| | | string subSql = "Insert into Xs_SeOrderBillSub" + |
| | | "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HUnitID,HQty,HPrice,HTaxPrice,HMoney" + |
| | | ",HDiscountRate,HRelTaxPrice,HTaxRate,HTaxMoney,HlineTotal,HlineTotalBB,HDate,HOutStockQty,HInvoiceQty,HRemark,HOrderLevID) " + |
| | | "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationQty_SellOutCheck,HRelationMoney_SellOutCheck,HRelationQty_ICMO,HRelationQty_SellBack,HRelationQty_SellBackCheck,HRelationMoney,HMaterID,HUnitID,HQty,HPrice,HTaxPrice,HMoney" + |
| | | ",HDiscountRate,HRelTaxPrice,HTaxRate,HTaxMoney,HlineTotal,HlineTotalBB,HDate,HOutStockQty,HInvoiceQty,HRemark,HOrderLevID" + |
| | | ",HCusMaterNumber,HCusModel,HCusMaterName,HisStockGoods,HWHID,HRemark_TL,HRemark_SJG) " + |
| | | "values(" + |
| | | "" + omodel.HInterID + |
| | | "," + oSub.HEntryID + |
| | |
| | | ",'" + (oSub.HSourceBillNo==null?"":oSub.HSourceBillNo) + |
| | | "','" + (oSub.HSourceBillType==null?"":oSub.HSourceBillType) + |
| | | "'," + oSub.HRelationQty + |
| | | "," + oSub.HRelationQty_SellOutCheck + |
| | | "," + oSub.HRelationMoney_SellOutCheck + |
| | | "," + oSub.HRelationQty_ICMO + |
| | | "," + oSub.HRelationQty_SellBack + |
| | | "," + oSub.HRelationQty_SellBackCheck + |
| | | "," + oSub.HRelationMoney + |
| | | "," + oSub.HMaterID + |
| | | "," + oSub.HUnitID + |
| | |
| | | "," + oSub.HInvoiceQty + |
| | | ",'" + oSub.HRemark + |
| | | "','" + oSub.HOrderLevID + |
| | | "')"; |
| | | "','" + oSub.HCusMaterNumber + |
| | | "','" + oSub.HCusModel + |
| | | "','" + oSub.HCusMaterName + |
| | | "'," + (oSub.HisStockGoods?1:0) + |
| | | ",'" + oSub.HWhID + "'" + |
| | | ",'" + oSub.HRemark_TL + "'" + |
| | | ",'" + oSub.HRemark_SJG + "'" + |
| | | ")"; |
| | | oCn.RunProc(subSql); |
| | | } |
| | | |
| | | //=========================ä¿ååæ§å¶ |
| | | DataSet ds2 = oCn.RunProcReturn("h_p_Xs_SeOrderBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Xs_SeOrderBill_AfterSaveCtrl"); |
| | | if (ds2 == null) |
| | | { |
| | | sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //============================ |
| | | |
| | | |
| | | // |
| | | //foreach (Model.ClsXs_SeOrderBillSub oSub in DetailColl) |
| | | //{ |
| | |
| | | omodel.HCusID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCusID"]); |
| | | omodel.HCurID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCurID"]); |
| | | omodel.HExRate = DBUtility.ClsPub.isSingle(Ds.Tables[0].Rows[0]["HExRate"]); |
| | | omodel.HEarnestRate = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HEarnestRate"]); |
| | | omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]); |
| | | omodel.HManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HManagerID"]); |
| | | omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); |
| | |
| | | oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); |
| | | oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim(); |
| | | //=================================================== |
| | | oSub.HRelationQty_SellOutCheck = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty_SellOutCheck"]); |
| | | oSub.HRelationMoney_SellOutCheck = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney_SellOutCheck"]); |
| | | oSub.HRelationQty_ICMO = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty_ICMO"]); |
| | | oSub.HRelationQty_SellBack = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty_SellBack"]); |
| | | oSub.HRelationQty_SellBackCheck = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty_SellBackCheck"]); |
| | | //=================================================== |
| | | oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]); |
| | | oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]); |
| | | oSub.HQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]); |
| | |
| | | oSub.HRelTaxPrice = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelTaxPrice"]); |
| | | oSub.HOutStockQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HOutStockQty"]); |
| | | oSub.HInvoiceQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HInvoiceQty"]); |
| | | |
| | | oSub.HisStockGoods = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HisStockGoods"]) == 1 ? true : false; |
| | | |
| | | oSub.HRemark_TL = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[0]["HRemark_TL"]); |
| | | oSub.HRemark_SJG = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[0]["HRemark_SJG"]); |
| | | |
| | | DetailColl.Add(oSub); |
| | | } |
| | | sReturn = "æ¾ç¤ºåæ®æåï¼"; |