case 4582

This commit is contained in:
2024-04-29 18:49:50 +00:00
parent a8fb507616
commit 59f9d2a2f0
2 changed files with 13 additions and 6 deletions

View File

@@ -75,8 +75,8 @@ namespace AyaNova.Api.Controllers
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
UnitBiz biz = UnitBiz.GetBiz(ct, HttpContext);
var customerEffectiveRights = await UserBiz.CustomerUserEffectiveRightsAsync(biz.UserId);
if (!customerEffectiveRights.CreateUnit)
return StatusCode(403, new ApiNotAuthorizedResponse());
if (!customerEffectiveRights.CreateUnit)
return StatusCode(403, new ApiNotAuthorizedResponse());
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
@@ -309,7 +309,12 @@ namespace AyaNova.Api.Controllers
{
while (dr.Read())
{
ret.RecentWorkOrders.Add(new RecentWorkOrder(dr.GetInt64(0), dr.GetInt64(1), dr.GetDateTime(2)));
if (!await dr.IsDBNullAsync(2))//case 4582
ret.RecentWorkOrders.Add(new RecentWorkOrder(dr.GetInt64(0), dr.GetInt64(1), dr.GetDateTime(2)));
else
ret.RecentWorkOrders.Add(new RecentWorkOrder(dr.GetInt64(0), dr.GetInt64(1), null));
}
}
}