public void SetupProductFileSelectModel(ProductFileSelectModel model, int id) { var files = new ShopConnectorFileSystem("Product"); model.Id = id; model.AvailableImportFiles = new List <SelectListItem>(); foreach (string name in files.GetAllFiles().OrderByDescending(x => x)) { model.AvailableImportFiles.Add(new SelectListItem { Text = name, Value = name }); } }
public ActionResult ProductFileSelect(int id) { var progress = _asyncState.Get <ShopConnectorProcessingInfo>(ShopConnectorPlugin.SystemName); if (progress != null) { return(new EmptyResult()); } var model = new ProductFileSelectModel(); _connectorService.SetupProductFileSelectModel(model, id); if (model.AvailableImportFiles.Count <= 0) { return(new ShopConnectorOperationResult(T("Plugins.SmartStore.ShopConnector.NoImportFilesFound"), false)); } return(PartialView(model)); }