| | |
| | | } |
| | | } |
| | | |
| | | [Route("Gy_Supplier/SaveGy_SupplierListApi")] |
| | | [HttpPost] |
| | | public object SaveGy_SupplierListApi([FromBody] JObject msg) |
| | | { |
| | | try |
| | | { |
| | | var _value = msg["model"].ToString(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //反序列化 |
| | | _value = "[" + _value.ToString() + "]"; |
| | | List<Supplier> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Supplier>>(_value); |
| | | string sql = string.Empty; |
| | | //保存 |
| | | oCN.BeginTran(); |
| | | sql = $"delete Gy_Supplier where HItemID = {lsmain[0].HItemID}"; |
| | | oCN.RunProc(sql); |
| | | sql = "set identity_insert Gy_Supplier on"; |
| | | oCN.RunProc(sql); |
| | | oCN.RunProc("Insert Into Gy_Supplier " + |
| | | "(HItemID,HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark" + |
| | | ",HShortName,HAddress,HLinkMan,HLinkPhone,HMobilePhone" + |
| | | ",HFax,HPostalCode,HEmail,HBank,HBankAccount" + |
| | | ",HTaxNum,HTaxRate,HCountry,HCorMan,HEnglishName" + |
| | | ",HEnglishAddress,HCurID,HSSID,HAreaID) " + |
| | | " values('" + lsmain[0].HItemID + "','" + lsmain[0].HNumber + "','" + lsmain[0].HName + "','" + lsmain[0].HHelpCode + "','" + lsmain[0].HShortNumber + "','" + lsmain[0].HParentID + "'" + |
| | | "," + lsmain[0].HLevel + ",0,'" + lsmain[0].HStopflag + "','" + lsmain[0].HRemark + "'" + |
| | | ",'" + lsmain[0].HShortName + "','" + lsmain[0].HAddress + "','" + lsmain[0].HLinkMan + "','" + lsmain[0].HLinkPhone + "','" + lsmain[0].HMobilePhone + "'" + |
| | | ",'" + lsmain[0].HFax + "','" + lsmain[0].HPostalCode + "','" + lsmain[0].HEmail + "','" + lsmain[0].HBank + "','" + lsmain[0].HBankAccount + "'" + |
| | | ",'" + lsmain[0].HTaxNum + "','" + lsmain[0].HTaxRate + "','" + lsmain[0].HCountry + "','" + lsmain[0].HCorMan + "','" + lsmain[0].HEnglishName + "'" + |
| | | ",'" + lsmain[0].HEnglishAddress + "'," + lsmain[0].HCurID + "," + lsmain[0].HSSID + "," + lsmain[0].HAreaID + |
| | | ") "); |
| | | //修改上级为非末级代码 |
| | | sql = "set identity_insert Gy_Supplier 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; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 修改单据-保存按钮 |