控制点检查检测查询报错问题处理

This commit is contained in:
夏菊 2025-09-25 12:19:04 +08:00
parent 58542a36fd
commit f975f02b59
2 changed files with 7 additions and 3 deletions

View File

@ -598,7 +598,7 @@ namespace FineUIPro.Web.CQMS.Check
{ {
string itemId = Grid1.DataKeys[e.RowIndex][0].ToString(); string itemId = Grid1.DataKeys[e.RowIndex][0].ToString();
var detail = jointCheckDetails.FirstOrDefault(x => x.JointCheckDetailId == itemId); var detail = jointCheckDetails.FirstOrDefault(x => x.JointCheckDetailId == itemId);
if (detail.HandleMan == CurrUser.UserId) if (detail != null && detail.HandleMan == CurrUser.UserId)
{ {
if (e.CommandName == "ReAttachUrl") if (e.CommandName == "ReAttachUrl")
{ {

View File

@ -60,9 +60,13 @@ namespace FineUIPro.Web.CQMS.ProcessControl
listStr.Add(new SqlParameter("@startTime", Funs.GetNewDateTime(txtStarTime.Text))); listStr.Add(new SqlParameter("@startTime", Funs.GetNewDateTime(txtStarTime.Text)));
} }
if (!string.IsNullOrWhiteSpace(txtEndTime.Text)) if (!string.IsNullOrWhiteSpace(txtEndTime.Text))
{
var endTime = Funs.GetNewDateTime(txtEndTime.Text);
if (endTime != null)
{ {
sb.Append("AND P.InspectionDate <= @endTim "); sb.Append("AND P.InspectionDate <= @endTim ");
listStr.Add(new SqlParameter("@endTime", Funs.GetNewDateTime(txtEndTime.Text))); listStr.Add(new SqlParameter("@endTime", endTime));
}
} }
sb.Append("ORDER BY P.NoticeCode DESC "); sb.Append("ORDER BY P.NoticeCode DESC ");
SqlParameter[] parameter = listStr.ToArray(); SqlParameter[] parameter = listStr.ToArray();