20250624 委托退回

This commit is contained in:
2025-06-24 14:56:11 +08:00
parent 8816de937f
commit 3e35d00626
3 changed files with 129 additions and 68 deletions
@@ -630,13 +630,13 @@ namespace FineUIPro.Web.HJGL.PointTrust
// Model.HJGL_Batch_PointBatch batch = BLL.PointBatchService.GetPointBatchById(this.tvControlItem.SelectedNodeID);
var trust = BLL.Batch_BatchTrustService.GetBatchTrustViewByPointBatchId(reportId);
var CH_WeldMethod = (from batch in Funs.DB.View_Batch_BatchTrustItem
join joint in Funs.DB.View_HJGL_WeldJoint on batch.WeldJointId equals joint.WeldJointId
where batch.TrustBatchId == trust.TrustBatchId
select joint.WeldingMethodCode).Distinct().ToList();
join joint in Funs.DB.View_HJGL_WeldJoint on batch.WeldJointId equals joint.WeldJointId
where batch.TrustBatchId == trust.TrustBatchId
select joint.WeldingMethodCode).Distinct().ToList();
var CH_SlopeType = (from batch in Funs.DB.View_Batch_BatchTrustItem
join joint in Funs.DB.View_HJGL_WeldJoint on batch.WeldJointId equals joint.WeldJointId
where batch.TrustBatchId == trust.TrustBatchId
select joint.GrooveTypeCode).Distinct().ToList();
join joint in Funs.DB.View_HJGL_WeldJoint on batch.WeldJointId equals joint.WeldJointId
where batch.TrustBatchId == trust.TrustBatchId
select joint.GrooveTypeCode).Distinct().ToList();
if (trust != null)
{
string varValue = string.Empty;
@@ -649,7 +649,7 @@ namespace FineUIPro.Web.HJGL.PointTrust
}
if (CH_WeldMethod.Count>0)
if (CH_WeldMethod.Count > 0)
{
dr["CH_WeldMethod"] = string.Join(",", CH_WeldMethod);
}
@@ -677,7 +677,7 @@ namespace FineUIPro.Web.HJGL.PointTrust
var list = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(trust.DetectionRateId);
if (list != null)
{
dr["CH_NDTRate"] = list.DetectionRateValue+"%";
dr["CH_NDTRate"] = list.DetectionRateValue + "%";
}
@@ -989,9 +989,6 @@ namespace FineUIPro.Web.HJGL.PointTrust
}
}
protected void btnBack_Click(object sender, EventArgs e)
{
}
#region
/// <summary>
/// 判断是否可以删除
@@ -1026,5 +1023,60 @@ namespace FineUIPro.Web.HJGL.PointTrust
}
}
#endregion
/// <summary>
/// 退回
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnBack_Click(object sender, EventArgs e)
{
Model.SGGLDB db = Funs.DB;
string trustBatchId = string.Empty;
var lists = this.Grid1.SelectedRowIDArray;
if (lists.Count() > 0)
{
if (lbIsTrust.Text=="未委托")
{
Alert.ShowInTop("未委托,无需退回!", MessageBoxIcon.Warning);
return;
}
foreach (var pointBatchItemId in lists)
{
//删除选中委托单明细
var batchTrustItem = (from x in db.HJGL_Batch_BatchTrustItem where x.PointBatchItemId == pointBatchItemId select x).FirstOrDefault();
if (batchTrustItem != null)
{
trustBatchId = batchTrustItem.TrustBatchId;
BLL.Batch_BatchTrustItemService.DeleteTrustItemByTrustBatchItemId(batchTrustItem.TrustBatchItemId);
}
//修改点口中的委托状态
var pointBatchItem = (from x in db.HJGL_Batch_PointBatchItem where x.PointBatchItemId == pointBatchItemId select x).FirstOrDefault();
if (pointBatchItem != null)
{
if (pointBatchItem.IsBuildTrust != null)
{
pointBatchItem.IsBuildTrust = null;
db.SubmitChanges();
}
}
}
var trustItemList = BLL.Batch_BatchTrustItemService.GetBatchTrustItemByTrustBatchId(trustBatchId);
if (trustItemList.Count == 0)
{
BLL.Batch_BatchTrustService.DeleteBatchTrustById(trustBatchId);
}
PageInfo();
BindGrid();
ShowNotify("退回成功!", MessageBoxIcon.Success);
}
else
{
Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
return;
}
}
}
}