| | |
| | | { |
| | | oCn.RunProc("exec h_p_Xs_UpDateRelation_SeOrderToSellOut_Delete " + lngBillKey.ToString()); |
| | | } |
| | | else if (DetailColl[0].HSourceBillType == "1402") //åè´§éç¥å |
| | | { |
| | | oCn.RunProc("exec h_p_Xs_UpDateRelation_SeOutStockToPOStockIn_Delete " + lngBillKey.ToString()); |
| | | } |
| | | else |
| | | { |
| | | |
| | |
| | | { |
| | | oCn.RunProc("exec h_p_Xs_UpDateRelation_SeOrderToSellOut_Add " + lngBillKey.ToString()); |
| | | } |
| | | else if(DetailColl[0].HSourceBillType == "1402") //åè´§éç¥å |
| | | { |
| | | oCn.RunProc("exec h_p_Xs_UpDateRelation_SeOutStockToPOStockIn_Add " + lngBillKey.ToString()); |
| | | } |
| | | else |
| | | { |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Kf_SellOutBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Kf_SellOutBill_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(); |
| | | |
| | |
| | | ",HSTOCKORGID = " + omodel.HOrgID + "" + |
| | | ",HOWNERID = " + omodel.HOrgID + "" + |
| | | ",HOrgID = " + omodel.HOrgID + "" + |
| | | ",HBillNo='" + omodel.HBillNo + "'" + |
| | | ",HMainSourceInterID = " + omodel.HMainSourceInterID + "" + |
| | | ",HMainSourceEntryID = " + omodel.HMainSourceEntryID + "" + |
| | | ",HMainSourceBillNo = '" + omodel.HMainSourceBillNo + "'" + |
| | |
| | | ",HInnerBillNo = '" + omodel.HInnerBillNo + "'" + |
| | | ",HCarriage = " + omodel.HCarriage + "" + |
| | | ",HCheckStatusMan = '" + omodel.HCheckStatusMan + "'" + |
| | | ",HProjectID = '" + omodel.HProjectID.ToString() + "'" + |
| | | ",HGroupID = '" + omodel.HGroupID.ToString() + "'" + |
| | | ",HPriceType = '" + omodel.HPriceType + "'" + |
| | | " where HInterID = " + lngBillKey; |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc(mainSql); |
| | |
| | | " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" + |
| | | ",HMaterID,HUnitID,HQtyMust,HQty,HPrice,HMoney,HTaxPrice,HTaxRate,HTaxMoney,HWHID" + |
| | | ",HMaterID,HUnitID,HQtyMust,HQty,HPieceQty,HPrice,HMoney,HTaxPrice,HTaxRate,HTaxMoney,HWHID" + |
| | | |
| | | ",HSPID,HSCWHID,HSCSPID,HSPGroupID,HBatchNo,HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo" + |
| | | ",HQty_Full,HQty_Empty,HQty_Back,HCostPrice,HCostMoney,HSalePrice" + |
| | |
| | | "," + oSub.HUnitID.ToString() + "" + |
| | | "," + oSub.HQtyMust.ToString() + "" + |
| | | "," + oSub.HQty.ToString() + "" + |
| | | "," + oSub.HPieceQty.ToString() + "" + |
| | | "," + oSub.HPrice.ToString() + "" + |
| | | "," + oSub.HMoney.ToString() + "" + |
| | | "," + oSub.HTaxPrice.ToString() + "" + |
| | |
| | | AddNewRelation(ref sReturn, omodel.HInterID); |
| | | //æ§å¶å
³èæ°é |
| | | |
| | | //=========================ä¿ååæ§å¶ |
| | | DataSet ds2 = oCn.RunProcReturn("Exec h_p_Kf_SellOutBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Kf_SellOutBill_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; |
| | | } |
| | | //============================ |
| | | |
| | | |
| | | // |
| | | sReturn = "ä¿®æ¹åæ®æåï¼"; |
| | | oCn.Commit(); |
| | |
| | | { |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Kf_SellOutBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Kf_SellOutBill_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(); |
| | | //主表 |
| | |
| | | ",HDeptID,HManagerID,HEmpID,HSupID,HSecManagerID,HKeeperID,HWHID,HSCWHID,HCurID,HExRate,HSellSID,HLinkMan,HLinkPhone" + |
| | | ",HSeOrderBillNo" + |
| | | ",HConveyCompID,HConveyTypeID,HConveyMoney" + |
| | | ",HExplanation,HInnerBillNo,HRedBlueFlag,HCarriage,HCheckStatusMan" + |
| | | ",HExplanation,HInnerBillNo,HRedBlueFlag,HCarriage,HCheckStatusMan,HProjectID,HGroupID,HPriceType" + |
| | | ") " + |
| | | "values(" + |
| | | "" + omodel.HInterID.ToString() + "" + |
| | |
| | | "," + omodel.HYear.ToString() + "" + |
| | | "," + omodel.HPeriod.ToString() + "" + |
| | | ",'" + this.BillType + "'" + |
| | | ",'" + this.HBillSubType + "'" + |
| | | ",'" + omodel.HBillSubType + "'" + |
| | | ",'" + omodel.HRemark + "'" + |
| | | ",'" + omodel.HMaker + "'" + |
| | | "," + "getdate()" + "" + |
| | |
| | | "," + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + "" + |
| | | "," + omodel.HCarriage + "" + |
| | | ",'" + omodel.HCheckStatusMan + "'" + |
| | | ",'" + omodel.HProjectID.ToString() + "'" + |
| | | ",'" + omodel.HGroupID.ToString() + "'" + |
| | | ",'" + omodel.HPriceType + "'" + |
| | | ") "; |
| | | |
| | | oCn.RunProc(mainSql); |
| | |
| | | " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" + |
| | | ",HMaterID,HUnitID,HQtyMust,HQty,HPrice,HMoney,HTaxPrice,HTaxRate,HTaxMoney,HWHID" + |
| | | ",HMaterID,HUnitID,HQtyMust,HQty,HPieceQty,HPrice,HMoney,HTaxPrice,HTaxRate,HTaxMoney,HWHID" + |
| | | |
| | | ",HSPID,HSCWHID,HSCSPID,HSPGroupID,HBatchNo,HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo" + |
| | | ",HQty_Full,HQty_Empty,HQty_Back,HCostPrice,HCostMoney,HSalePrice" + |
| | |
| | | "," + oSub.HUnitID.ToString() + "" + |
| | | "," + oSub.HQtyMust.ToString() + "" + |
| | | "," + oSub.HQty.ToString() + "" + |
| | | "," + oSub.HPieceQty.ToString() + "" + |
| | | "," + oSub.HPrice.ToString() + "" + |
| | | "," + oSub.HMoney.ToString() + "" + |
| | | "," + oSub.HTaxPrice.ToString() + "" + |
| | |
| | | //æ§å¶å
³èæ°é |
| | | |
| | | // |
| | | //=========================ä¿ååæ§å¶ |
| | | DataSet ds2 = oCn.RunProcReturn("Exec h_p_Kf_SellOutBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Kf_SellOutBill_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; |
| | | } |
| | | //============================ |
| | | |
| | | |
| | | sReturn = "æ°å¢åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | |
| | | oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]); |
| | | oSub.HQtyMust = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQtyMust"]); |
| | | oSub.HQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]); |
| | | oSub.HPieceQty = DBUtility.ClsPub.isInt(DsSub.Tables[0].Rows[i]["HPieceQty"]); |
| | | oSub.HPrice = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HPrice"]); |
| | | oSub.HMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HMoney"]); |
| | | oSub.HSalePrice = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HSalePrice"]); |