1
This commit is contained in:
@@ -321,5 +321,28 @@ namespace BLL
|
||||
handleSteps.Add(handleStep4);
|
||||
return handleSteps;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据危险观察登记主键删除一个危险观察登记信息
|
||||
/// </summary>
|
||||
/// <param name="hazardRegisterId">危险观察登记主键</param>
|
||||
public static void DeleteHazardRegisterByCheckSpecialId(string checkSpecialId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
List<Model.HSSE_Hazard_HazardRegister> hazardRegisters = db.HSSE_Hazard_HazardRegister.Where(e => e.CheckSpecialId == checkSpecialId).ToList();
|
||||
if (hazardRegisters.Count > 0)
|
||||
{
|
||||
foreach (var hazardRegister in hazardRegisters)
|
||||
{
|
||||
if (hazardRegister.IsUpdate != true)
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, hazardRegister.ImageUrl);//删除整改前图片
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, hazardRegister.RectificationImageUrl);//删除整改后图片
|
||||
db.HSSE_Hazard_HazardRegister.DeleteOnSubmit(hazardRegister);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user