diff --git a/SGGL/BLL/HJGL/PointTrust/Batch_BatchTrustItemService.cs b/SGGL/BLL/HJGL/PointTrust/Batch_BatchTrustItemService.cs index bfddb0e5..56fc3fb9 100644 --- a/SGGL/BLL/HJGL/PointTrust/Batch_BatchTrustItemService.cs +++ b/SGGL/BLL/HJGL/PointTrust/Batch_BatchTrustItemService.cs @@ -144,5 +144,21 @@ namespace BLL return isShow; } #endregion + + + /// + /// 根据委托Id删除明细 + /// + /// + public static void DeleteTrustItemByTrustBatchId(string trustBatchId) + { + Model.SGGLDB db = Funs.DB; + var trustBatchItems = from x in db.HJGL_Batch_BatchTrustItem where x.TrustBatchId == trustBatchId select x; + if (trustBatchItems != null) + { + db.HJGL_Batch_BatchTrustItem.DeleteAllOnSubmit(trustBatchItems); + db.SubmitChanges(); + } + } } } diff --git a/SGGL/FineUIPro.Web/HJGL/NDT/NDTBatchImport.aspx.cs b/SGGL/FineUIPro.Web/HJGL/NDT/NDTBatchImport.aspx.cs index bb89fc04..3a322824 100644 --- a/SGGL/FineUIPro.Web/HJGL/NDT/NDTBatchImport.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/NDT/NDTBatchImport.aspx.cs @@ -1,4 +1,5 @@ -using BLL; +using Aspose.Words.Lists; +using BLL; using MiniExcelLibs; using Model; using NPOI.SS.Util; @@ -202,6 +203,8 @@ namespace FineUIPro.Web.HJGL.NDT //设置生成下拉框的行和列 SetCellDropdownList(sheet, 6, 6, new List() { "合格", "不合格" }.ToArray());//是否合格 SetCellDropdownList(sheet, 7, 7, new List() { "Ⅰ", "Ⅱ", "Ⅲ", "Ⅳ", "Ⅴ" }.ToArray());//评定级别 + var defects = from x in Funs.DB.Base_Defect select x.DefectName;//缺陷 + SetCellDropdownList(sheet, 8, 8, new List() { string.Join(",", defects.ToList())}.ToArray()); //添加数据 cell = row.CreateCell(7); diff --git a/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx.cs index 229f1e7b..590a5b8e 100644 --- a/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx.cs @@ -1032,7 +1032,7 @@ namespace FineUIPro.Web.HJGL.PointTrust protected void btnBack_Click(object sender, EventArgs e) { Model.SGGLDB db = Funs.DB; - string trustBatchId = string.Empty; + //string trustBatchId = string.Empty; var lists = this.Grid1.SelectedRowIDArray; if (lists.Count() > 0) { @@ -1047,8 +1047,10 @@ namespace FineUIPro.Web.HJGL.PointTrust 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); + //trustBatchId = batchTrustItem.TrustBatchId; + BLL.Batch_BatchTrustItemService.DeleteTrustItemByTrustBatchId(batchTrustItem.TrustBatchId); + BLL.Batch_BatchTrustService.DeleteBatchTrustById(batchTrustItem.TrustBatchId); + //BLL.Batch_BatchTrustItemService.DeleteTrustItemByTrustBatchItemId(batchTrustItem.TrustBatchItemId); } //修改点口中的委托状态 @@ -1071,11 +1073,11 @@ namespace FineUIPro.Web.HJGL.PointTrust } } - var trustItemList = BLL.Batch_BatchTrustItemService.GetBatchTrustItemByTrustBatchId(trustBatchId); - if (trustItemList.Count == 0) - { - BLL.Batch_BatchTrustService.DeleteBatchTrustById(trustBatchId); - } + //var trustItemList = BLL.Batch_BatchTrustItemService.GetBatchTrustItemByTrustBatchId(trustBatchId); + //if (trustItemList.Count == 0) + //{ + // BLL.Batch_BatchTrustService.DeleteBatchTrustById(trustBatchId); + //} PageInfo(); BindGrid(); ShowNotify("退回成功!", MessageBoxIcon.Success);