public ActionResult Configure(XmlUpdateFromRotapSettingsModel model) { string saveResult = ""; if (ModelState.IsValid) { _settings.EmailForReporting = model.EmailForReporting; _settings.EmailForReportingCC = model.EmailForReportingCC; _settings.EnablePriceUpdate = model.EnablePriceUpdate; _settings.NameForReporting = model.NameForReporting; _settingService.SaveSetting(_settings); } // Update the task var task = FindScheduledTask(); if (task != null) { task.Enabled = model.AutoSync; task.Seconds = model.AutoSyncEachMinutes * 60; _scheduleTaskService.UpdateTask(task); saveResult = _localizationService.GetResource("Plugin.Misc.XmlUpdateFromRotap.AutoSyncRestart"); } model = PrepareModel(); //set result text //model.SaveResult = saveResult; return(View(VIEW_PATH, model)); }
public ActionResult RunNow(XmlUpdateFromRotapSettingsModel model) { _scheduledConsumingService.XmlUpdate(); model = PrepareModel(); //set result text //model.SaveResult = saveResult; return(View(VIEW_PATH, model)); }
private XmlUpdateFromRotapSettingsModel PrepareModel() { var model = new XmlUpdateFromRotapSettingsModel(); //Set the properties model.LastStartDate = _settings.LastStartDate.ToString(); model.EmailForReporting = _settings.EmailForReporting; model.EmailForReportingCC = _settings.EmailForReportingCC; model.EnablePriceUpdate = _settings.EnablePriceUpdate; model.NameForReporting = _settings.NameForReporting; ScheduleTask task = FindScheduledTask(); if (task != null) { model.AutoSyncEachMinutes = task.Seconds / 60; model.AutoSync = task.Enabled; } return(model); }