Exemple #1
0
        public async Task <IActionResult> Create(YanexXMLModuleViewModel viewModel)
        {
            var modul = _modulRegistry.CreateModule <YandexXMLModule>(_context, YandexXMLModule.ModuleCode);

            modul.CreateAndSave(viewModel.Config);

            return(RedirectToAction("Config", "Project", new { Id = viewModel.Project }));
        }
Exemple #2
0
        public IActionResult Edit(YanexXMLModuleViewModel viewModel)
        {
            var modul = _modulRegistry.OpenModule <YandexXMLModule>(_context, YandexXMLModule.ModuleCode, viewModel.Id);

            var result = modul.SaveConfig(viewModel.Config);

            if (result)
            {
                TempData["message"] = $" Config of {modul.Name} has been changed";
            }

            return(View(new YanexXMLModuleViewModel(modul.Id, modul.Configuration)
            {
                HttpModules = ProjectModuleRegistry.GetModules <HttpProviderRuntimeConfig, HttpProviderData>(_context, _modulRegistry, modul.Configuration.ProjectModule.Project.Id)
            }));
        }