예제 #1
0
 public ActionResult Delete(CommerceInstanceModel[] model)
 {
     _instanceManager.DeleteInstance(model[0].Name);
     return AjaxForm().ReloadPage();
 }
예제 #2
0
        public ActionResult Index()
        {
            var metadatas = _instanceManager.GetInstances()
                                            .Select(x => x.Settings)
                                            .OrderBy(x => x.DisplayName)
                                            .ToList();

            var models = new List<CommerceInstanceModel>();

            foreach (var metadata in metadatas)
            {
                var model = new CommerceInstanceModel
                {
                    Name = metadata.Name,
                    DisplayName = metadata.DisplayName
                };

                var dbProvider = CommerceDbProviders.Providers.Find(metadata.DbProviderInvariantName, metadata.DbProviderManifestToken);
                model.DbProvider = dbProvider.DisplayName;

                models.Add(model);
            }

            return View(models);
        }