コード例 #1
0
        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
                });
            }
        }
コード例 #2
0
        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));
        }