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

View File

@ -112,6 +112,8 @@
<f:Label ID="lbIsAudit" Label="是否审核" runat="server" Hidden="true"
LabelWidth="105px" LabelAlign="Right">
</f:Label>
<f:Button ID="btnBack" Text="退回" Icon="ArrowLeft" runat="server" OnClick="btnBack_Click">
</f:Button>
<f:Button ID="Button1" Text="打印" Icon="Printer" runat="server"
OnClick="btnPrint_Click">
</f:Button>
@ -126,7 +128,7 @@
AllowCellEditing="true" AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2"
DataIDField="PointBatchItemId" AllowSorting="true" SortField="PipelineCode,WeldJointCode"
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
PageSize="25" OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True">
PageSize="25" OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True" EnableCheckBoxSelect="true" EnableMultiSelect="true">
<Columns>
<f:RenderField Width="160px" ColumnID="PipelineCode" DataField="PipelineCode" FieldType="String"
HeaderText="管线号" HeaderTextAlign="Center" TextAlign="Left"

View File

@ -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;
}
}
}
}

View File

@ -7,12 +7,10 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HJGL.PointTrust
{
namespace FineUIPro.Web.HJGL.PointTrust {
public partial class TrustBatch
{
public partial class TrustBatch {
/// <summary>
/// form1 控件。
@ -230,6 +228,15 @@ namespace FineUIPro.Web.HJGL.PointTrust
/// </remarks>
protected global::FineUIPro.Label lbIsAudit;
/// <summary>
/// btnBack 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnBack;
/// <summary>
/// Button1 控件。
/// </summary>