| | |
| | | try |
| | | { |
| | | var _value = msg["model"].ToString(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | LogService.Write("éè´ä»·æ ¼" + _value); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | ListModels oListModels = new ListModels(); |
| | | List<Model.ClsGy_MatePriceSup_Model> lsmain = new List<Model.ClsGy_MatePriceSup_Model>(); |
| | | lsmain = oListModels.getObjectByJson_Gy_MatePriceSup(_value); |
| | | string sql = string.Empty; |
| | | //ä¿å |
| | | oCN.BeginTran(); |
| | | sql = $"delete Gy_MatePriceSup where HItemID = {lsmain[0].HItemID}"; |
| | | oCN.RunProc(sql); |
| | | sql = "set identity_insert Gy_MatePriceSup on"; |
| | | oCN.RunProc(sql); |
| | | |
| | | oCN.RunProc($@"insert into Gy_MatePriceSup(HItemID,HInterID,HEntryID,HMaterID,HRelationID,HUnitID,HBeginQty,HEndQty,HCurID,HType |
| | | foreach (var item in lsmain) |
| | | { |
| | | sql = $"delete Gy_MatePriceSup where HItemID = {item.HItemID}"; |
| | | oCN.RunProc(sql); |
| | | sql = "set identity_insert Gy_MatePriceSup on"; |
| | | oCN.RunProc(sql); |
| | | |
| | | |
| | | LogService.Write("éè´ä»·æ ¼" + $@" insert into Gy_MatePriceSup(HItemID,HNumber,HInterID,HEntryID,HMaterID,HRelationID,HUnitID,HBeginQty,HEndQty,HCurID,HType |
| | | ,HPrice,HBeginDate,HEndDate,HUsed,HRemark,HMaker,HMakeDate) |
| | | values({lsmain[0].HItemID},{lsmain[0].HInterID},{lsmain[0].HEntryID},{lsmain[0].HMaterID},{lsmain[0].HRelationID},{lsmain[0].HUnitID},{lsmain[0].HBeginQty},{lsmain[0].HEndQty},{lsmain[0].HCurID},'{lsmain[0].HType}',{lsmain[0].HPrice},'{lsmain[0].HBeginDate}','{lsmain[0].HEndDate}','{lsmain[0].HUsed}','{lsmain[0].HRemark}','{lsmain[0].HMaker}','{lsmain[0].HMakeDate}')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | sql = "set identity_insert Gy_MatePriceSup off"; |
| | | oCN.RunProc(sql); |
| | | values({item.HItemID},'{item.HNumber}',{item.HInterID},{item.HEntryID},{item.HMaterID},{item.HRelationID},{item.HUnitID},{item.HBeginQty},{item.HEndQty},{item.HCurID},'{item.HType}',{item.HPrice},'{item.HBeginDate}','{item.HEndDate}','{item.HUsed}','{item.HRemark}','{item.HMaker}','{item.HMakeDate}')"); |
| | | |
| | | |
| | | oCN.RunProc($@"insert into Gy_MatePriceSup(HItemID,HNumber,HInterID,HEntryID,HMaterID,HRelationID,HUnitID,HBeginQty,HEndQty,HCurID,HType |
| | | ,HPrice,HBeginDate,HEndDate,HUsed,HRemark,HMaker,HMakeDate) |
| | | values({item.HItemID},'{item.HNumber}',{item.HInterID},{item.HEntryID},{item.HMaterID},{item.HRelationID},{item.HUnitID},{item.HBeginQty},{item.HEndQty},{item.HCurID},'{item.HType}',{item.HPrice},'{item.HBeginDate}','{item.HEndDate}','{item.HUsed}','{item.HRemark}','{item.HMaker}','{item.HMakeDate}')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | sql = "set identity_insert Gy_MatePriceSup off"; |
| | | oCN.RunProc(sql); |
| | | |
| | | } |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region éè´ä»·ç® éè¶åæ¥ |
| | | [Route("Gy_MatePriceSup/SaveGy_PurPriceApi")] |
| | | [HttpPost] |
| | | public object SaveGy_PurPriceApi([FromBody] JObject msg) |
| | | { |
| | | try |
| | | { |
| | | var _value = msg["model"].ToString(); |
| | | LogService.Write("éè´ä»·ç®" + _value); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | ListModels oListModels = new ListModels(); |
| | | List<Model.ClsGy_PurPrice_Model> lsmain = new List<Model.ClsGy_PurPrice_Model>(); |
| | | lsmain = oListModels.getObjectByJson_Gy_PurPrice(_value); |
| | | string sql = string.Empty; |
| | | //ä¿å |
| | | oCN.BeginTran(); |
| | | |
| | | foreach (var item in lsmain) |
| | | { |
| | | sql = $"delete Gy_PurPriceList where HItemID = {item.HItemID}"; |
| | | oCN.RunProc(sql); |
| | | sql = "set identity_insert Gy_PurPriceList on"; |
| | | oCN.RunProc(sql); |
| | | |
| | | LogService.Write("éè´ä»·ç®" + $@" insert into Gy_PurPriceList(HItemID, HNumber, HName, HShortNumber, HParentID, HLevel, |
| | | HEndFlag, HStopflag, HRemark, HUseFlag, HCREATEORGID, HUSEORGID, |
| | | HMakeEmp, HMakeTime, HCheckEmp, HCheckTime,HModifyEmp, HModifyTime, HStopEmp, HStopTime, |
| | | HPURCHASEORGID, HSupID, HCurID, HPRICER, HPRICETYPE, HPRICEOBJECT,HISINCLUDEDTAX, HDEFPRICELISTID, HSUPPLIERMASTERID) |
| | | values({item.HItemID},'{item.HNumber}','{item.HName}','{item.HShortNumber}',{item.HParentID},{item.HLevel}, |
| | | '{item.HEndFlag}','{item.HStopflag}','{item.HRemark}','{item.HUseFlag}',{item.HCREATEORGID},{item.HUSEORGID}, |
| | | {item.HMakeEmp},'{item.HMakeTime}',{item.HCheckEmp},'{item.HCheckTime}',{item.HModifyEmp},'{item.HModifyTime}',{item.HStopEmp},'{item.HStopTime}', |
| | | {item.HPURCHASEORGID},{item.HSupID},{item.HCurID},{item.HPRICER},{item.HPRICETYPE},'{item.HPRICEOBJECT}','{item.HISINCLUDEDTAX}','{item.HDEFPRICELISTID}','{item.HSUPPLIERMASTERID}')"); |
| | | |
| | | oCN.RunProc($@"insert into Gy_PurPriceList(HItemID, HNumber, HName, HShortNumber, HParentID, HLevel, |
| | | HEndFlag, HStopflag, HRemark, HUseFlag, HCREATEORGID, HUSEORGID, |
| | | HMakeEmp, HMakeTime, HCheckEmp, HCheckTime,HModifyEmp, HModifyTime, HStopEmp, HStopTime, |
| | | HPURCHASEORGID, HSupID, HCurID, HPRICER, HPRICETYPE, HPRICEOBJECT,HISINCLUDEDTAX, HDEFPRICELISTID, HSUPPLIERMASTERID) |
| | | values({item.HItemID},'{item.HNumber}','{item.HName}','{item.HShortNumber}',{item.HParentID},{item.HLevel}, |
| | | '{item.HEndFlag}','{item.HStopflag}','{item.HRemark}','{item.HUseFlag}',{item.HCREATEORGID},{item.HUSEORGID}, |
| | | {item.HMakeEmp},'{item.HMakeTime}',{item.HCheckEmp},'{item.HCheckTime}',{item.HModifyEmp},'{item.HModifyTime}',{item.HStopEmp},'{item.HStopTime}', |
| | | {item.HPURCHASEORGID},{item.HSupID},{item.HCurID},{item.HPRICER},{item.HPRICETYPE},'{item.HPRICEOBJECT}','{item.HISINCLUDEDTAX}','{item.HDEFPRICELISTID}','{item.HSUPPLIERMASTERID}')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | sql = "set identity_insert Gy_PurPriceList off"; |
| | | oCN.RunProc(sql); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |