Beispiel #1
0
 public StepDto(int id, string title, bool isVoided, ModeDto mode, ResponsibleDto responsible, AutoTransferMethod autoTransferMethod, string rowVersion)
 {
     Id                 = id;
     Title              = title;
     IsVoided           = isVoided;
     Mode               = mode;
     Responsible        = responsible;
     AutoTransferMethod = autoTransferMethod;
     RowVersion         = rowVersion;
 }
Beispiel #2
0
 public TransferredAutomaticallyEvent(
     string plant,
     Guid objectGuid,
     string fromStep,
     string toStep,
     AutoTransferMethod autoTransferMethod)
 {
     Plant              = plant;
     ObjectGuid         = objectGuid;
     FromStep           = fromStep;
     ToStep             = toStep;
     AutoTransferMethod = autoTransferMethod;
 }
 public CreateStepCommand(
     int journeyId,
     string title,
     int modeId,
     string responsibleCode,
     AutoTransferMethod autoTransferMethod)
 {
     JourneyId          = journeyId;
     Title              = title;
     ModeId             = modeId;
     ResponsibleCode    = responsibleCode;
     AutoTransferMethod = autoTransferMethod;
 }
Beispiel #4
0
 public UpdateStepCommand(int journeyId,
                          int stepId,
                          int modeId,
                          string responsibleCode,
                          string title,
                          AutoTransferMethod autoTransferMethod,
                          string rowVersion)
 {
     JourneyId          = journeyId;
     StepId             = stepId;
     ModeId             = modeId;
     ResponsibleCode    = responsibleCode;
     Title              = title;
     AutoTransferMethod = autoTransferMethod;
     RowVersion         = rowVersion;
 }
Beispiel #5
0
        private async Task AutoTransferTagsAsync(string projectName,
                                                 IEnumerable <string> tagNos,
                                                 AutoTransferMethod autoTransferMethod,
                                                 IList <Journey> journeysWithAutoTransferSteps)
        {
            _logger.LogDebug($"Start auto transfer of tags in project {projectName}");

            var autoTransferSteps   = journeysWithAutoTransferSteps.SelectMany(j => j.Steps).Where(s => s.AutoTransferMethod == autoTransferMethod).ToList();
            var autoTransferStepIds = autoTransferSteps.Select(s => s.Id);

            var tagsToTransfer = await _projectRepository.GetStandardTagsInProjectInStepsAsync(projectName, tagNos, autoTransferStepIds);

            foreach (var tag in tagsToTransfer)
            {
                var journey = journeysWithAutoTransferSteps.Single(j => j.Steps.Any(s => s.Id == tag.StepId));
                tag.AutoTransfer(journey, autoTransferMethod);

                _logger.LogDebug($"Tag {tag.TagNo} in project {projectName} auto transfer in journey {journey.Title}");
            }

            _logger.LogDebug($"End auto transfer of {tagsToTransfer.Count} tag(s) in project {projectName}");
        }
Beispiel #6
0
 public Task <List <Journey> > GetJourneysWithAutoTransferStepsAsync(AutoTransferMethod autoTransferMethod)
 => DefaultQuery
 .Where(journey => journey.Steps.Any(s => s.AutoTransferMethod == autoTransferMethod))
 .ToListAsync();
 public static string CovertToString(this AutoTransferMethod autoTransferMethod)
 => autoTransferMethod switch
 {