Esempio n. 1
0
        public ViewResult Edit(int id)
        {
            SubsiteInfoDto        instance = Service.GetSubsiteInfo(id);
            InstanceEditViewModel model    = new InstanceEditViewModel(InstanceTypes.Subsite, instance);

            return(View(model));
        }
        public ViewResult Edit(int id)
        {
            CollectionDto         instance = Service.GetCollection(id);
            InstanceEditViewModel model    = new InstanceEditViewModel(InstanceTypes.Collection, instance);

            return(View(model));
        }
Esempio n. 3
0
        public ActionResult Edit(int id, FormCollection formData)
        {
            FolderDto instance = GetFolder(id);

            UpdateModel(instance, formData);
            if (ModelState.IsValid)
            {
                IFacadeUpdateResult <FolderData> result = null;
                if (CurrentLanguage.Id == WebContext.Current.DefaultLanguage.Id)
                {
                    result = Service.SaveFolder(instance);
                }
                else
                {
                    result = Service.SaveFolder(instance, CurrentLanguage.Id);
                }
                if (result.IsSuccessful)
                {
                    return(RedirectToAction(DetailAction, new { id = id }));
                }
                else
                {
                    ProcUpdateResult(result.ValidationResult, result.Exception);
                }
            }

            InstanceEditViewModel model = new InstanceEditViewModel(InstanceTypes.Folder, instance);

            model.FolderTree      = GetCurrentFolderTree(id);
            model.CurrentLanguage = CurrentLanguage;
            return(View(model));
        }
Esempio n. 4
0
        public ViewResult Edit(int id)
        {
            FolderDto             instance = GetFolder(id);
            InstanceEditViewModel model    = new InstanceEditViewModel(InstanceTypes.Folder, instance);

            model.FolderTree      = GetCurrentFolderTree(id);
            model.CurrentLanguage = CurrentLanguage;
            return(View(model));
        }
Esempio n. 5
0
        public ActionResult Edit(int id, FormCollection formData)
        {
            SubsiteInfoDto        instance = Service.GetSubsiteInfo(id);
            InstanceEditViewModel model    = new InstanceEditViewModel(InstanceTypes.Subsite, instance);

            UpdateModel(instance, formData);
            if (ModelState.IsValid)
            {
                IFacadeUpdateResult <SubsiteData> result = Service.SaveSubsite(instance);
                if (result.IsSuccessful)
                {
                    return(RedirectToAction(DetailAction, new { id = id }));
                }
                else
                {
                    ProcUpdateResult(result.ValidationResult, result.Exception);
                }
            }

            return(View(model));
        }