예제 #1
0
        public ActionResult Edit(int id, GenericDefinitionEditModel editModel)
        {
            if (editModel.IsValid() == false)
            {
                Response.StatusCode = 500;
                return(PartialView("_ValidationErrorSummary", new ValidationErrorSummaryViewModel(editModel.GetValidationErrors())));
            }

            GenericDefinitionViewModel viewModel = _noiseProtectionDefinitionService.Edit(id, editModel);

            return(PartialView("_GenericDefinitionTableRow", viewModel));
        }
예제 #2
0
        public ActionResult Create(GenericDefinitionEditModel editModel)
        {
            if (editModel.IsValid() == false)
            {
                Response.StatusCode = 500;
                return(PartialView("_ValidationErrorSummary", new ValidationErrorSummaryViewModel(editModel.GetValidationErrors())));
            }

            GenericDefinitionViewModel viewModel = _helicopterWorkCategoryService.Create(editModel);

            return(PartialView("_GenericDefinitionTableRow", viewModel));
        }
        public GenericDefinitionViewModel Edit(int id, GenericDefinitionEditModel editModel)
        {
            NoiseProtectionDefinition definition = _noiseProtectionDefinitionDAO.Get(id);

            definition.SystemName = editModel.Title;

            _noiseProtectionDefinitionDAO.Store(definition);

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

            return(viewModel);
        }
예제 #4
0
        public GenericDefinitionViewModel Edit(int id, GenericDefinitionEditModel editModel)
        {
            HelicopterType helicopterType = _helicopterTypeDAO.Get(id);

            helicopterType.Title = editModel.Title;

            _helicopterTypeDAO.Store(helicopterType);

            GenericDefinitionViewModel viewModel = new GenericDefinitionViewModel
            {
                Id         = helicopterType.Id,
                SystemName = helicopterType.Title
            };

            return(viewModel);
        }
예제 #5
0
        public GenericDefinitionViewModel Edit(int id, GenericDefinitionEditModel editModel)
        {
            var helicopterWorkCategory = _helicopterWorkCategoryDAO.Get(id);

            helicopterWorkCategory.Title = editModel.Title;

            _helicopterWorkCategoryDAO.Store(helicopterWorkCategory);

            var viewModel = new GenericDefinitionViewModel
            {
                Id         = helicopterWorkCategory.Id,
                SystemName = helicopterWorkCategory.Title
            };

            return(viewModel);
        }
        public GenericDefinitionViewModel Create(GenericDefinitionEditModel editModel)
        {
            NoiseProtectionDefinition definition = new NoiseProtectionDefinition
            {
                SystemName = editModel.Title
            };

            _noiseProtectionDefinitionDAO.Store(definition);

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

            return(viewModel);
        }
        public TaskDefinitionListItemViewModel Edit(int id, GenericDefinitionEditModel editModel)
        {
            TaskDefinition definition = _taskDefinitionDAO.Get(id);

            definition.SystemName = editModel.Title;

            _taskDefinitionDAO.Store(definition);

            TaskDefinitionListItemViewModel viewModel = new TaskDefinitionListItemViewModel
            {
                Id         = definition.Id,
                SystemName = definition.SystemName,
                RoleType   = definition.RoleType.ToString()
            };

            return(viewModel);
        }
예제 #8
0
        public GenericDefinitionViewModel Create(GenericDefinitionEditModel editModel)
        {
            HelicopterType helicopterType = new HelicopterType
            {
                Title = editModel.Title
            };

            _helicopterTypeDAO.Store(helicopterType);

            GenericDefinitionViewModel viewModel = new GenericDefinitionViewModel
            {
                Id         = helicopterType.Id,
                SystemName = helicopterType.Title
            };

            return(viewModel);
        }
예제 #9
0
        public GenericDefinitionViewModel Create(GenericDefinitionEditModel editModel)
        {
            var helicopterWorkCategory = new HelicopterWorkCategory
            {
                Title = editModel.Title
            };

            _helicopterWorkCategoryDAO.Store(helicopterWorkCategory);

            var viewModel = new GenericDefinitionViewModel
            {
                Id         = helicopterWorkCategory.Id,
                SystemName = helicopterWorkCategory.Title
            };

            return(viewModel);
        }