public async Task <IActionResult> Create(SerpAnalysisModuleViewModel viewModel) { var modul = _modulRegistry.CreateModule <SerpModule>(_context, SerpModule.ModuleCode); modul.CreateAndSave(viewModel.Config); return(RedirectToAction("Index", "Project", new { Id = viewModel.Project })); }
public IActionResult Edit(SerpAnalysisModuleViewModel viewModel) { var modul = _modulRegistry.OpenModule <SerpModule>(_context, SerpModule.ModuleCode, viewModel.Id); var result = modul.SaveConfig(viewModel.Config); if (result) { TempData["message"] = $" Config of {modul.Name} has been changed"; } modul.LoadConfig(); return(View(new SerpAnalysisModuleViewModel(modul.Id, modul.Configuration) { DataProviders = ProjectModuleRegistry.GetModules <string, List <SerpWebPage> >(_context, _modulRegistry, modul.Configuration.ProjectModule.ProjectId), AvailableLinkedModules = ProjectModuleRegistry.GetModules <ModuleTaskResult <SerpModuleData> >(_context, _modulRegistry, modul.Configuration.ProjectModule.ProjectId) })); }