Fixed the error of empty checkList in get activities
This commit is contained in:
parent
40d9c335c4
commit
9b1a1d1fe7
@ -103,7 +103,7 @@ namespace Marco.Pms.Model.Mapper
|
||||
AssignmentDate = taskAllocation.AssignmentDate,
|
||||
PlannedTask = taskAllocation.PlannedTask,
|
||||
CompletedTask = taskAllocation.CompletedTask,
|
||||
AssignedBy = taskAllocation.Employee.ToEmployeeVMFromEmployee(),
|
||||
AssignedBy = taskAllocation.Employee.ToBasicEmployeeVMFromEmployee(),
|
||||
WorkItemId = taskAllocation.WorkItemId,
|
||||
WorkItem = taskAllocation.WorkItem,
|
||||
TenantId = taskAllocation.TenantId
|
||||
@ -144,12 +144,13 @@ namespace Marco.Pms.Model.Mapper
|
||||
IsMandatory = checkList.IsMandatory,
|
||||
};
|
||||
}
|
||||
public static ActivityCheckList ToActivityCheckListFromCreateCheckListDto(this CreateCheckListDto checkListDto,int tenantId)
|
||||
public static ActivityCheckList ToActivityCheckListFromCreateCheckListDto(this CreateCheckListDto checkListDto,int tenantId,int activityId)
|
||||
{
|
||||
return new ActivityCheckList
|
||||
{
|
||||
Id = checkListDto.Id,
|
||||
Check = checkListDto.Check,
|
||||
ActivityMasterId = activityId,
|
||||
IsMandatory = checkListDto.IsMandatory,
|
||||
TenantId = tenantId
|
||||
};
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using Marco.Pms.DataAccess.Data;
|
||||
using Marco.Pms.DataAccess.Data;
|
||||
using Marco.Pms.Model.Dtos.Activities;
|
||||
using Marco.Pms.Model.Entitlements;
|
||||
using Marco.Pms.Model.Mapper;
|
||||
@ -66,7 +65,7 @@ namespace Marco.Pms.Services.Controllers
|
||||
List<ActivityCheckList> activityCheckList = new List<ActivityCheckList>();
|
||||
foreach (var check in createActivity.CheckList)
|
||||
{
|
||||
ActivityCheckList checkList = check.ToActivityCheckListFromCreateCheckListDto(tenantId);
|
||||
ActivityCheckList checkList = check.ToActivityCheckListFromCreateCheckListDto(tenantId,activityMaster.Id);
|
||||
activityCheckList.Add(checkList);
|
||||
}
|
||||
_context.ActivityCheckLists.AddRange(activityCheckList);
|
||||
@ -100,7 +99,7 @@ namespace Marco.Pms.Services.Controllers
|
||||
List<ActivityCheckList> activityCheckList = new List<ActivityCheckList>();
|
||||
foreach (var check in createActivity.CheckList)
|
||||
{
|
||||
ActivityCheckList checkList = check.ToActivityCheckListFromCreateCheckListDto(tenantId);
|
||||
ActivityCheckList checkList = check.ToActivityCheckListFromCreateCheckListDto(tenantId,activity.Id);
|
||||
activityCheckList.Add(checkList);
|
||||
}
|
||||
_context.ActivityCheckLists.UpdateRange(activityCheckList);
|
||||
|
Loading…
x
Reference in New Issue
Block a user