public TaskDefinitionGenericViewModel EditGenericTaskDefinitionForm(int id)
        {
            TaskDefinition definition = _taskDefinitionDAO.Get(id);

            TaskDefinitionGenericViewModel viewModel = new TaskDefinitionGenericViewModel
            {
                Id         = definition.Id,
                SystemName = definition.SystemName
            };

            foreach (Task task in definition.Tasks)
            {
                TaskListItemViewModel translationViewModel = new TaskListItemViewModel()
                {
                    Id                     = task.Id,
                    Title                  = task.Title,
                    Role                   = task.Role.Title,
                    NoiseProtection        = task.NoiseProtection.Title,
                    NoiseLevelGuideline    = task.NoiseLevelGuideline,
                    AllowedExposureMinutes = task.AllowedExposureMinutes,
                    ButtonPressed          = task.ButtonPressed,
                    Language               = LanguageResolver.GetLanguageName(task.CultureName)
                };

                viewModel.Tasks.Add(translationViewModel);
            }

            return(viewModel);
        }
Exemplo n.º 2
0
        public TaskDefinitionRotationViewModel EditGenericTaskDefinitionForm(int id)
        {
            TaskDefinition definition = _taskDefinitionDAO.Get(id);

            TaskDefinitionRotationViewModel viewModel = new TaskDefinitionRotationViewModel
            {
                Id         = definition.Id,
                SystemName = definition.SystemName,
            };

            IList <Rotation> rotations = _rotationDAO.GetAllByTaskDefinitionIdOrderedByTaskTitle(definition.Id);

            foreach (Rotation rotation in rotations)
            {
                RotationTaskListItemViewModel translationViewModel
                    = new RotationTaskListItemViewModel()
                    {
                    Id            = rotation.Id,
                    Title         = rotation.Task.Title,
                    OperatorTask  = rotation.OperatorTask.Title,
                    OperatorRole  = rotation.OperatorTask.Role.Title,
                    AssistantTask = rotation.AssistantTask.Title,
                    AssistantRole = rotation.AssistantTask.Role.Title,
                    Language      = LanguageResolver.GetLanguageName(rotation.Task.CultureName)
                    };

                viewModel.RotationTasks.Add(translationViewModel);
            }

            return(viewModel);
        }
Exemplo n.º 3
0
        public GenericTranslationViewModel(string selectedCultureName)
        {
            SelectedCultureName = selectedCultureName;
            SelectedLanguage    = LanguageResolver.GetLanguageName(selectedCultureName);
            Languages           = new List <SelectOptionViewModel>();

            AddLanguageSelectOption("-- Select One --", string.Empty);
            AddLanguageSelectOption(LanguageResolver.GetLanguageName("nb-NO"), "nb-NO");
            AddLanguageSelectOption(LanguageResolver.GetLanguageName("en-US"), "en-US");
        }
Exemplo n.º 4
0
        public IList <SelectOptionViewModel> CreateSelectedLanguageList(string selectedCultureName)
        {
            IList <SelectOptionViewModel> languages = new List <SelectOptionViewModel>();

            languages.Add(CreateLanguageSelectOption("-- Select One --", "0", selectedCultureName));
            languages.Add(CreateLanguageSelectOption(LanguageResolver.GetLanguageName("nb-NO"), "nb-NO", selectedCultureName));
            languages.Add(CreateLanguageSelectOption(LanguageResolver.GetLanguageName("en-US"), "en-US", selectedCultureName));

            return(languages);
        }
 private RotationTaskListItemViewModel CreateTableRowViewModel(Rotation rotation)
 {
     return(new RotationTaskListItemViewModel
     {
         Id = rotation.Id,
         Language = LanguageResolver.GetLanguageName(rotation.Task.CultureName),
         Title = rotation.Task.Title,
         OperatorTask = rotation.OperatorTask.Title,
         OperatorRole = rotation.OperatorTask.Role.Title,
         AssistantTask = rotation.AssistantTask.Title,
         AssistantRole = rotation.AssistantTask.Role.Title
     });
 }
Exemplo n.º 6
0
        private TaskListItemViewModel CreateTaskListItemViewModel(Task task)
        {
            TaskListItemViewModel taskListItemViewModel = new TaskListItemViewModel
            {
                Id                     = task.Id,
                Title                  = task.Title,
                Role                   = task.Role.Title,
                NoiseProtection        = task.NoiseProtection.Title,
                NoiseLevelGuideline    = task.NoiseLevelGuideline,
                AllowedExposureMinutes = task.AllowedExposureMinutes,
                ButtonPressed          = task.ButtonPressed,
                Language               = LanguageResolver.GetLanguageName(task.CultureName)
            };

            return(taskListItemViewModel);
        }