| | |
| | | } |
| | | } |
| | | |
| | | #region 币别 金蝶同步 |
| | | [Route("Gy_Currency/SaveGy_CurrencyListApi")] |
| | | [HttpPost] |
| | | public object SaveGy_CurrencyListApi([FromBody] JObject msg) |
| | | { |
| | | try |
| | | { |
| | | var _value = msg["model"].ToString(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | ListModels oListModels = new ListModels(); |
| | | List<Model.ClsGy_Currency_Model> lsmain = new List<Model.ClsGy_Currency_Model>(); |
| | | lsmain = oListModels.getObjectByJson_Gy_Currency(_value); |
| | | string sql = string.Empty; |
| | | //保存 |
| | | oCN.BeginTran(); |
| | | sql = $"delete Gy_Currency where HItemID = {lsmain[0].HItemID}"; |
| | | oCN.RunProc(sql); |
| | | sql = "set identity_insert Gy_Currency on"; |
| | | oCN.RunProc(sql); |
| | | |
| | | oCN.RunProc($@"insert into Gy_Currency(HItemID,HNumber,HName,HShortNumber,HParentID |
| | | ,HLevel,HEndFlag,HStopflag,HRemark,HHelpCode,HScale,HExchangeRate) |
| | | values({lsmain[0].HItemID},'{lsmain[0].HNumber}','{lsmain[0].HName}','{lsmain[0].HShortNumber}',{lsmain[0].HParentID},{lsmain[0].HLevel} |
| | | ,{Convert.ToString(lsmain[0].HEndFlag ? 1 : 0)},{Convert.ToString(lsmain[0].HStopflag ? 1 : 0) },'{lsmain[0].HRemark}','{lsmain[0].HHelpCode}','{lsmain[0].HScale}','{lsmain[0].HExchangeRate}')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //修改上级为非末级代码 |
| | | sql = "set identity_insert Gy_Currency 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 |
| | | |
| | | } |
| | | } |