| | |
| | | |
| | | private bool SaveOrUpdateDataWw(SqlSugarScope db, Womcaa mesWomcaa, List<Womcab> mesWomcabss) |
| | | { |
| | | if (mesWomcaa.Id != null) base.DeleteById(mesWomcaa.Id); |
| | | |
| | | if (mesWomcaa.Id != null) |
| | | { |
| | | base.DeleteById(mesWomcaa.Id); |
| | | } |
| | | if (mesWomcabss.Count > 0) |
| | | { |
| | | db.Deleteable<Womcab>().Where(s => s.Eid == mesWomcaa.Erpid).ExecuteCommand(); |
| | | |
| | | } |
| | | var orUpdate = base.Insert(mesWomcaa); |
| | | var baOrUpdate = _womcabWWManager.InsertRange(mesWomcabss); |
| | | if (orUpdate && baOrUpdate) return true; |
| | | |
| | | if (orUpdate && baOrUpdate) |
| | | { |
| | | //定义输入参数 |
| | | var inputParam1 = new SugarParameter("P_WORK_NO", mesWomcaa.Caa001); |
| | | // 定义输出参数 |
| | | var outParam1 = new SugarParameter("c_Result", null, true); |
| | | var outParam2 = new SugarParameter("C_MSG", null, true); |
| | | // 使用 SqlSugar 执行存储过程 |
| | | Db.Ado.ExecuteCommand("BEGIN PRC_UPDATE_DAA(:P_WORK_NO,:c_Result,:C_MSG); END;", inputParam1, outParam1, outParam2); |
| | | // 获取输出参数的值 |
| | | int result = int.Parse((string)outParam1.Value); |
| | | string message = outParam2.Value == DBNull.Value ? string.Empty : (string)outParam2.Value; |
| | | if (result == 1) |
| | | { |
| | | //存储过程失败则事务进行回滚 |
| | | db.Ado.RollbackTran(); |
| | | throw new Exception(message); |
| | | } |
| | | // 提交事务 |
| | | db.Ado.CommitTran(); |
| | | return true; |
| | | } |
| | | |
| | | throw new NotImplementedException("插入或更新失败"); |
| | | } |
| | | |
| | |
| | | Caa012 = Convert.ToDecimal(dto.FQty), |
| | | Caa013 = dto.FBomId, |
| | | Caa015 = dto.FXSHTH, |
| | | Caa015Head = dto.FSaleOrderEntrySeq, |
| | | Caa016 = dto.FDescription, |
| | | Caa017 = 0, |
| | | Caa018 = Convert.ToDecimal(dto.PLAN_ID), |
| | |
| | | SrcBillType = dto.FSrcBillType, |
| | | SrcBillNo = dto.FSrcBillNo, |
| | | SrcBillentryseq = dto.FSrcBillEntrySeq, |
| | | SaleOrderNo = dto.FSaleOrderNo, |
| | | SaleOrderNo = dto.FXSHTH, |
| | | SaleOrderEntryseq = dto.FSaleOrderEntrySeq, |
| | | ForceCloserid = dto.FForceCloserId, |
| | | CloseType = dto.FCloseType, |
| | |
| | | FPURORDERENTRYSEQ = Convert.ToDecimal(dto.FPurOrderEntrySeq), |
| | | FSUBENTRYID = Convert.ToDecimal(dto.fsubentryid), |
| | | FSTOCKINQTY = Convert.ToDecimal(dto.Caa024), |
| | | FNOSTOCKINQTY = Convert.ToDecimal(dto.Caa025) |
| | | FNOSTOCKINQTY = Convert.ToDecimal(dto.Caa025), |
| | | SupplierId = dto.SupplierId, |
| | | FinishedProduct = dto.FinishedProduct |
| | | }; |
| | | if (dto.Type == "5") |
| | | { |