public async Task <IActionResult> PostHealthDeclarationAsync([FromBody] HealthDeclaration request) { //EntityTypeId=2 עובדים //EntityTypeId=11 מבקרים //מבקר בינתיים יכול להיות ריק // אם הוא לא מקושר לטבלת מבקרים var entity = request; entity.Date = DateTime.Now.Date; var response = await HealthService.CreateHealthDeclarationAsync(entity); var Alert = new Alerts(); Alert.EntityId = request.EntityId; Alert.EntityTypeId = request.EntityTypeId; // עובדים Alert.AlertTypeId = 7; //הצהרת בריאות Alert.SiteId = request.SiteId; var responseAlert = await AlertService.GetAlertAsync(Alert); if (responseAlert.Model != null) { responseAlert.Model.AlertStatusId = 2;//נקרא await AlertService.UpdateAlertAsync(responseAlert.Model); } return(response.ToHttpResponse()); }