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)); }
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)); }
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)); }
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)); }