Ejemplo n.º 1
0
 public ActionResult EditSchedulesSettings(EditSchedulesSettingsViewModel viewModel)
 {
     //if (!ModelState.IsValid)
       //  return View(viewModel);
       var schedulesSettings = viewModel.SchedulesSettings ?? SettingsManager.Schedules ?? new SchedulesSettings();
       schedulesSettings.BaseTemplate = SettingsManager.SchedulesTemplates.FirstOrDefault(t => t.Id == viewModel.SelectedScheduleTemplateId);
       SettingsManager.Schedules = schedulesSettings;
       return RedirectToAction("Settings");
 }
Ejemplo n.º 2
0
 public ViewResult EditSchedulesSettings()
 {
     var viewModel = new EditSchedulesSettingsViewModel
       {
     SchedulesSettings = SettingsManager.Schedules ?? new SchedulesSettings(),
     Templates = SettingsManager.SchedulesTemplates
       };
       if (viewModel.SchedulesSettings != null && viewModel.SchedulesSettings.BaseTemplate != null)
     viewModel.SelectedScheduleTemplateId = viewModel.SchedulesSettings.BaseTemplate.Id;
       return View(viewModel);
 }