ProjectDetails_Split_API #103
@ -927,7 +927,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
var responseList = new List<WorkItemVM>();
|
var responseList = new List<WorkItemVM>();
|
||||||
var LoggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
var LoggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
||||||
string message = "";
|
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 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();
|
var workItems = await _context.WorkItems.AsNoTracking().Where(wi => workItemIds.Contains(wi.Id)).ToListAsync();
|
||||||
|
|
||||||
@ -980,7 +980,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
WorkItemId = workItem.Id,
|
WorkItemId = workItem.Id,
|
||||||
WorkItem = workItem
|
WorkItem = workItem
|
||||||
});
|
});
|
||||||
projectIds.Add(building.ProjectId);
|
workAreaIds.Add(workItem.WorkAreaId);
|
||||||
|
|
||||||
}
|
}
|
||||||
string responseMessage = "";
|
string responseMessage = "";
|
||||||
@ -1007,7 +1007,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);
|
await _signalR.Clients.All.SendAsync("NotificationEventHandler", notification);
|
||||||
|
|
||||||
@ -1019,7 +1019,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
{
|
{
|
||||||
Guid tenantId = _userHelper.GetTenantId();
|
Guid tenantId = _userHelper.GetTenantId();
|
||||||
var LoggedInEmployee = await _userHelper.GetCurrentEmployeeAsync();
|
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);
|
WorkItem? task = await _context.WorkItems.AsNoTracking().Include(t => t.WorkArea).FirstOrDefaultAsync(t => t.Id == id && t.TenantId == tenantId);
|
||||||
if (task != null)
|
if (task != null)
|
||||||
{
|
{
|
||||||
@ -1036,9 +1036,9 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
var floor = await _context.Floor.Include(f => f.Building).FirstOrDefaultAsync(f => f.Id == floorId);
|
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);
|
await _signalR.Clients.All.SendAsync("NotificationEventHandler", notification);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user