public ActionResult Configure() { // codehint: sm-edit var model = new FeedFroogleModel(); model.Copy(_googleService.Settings, true); _googleService.SetupModel(model, _googleService.Helper.ScheduledTask); return View("SmartStore.Plugin.Feed.Froogle.Views.FeedFroogle.Configure", model); }
public ActionResult Configure(FeedFroogleModel model) { if (!ModelState.IsValid) return Configure(); model.Copy(_googleService.Settings, false); _settingService.SaveSetting(_googleService.Settings); _googleService.Helper.ScheduleTaskUpdate(model.TaskEnabled, model.GenerateStaticFileEachMinutes * 60); NotifySuccess(_googleService.Helper.Resource("ConfigSaveNote"), true); _googleService.SetupModel(model); return View("SmartStore.Plugin.Feed.Froogle.Views.FeedFroogle.Configure", model); }
public ActionResult GenerateFeed(FeedFroogleModel model) { if (!ModelState.IsValid) return Configure(); try { _googleService.CreateFeed(); model.GenerateFeedResult = _googleService.Helper.Resource("SuccessResult"); } catch (Exception exc) { NotifyError(exc.Message, true); } _googleService.SetupModel(model, _googleService.Helper.ScheduledTask); return View("SmartStore.Plugin.Feed.Froogle.Views.FeedFroogle.Configure", model); }
public virtual void SetupModel(FeedFroogleModel model, ScheduleTask task = null) { var stores = _storeService.GetAllStores().ToList(); model.AvailableCurrencies = Helper.AvailableCurrencies(); model.AvailableGoogleCategories = GetTaxonomyList(); model.GeneratedFiles = Helper.FeedFiles(stores); model.Helper = Helper; model.AvailableStores = new List<SelectListItem>(); model.AvailableStores.Add(new SelectListItem() { Text = Helper.Resource("Admin.Common.All"), Value = "0" }); model.AvailableStores.AddRange(_storeService.GetAllStores().ToSelectListItems()); if (task != null) { model.GenerateStaticFileEachMinutes = task.Seconds / 60; model.TaskEnabled = task.Enabled; } }