This commit is contained in:
jackchenyang
2024-06-27 17:12:48 +08:00
16 changed files with 218 additions and 102 deletions
@@ -100,7 +100,33 @@ namespace BLL
Model.Batch_BatchTrustItem update = db.Batch_BatchTrustItem.FirstOrDefault(e => e.TrustBatchItemId == trustBatchItemId);
if (update != null)
{
update.IsCancelTrust = isCancelTrust;
var updatePoint = db.Batch_PointBatchItem.FirstOrDefault(e => e.PointBatchItemId == update.PointBatchItemId);
if (updatePoint != null)
{
updatePoint.PointDate = null;
updatePoint.PointState = null;
updatePoint.CutDate = null;////更新批明细 切除日期
updatePoint.IsBuildTrust = null;
updatePoint.JLAudit = null;
updatePoint.GLGSAudit = null;
updatePoint.QTAudit = null;
}
var item = from x in db.Batch_BatchTrustItem where x.TrustBatchId == update.TrustBatchId select x;
// 表示这个批里只有它一条明细,删除主表
if (item.Count() == 1)
{
Model.Batch_BatchTrust delTrust = db.Batch_BatchTrust.FirstOrDefault(x => x.TrustBatchId == update.TrustBatchId);
db.Batch_BatchTrustItem.DeleteOnSubmit(update);
if (delTrust != null)
{
db.Batch_BatchTrust.DeleteOnSubmit(delTrust);
}
}
else
{
db.Batch_BatchTrustItem.DeleteOnSubmit(update);
}
//update.IsCancelTrust = isCancelTrust;
db.SubmitChanges();
}
}