Exemple #1
0
        public async Task <IViewComponentResult> InvokeAsync(string clientId)
        {
            var model = new SiteCollectionViewModel();

            model.ClientId = clientId;
            return(View(model));
        }
Exemple #2
0
        public async Task <JsonResult> Edit(SiteCollectionViewModel vm)
        {
            var siteCollection = new SiteCollection();

            siteCollection.Id       = vm.Id;
            siteCollection.Name     = vm.Name;
            siteCollection.ClientId = vm.ClientId;

            var isUpdated = await _siteCollectionManager.UpdateSiteCollectionDetailsAsync(siteCollection);

            return(Json(siteCollection));
        }
Exemple #3
0
        public async Task <JsonResult> Create(SiteCollectionViewModel vm)
        {
            var siteCollection = new SiteCollection();
            var newId          = "";

            siteCollection.Name     = vm.Name;
            siteCollection.ClientId = vm.ClientId;

            newId = await _siteCollectionManager.CreateSiteCollectionAsync(siteCollection);

            siteCollection.Id = newId;

            return(Json(siteCollection));
        }
        public async Task <IViewComponentResult> InvokeAsync(string clientId, string collectionId = null)
        {
            SiteCollectionViewModel model = null;

            if (collectionId != null)
            {
                var site = await _siteCollectionsManager.GetSiteCollectionByIdAsync(collectionId);

                model = site.ProjectTo <SiteCollectionViewModel>();
                return(View(model));
            }
            else
            {
                model          = new SiteCollectionViewModel();
                model.ClientId = clientId;
                model.Name     = "";

                return(View(model));
            }
        }