public ActionResult New(string tabId, int parentId, int?groupId) { var content = VirtualContentService.New(parentId, groupId); var model = VirtualContentViewModel.Create(content, tabId, parentId); return(JsonHtml("Properties", model)); }
public ActionResult _VirtualIndex(string tabId, int parentId, GridCommand command) { var normFilter = ContentListFilter.Empty; normFilter.SiteId = parentId; var serviceResult = VirtualContentService.List(normFilter, command.GetListCommand()); return(new TelerikResult(serviceResult.Data, serviceResult.TotalRecords)); }
public ActionResult Properties(string tabId, int parentId, int id, string successfulActionCode, bool?groupChanged) { var content = VirtualContentService.Read(id); var model = VirtualContentViewModel.Create(content, tabId, parentId); model.GroupChanged = groupChanged ?? false; model.SuccesfulActionCode = successfulActionCode; return(JsonHtml("Properties", model)); }
public ActionResult _VirtualIndex(string tabId, int parentId, int page, int pageSize, string orderBy) { var normFilter = ContentListFilter.Empty; normFilter.SiteId = parentId; var listCommand = GetListCommand(page, pageSize, orderBy); var serviceResult = VirtualContentService.List(normFilter, listCommand); return(new TelerikResult(serviceResult.Data, serviceResult.TotalRecords)); }
/// <summary> /// Возвращает список контентов доступных для связи с текущим контентом /// </summary> public IEnumerable <ListItem> GetAcceptableContentForVirtualJoin() { var currentContentSiteId = Data.SiteId; var contentForJoin = VirtualContentService.GetAcceptableContentForVirtualJoin(currentContentSiteId).Select(c => { c.DependentItemIDs = new[] { "JoinFieldsPanel" }; c.HasDependentItems = true; return(c); }).ToArray(); return(new[] { new ListItem(string.Empty, ContentStrings.SelectContent) }.Concat(contentForJoin)); }
public MultistepActionStepResult Step(int step) { var result = new MultistepActionStepResult(); var contentsToInsert = VirtualContentService.CopyVirtualContents(SiteId, NewSiteId.Value); var errors = VirtualContentService.UpdateVirtualContents(SiteId, NewSiteId.Value, contentsToInsert); if (!string.IsNullOrEmpty(errors)) { result.AdditionalInfo = $"{ContentStrings.ErrorsOnCopyingVirtualContents}{errors}"; } return(result); }
public ActionResult Properties(string tabId, int parentId, int id, string backendActionCode, FormCollection collection) { var content = VirtualContentService.ReadForUpdate(id); var model = VirtualContentViewModel.Create(content, tabId, parentId); var oldGroupId = model.Data.GroupId; TryUpdateModel(model); model.Validate(ModelState); if (ModelState.IsValid) { try { model.Data = VirtualContentService.Update(model.Data); PersistVirtualFieldIds(model.Data.NewVirtualFieldIds); } catch (UserQueryContentCreateViewException uqe) { if (HttpContext.IsXmlDbUpdateReplayAction()) { throw; } ModelState.AddModelError("UserQueryContentCreateViewException", uqe.Message); return(JsonHtml("Properties", model)); } catch (VirtualContentProcessingException vcpe) { if (HttpContext.IsXmlDbUpdateReplayAction()) { throw; } ModelState.AddModelError("VirtualContentProcessingException", vcpe.Message); return(JsonHtml("Properties", model)); } catch (CycleInContentGraphException) { if (HttpContext.IsXmlDbUpdateReplayAction()) { throw; } ModelState.AddModelError("CycleInContentGraphException", ContentStrings.CyclesInContentTree); return(JsonHtml("Properties", model)); } return(Redirect("Properties", new { tabId, parentId, id = model.Data.Id, successfulActionCode = backendActionCode, groupChanged = oldGroupId != model.Data.GroupId })); } return(JsonHtml("Properties", model)); }
public async Task <ActionResult> New(string tabId, int parentId, IFormCollection collection) { var content = VirtualContentService.NewForSave(parentId); var model = VirtualContentViewModel.Create(content, tabId, parentId); await TryUpdateModelAsync(model); if (ModelState.IsValid) { try { model.Data = VirtualContentService.Save(model.Data); PersistResultId(model.Data.Id); PersistVirtualFieldIds(model.Data.NewVirtualFieldIds); return(Redirect("Properties", new { tabId, parentId, id = model.Data.Id, successfulActionCode = ActionCode.SaveVirtualContent })); } catch (UserQueryContentCreateViewException uqe) { if (HttpContext.IsXmlDbUpdateReplayAction()) { throw; } ModelState.AddModelError("UserQueryContentCreateViewException", uqe.Message); return(await JsonHtml("Properties", model)); } catch (VirtualContentProcessingException vcpe) { if (HttpContext.IsXmlDbUpdateReplayAction()) { throw; } ModelState.AddModelError("VirtualContentProcessingException", vcpe.Message); return(await JsonHtml("Properties", model)); } catch (CycleInContentGraphException) { if (HttpContext.IsXmlDbUpdateReplayAction()) { throw; } ModelState.AddModelError("CycleInContentGraphException", ContentStrings.CyclesInContentTree); return(await JsonHtml("Properties", model)); } } return(await JsonHtml("Properties", model)); }
public ActionResult Remove(int id) => JsonMessageResult(VirtualContentService.Remove(id));
public JsonResult GetChildFieldList(int virtualContentId, int?joinedContentId, string entityId, string selectItemIDs, string parentAlias) { var entityList = VirtualContentService.GetChildFieldList(virtualContentId, joinedContentId, entityId, selectItemIDs, parentAlias); return(Json(entityList, JsonRequestBehavior.AllowGet)); }
public JsonResult GetChildFieldList([FromBody] ChildFieldListQuery model) { var entityList = VirtualContentService.GetChildFieldList(model); return(Json(entityList)); }