| | |
| | | .IgnoreColumnsNull() |
| | | .ExecuteCommand() > 0; |
| | | |
| | | 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_DAA2(:P_WORK_NO,:c_Result,:C_MSG); END;", |
| | | inputParam1, outParam1, outParam2); |
| | | // 获取输出参数的值 |
| | | var result = int.Parse((string)outParam1.Value); |
| | | var 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("插入或更新失败"); |
| | | } |
| | | |
| | | private bool UpdateData(SqlSugarScope db, Womcaa mesWomcaa, |
| | | List<Womcab> mesWomcabs) |
| | | { |
| | | |
| | | //定义输入参数 |
| | | 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_DAA2(:P_WORK_NO,:c_Result,:C_MSG); END;", |
| | | inputParam1, outParam1, outParam2); |
| | | // 获取输出参数的值 |
| | | var result = int.Parse((string)outParam1.Value); |
| | | var message = outParam2.Value == DBNull.Value |
| | | ? string.Empty |
| | | : (string)outParam2.Value; |
| | | if (result == 1) |
| | | { |
| | | //存储过程失败则事务进行回滚 |
| | | db.Ado.RollbackTran(); |
| | | throw new Exception(message); |
| | | } |
| | | |
| | | // 提交事务 |
| | | db.Ado.CommitTran(); |
| | | |
| | | |
| | | var decimals = mesWomcabs.Select(s => s.Id).ToArray(); |
| | | |
| | | var update = true; |
| | |
| | | |
| | | if (update && insertOrUpdate) |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | throw new NotImplementedException("更新失败"); |
| | |
| | | Sjxs=dto.SJ_xs, |
| | | Nextgx=dto.NEXT_Gx, |
| | | Rks=dto.RKS, |
| | | Khwlbm=dto.KHWLBM, |
| | | //沃尔新增 |
| | | // WR_F_SCDD_SCTZD = dto.F_SCDD_SCTZD |
| | | //WR_F_SCDD_XH = dto.F_SCDD_XH |
| | |
| | | Cab001 = dto.FBillNo, //单据编号 |
| | | Cab002 = dto.FSeq, //序号 |
| | | Cab003 = dto.FMaterialID, //子项物料编码 |
| | | Cab006 = Convert.ToDecimal(dto.FNeedQty), //需求数量 |
| | | MustQty = Convert.ToDecimal(dto.FMustQty), //应发数量 |
| | | // Cab006 = Convert.ToDecimal(dto.FNeedQty), //需求数量 |
| | | Cab006 = Convert.ToDecimal(dto.FMustQty), //应发数量 |
| | | MustQty = Convert.ToDecimal(dto.FNeedQty), //需求数量 |
| | | // MustQty = Convert.ToDecimal(dto.FMustQty), //应发数量 |
| | | Cab007 = Convert.ToDecimal(dto.FPickedQty), //已领数量 |
| | | PositionNo = dto.FPositionNO, //位置号 |
| | | SupplyOrganization = dto.FChildSupplyOrgId, //供应组织 |