diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx.cs index 6e59051..7f7e1a6 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx.cs @@ -499,6 +499,23 @@ namespace FineUIPro.Web.HJGL.WeldingManage if (judgementDelete(rowID, isShow)) { isDelete = true; + Model.SGGLDB db = Funs.DB; + var hotProessTrustItem = db.HJGL_CH_HotProessTrustItem.FirstOrDefault(x => x.JOT_ID == rowID); + if (hotProessTrustItem != null) + { + db.HJGL_CH_HotProessTrustItem.DeleteOnSubmit(hotProessTrustItem); + } + var hotProessItem = db.HJGL_HotProessItem.FirstOrDefault(x => x.JOT_ID == rowID); + if (hotProessItem != null) + { + db.HJGL_HotProessItem.DeleteOnSubmit(hotProessItem); + } + var hotProessResult = db.HJGL_CH_HotProessResult.FirstOrDefault(x => x.JOT_ID == rowID); + if (hotProessResult != null) + { + db.HJGL_CH_HotProessResult.DeleteOnSubmit(hotProessResult); + } + db.SubmitChanges(); BLL.HJGL_BO_BatchDetailService.DeleteBatchDetail(rowID); //删除批明细 BLL.HJGL_PW_JointInfoService.DeleteJointInfo(rowID); BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除焊口信息"); @@ -1051,10 +1068,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage private bool judgementDelete(string id, bool isShow) { string content = string.Empty; - if (BLL.Funs.DB.HJGL_CH_HotProessTrustItem.FirstOrDefault(x => x.JOT_ID == id) != null - || BLL.Funs.DB.HJGL_CH_HotProessResult.FirstOrDefault(x => x.JOT_ID == id) != null) + //if (BLL.Funs.DB.HJGL_CH_HotProessTrustItem.FirstOrDefault(x => x.JOT_ID == id) != null + // || BLL.Funs.DB.HJGL_CH_HotProessResult.FirstOrDefault(x => x.JOT_ID == id) != null) + //{ + // content = "该焊口已进行热处理委托,不能删除!"; + //} + var joint = BLL.HJGL_PW_JointInfoService.GetJointInfoByJotID(id); + if (!string.IsNullOrEmpty(joint.DReportID)) { - content = "该焊口已进行热处理委托,不能删除!"; + content = "该焊口已提交焊接记录,不能删除!"; } var batchDetail = BLL.HJGL_BO_BatchDetailService.GetBatchDetailByJotId(id); if (batchDetail != null)