public static List<CampaignEmployeeUpdateRequestItem> GenerateFromCampaignForEmployee(Employee employee, ImportTask importTask) { List<CampaignEmployeeUpdateRequestItem> rc = new List<CampaignEmployeeUpdateRequestItem>(); foreach (UpdateRequest updateRequest in importTask.UpdateRequestsForEmployee(employee)) { CampaignEmployeeUpdateRequestItem item = new CampaignEmployeeUpdateRequestItem { StepUrl = Utilities.Domain() + UrlManager.EmployeeEditWithRequestUpdateOid(updateRequest.Oid), Step = updateRequest.Step, LastSentDate = updateRequest.LastSentDate, }; AddGeneratedValues(item, updateRequest); rc.Add(item); } return rc; }
private static void AddGeneratedValues(CampaignEmployeeUpdateRequestItem item, UpdateRequest updateRequest) { item.Status = GenerateStatusForUpdateRequest(updateRequest); if (updateRequest.CompletedDate.HasBeenSet()) { //item.ExtraClassForGoToStepButton = "disabled"; item.StepButtonBackgroundColor = "grey"; item.StepIcon = "checkmark"; item.StepIconColor = "green"; } else { item.StepButtonBackgroundColor = "primary"; item.StepIcon = "warning sign"; item.StepIconColor = "yellow"; } if (item.Step > updateRequest.ImportTask.NextRequiredStepForEmployee(updateRequest.Employee)) { item.ExtraClassForGoToStepButton = "disabled"; } }