public async Task <SaveResponse <ILabor> > SaveAsync(ILabor labor) { var saveResponse = new SaveResponse <ILabor>(); try { saveResponse = await _laborRepository.SaveAsync(labor); if (saveResponse.IsSuccessful) { // Save certificate of insurance var savedLabor = saveResponse.Content; if (labor.CertificateOfInsurance != null) { savedLabor.CertificateOfInsurance = labor.CertificateOfInsurance; var certificateResponse = await _certificateOfInsuranceApplicationService.SaveAsync(savedLabor.CertificateOfInsurance); if (certificateResponse.IsSuccessful) { savedLabor.CertificateOfInsurance = certificateResponse.Content; } } } } catch (Exception ex) { Console.WriteLine(ex); saveResponse.AddError(ex); _logManager.LogError(ex, "Error saving labor"); } return(saveResponse); }
private void AddLaborResourceCapacity(ILabor labor, int availableQuantity, int availableHours) { var schedule = GetOrAddLaborSchedule(labor); schedule.AvailableCapacity = availableQuantity; schedule.AvailableCapacityHours = availableHours; }
private IActivityLaborSchedulingEventCollection GetOrAddLaborSchedule(ILabor labor) { if (!_laborSchedules.ContainsKey(labor)) { _laborSchedules.Add(labor, new ActivityLaborSchedulingEventCollection(labor)); } return(_laborSchedules[labor]); }
private IActivityLaborSchedulingEventCollection GetOrAddLaborSchedule(ILabor labor) { if (!_laborSchedules.ContainsKey(labor)) { _laborSchedules.Add(labor, new ActivityLaborSchedulingEventCollection(labor)); } return _laborSchedules[labor]; }
public void AddLaborReservationToSchedule(int instanceId, IActivity activity, ILabor laborType, int startingOffsetInMinutes, int finishingOffsetInMinutes) { var schedule = new ActivitySchedulingEvent <ILabor>(instanceId, activity, laborType, startingOffsetInMinutes, finishingOffsetInMinutes); // add the scheduling event to the activity schedule AddSchedulingEvent(schedule); // and add the same scheduling event to the labor schedule var laborSchedule = GetOrAddLaborSchedule(laborType); laborSchedule.AddResourceReservation(schedule); }
private void AddLaborResourceUtilization(ILabor labor, int utilization) { var schedule = GetOrAddLaborSchedule(labor); schedule.AddResourceInstanceUtilization(utilization); }
public void AddLaborReservationToSchedule(int instanceId, IActivity activity, ILabor laborType, int startingOffsetInMinutes, int finishingOffsetInMinutes) { var schedule = new ActivitySchedulingEvent<ILabor>(instanceId, activity, laborType, startingOffsetInMinutes, finishingOffsetInMinutes); // add the scheduling event to the activity schedule AddSchedulingEvent(schedule); // and add the same scheduling event to the labor schedule var laborSchedule = GetOrAddLaborSchedule(laborType); laborSchedule.AddResourceReservation(schedule); }
public Task <ValidationResult> ValidateAsync(ILabor labor) { throw new NotImplementedException(); }