示例#1
0
        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);
        }
示例#2
0
        private void AddLaborResourceCapacity(ILabor labor, int availableQuantity, int availableHours)
        {
            var schedule = GetOrAddLaborSchedule(labor);

            schedule.AvailableCapacity      = availableQuantity;
            schedule.AvailableCapacityHours = availableHours;
        }
示例#3
0
 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];
 }
示例#5
0
        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);
        }
示例#6
0
        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);
        }
 private void AddLaborResourceUtilization(ILabor labor, int utilization)
 {
     var schedule = GetOrAddLaborSchedule(labor);
     schedule.AddResourceInstanceUtilization(utilization);
 }
 private void AddLaborResourceCapacity(ILabor labor, int availableQuantity, int availableHours)
 {
     var schedule = GetOrAddLaborSchedule(labor);
     schedule.AvailableCapacity = availableQuantity;
     schedule.AvailableCapacityHours = availableHours;
 }
示例#10
0
 public Task <ValidationResult> ValidateAsync(ILabor labor)
 {
     throw new NotImplementedException();
 }