ProjectDetails_Split_API #103
@ -793,7 +793,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
var responseList = new List<WorkItemVM>();
|
||||
var LoggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||
string message = "";
|
||||
List<Guid> projectIds = new List<Guid>();
|
||||
List<Guid> workAreaIds = new List<Guid>();
|
||||
var workItemIds = workItemDtos.Where(wi => wi.Id != null && wi.Id != Guid.Empty).Select(wi => wi.Id).ToList();
|
||||
var workItems = await _context.WorkItems.AsNoTracking().Where(wi => workItemIds.Contains(wi.Id)).ToListAsync();
|
||||
|
||||
@ -846,7 +846,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
WorkItemId = workItem.Id,
|
||||
WorkItem = workItem
|
||||
});
|
||||
projectIds.Add(building.ProjectId);
|
||||
workAreaIds.Add(workItem.WorkAreaId);
|
||||
|
||||
}
|
||||
string responseMessage = "";
|
||||
@ -873,7 +873,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
|
||||
|
||||
|
||||
var notification = new { LoggedInUserId = LoggedInEmployee.Id, Keyword = "Infra", ProjectIds = projectIds, Message = message };
|
||||
var notification = new { LoggedInUserId = LoggedInEmployee.Id, Keyword = "WorkItem", WorkAreaIds = workAreaIds, Message = message };
|
||||
|
||||
await _signalR.Clients.All.SendAsync("NotificationEventHandler", notification);
|
||||
|
||||
@ -885,7 +885,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
{
|
||||
Guid tenantId = _userHelper.GetTenantId();
|
||||
var LoggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||
List<Guid> projectIds = new List<Guid>();
|
||||
List<Guid> workAreaIds = new List<Guid>();
|
||||
WorkItem? task = await _context.WorkItems.AsNoTracking().Include(t => t.WorkArea).FirstOrDefaultAsync(t => t.Id == id && t.TenantId == tenantId);
|
||||
if (task != null)
|
||||
{
|
||||
@ -902,9 +902,9 @@ namespace MarcoBMS.Services.Controllers
|
||||
var floor = await _context.Floor.Include(f => f.Building).FirstOrDefaultAsync(f => f.Id == floorId);
|
||||
|
||||
|
||||
projectIds.Add(floor?.Building?.ProjectId ?? Guid.Empty);
|
||||
workAreaIds.Add(task.WorkAreaId);
|
||||
|
||||
var notification = new { LoggedInUserId = LoggedInEmployee.Id, Keyword = "Infra", ProjectIds = projectIds, Message = $"Task Deleted in Building: {floor?.Building?.Name}, on Floor: {floor?.FloorName}, in Area: {task.WorkArea?.AreaName} by {LoggedInEmployee.FirstName} {LoggedInEmployee.LastName}" };
|
||||
var notification = new { LoggedInUserId = LoggedInEmployee.Id, Keyword = "WorkItem", WorkAreaIds = workAreaIds, Message = $"Task Deleted in Building: {floor?.Building?.Name}, on Floor: {floor?.FloorName}, in Area: {task.WorkArea?.AreaName} by {LoggedInEmployee.FirstName} {LoggedInEmployee.LastName}" };
|
||||
await _signalR.Clients.All.SendAsync("NotificationEventHandler", notification);
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user