public async Task <ActionResult> Select(string tabId, int parentId, [FromBody] SelectedItemsViewModel selModel) { var result = ContentService.InitList(parentId); var model = new ContentSelectableListViewModel(result, tabId, parentId, selModel?.Ids ?? new int[] {}); return(await JsonHtml("SelectIndex", model)); }
public async Task <ActionResult> MultipleSelect(string tabId, int parentId, [FromBody] SelectedItemsViewModel selModel) { var result = SiteService.MultipleInitList(parentId); var model = SiteListViewModel.Create(result, tabId, parentId, true, selModel.Ids); return(await JsonHtml("Index", model)); }
public async Task <ActionResult> MultipleSelect(string tabId, int parentId, [FromBody] SelectedItemsViewModel selModel, bool?boundToExternal) { var articleList = ArticleService.InitList(parentId, boundToExternal); var model = ArticleListViewModel.Create(articleList, parentId, tabId, true, true, selModel.Ids); return(await JsonHtml("Index", model)); }
public async Task <ActionResult> Compare(string tabId, int parentId, [FromBody] SelectedItemsViewModel selModel, bool?boundToExternal) { var version = QpPluginVersionService.GetMergedVersion(selModel.Ids, parentId); var model = QpPluginVersionViewModel.Create(version, tabId, parentId, boundToExternal); model.ViewType = QpPluginVersionViewType.CompareVersions; return(await JsonHtml("Compare", model)); }
public async Task <ActionResult> Settings(string tabId, int parentId, [FromBody] SelectedItemsViewModel model) { return(await JsonHtml($"{FolderForTemplate}/ExportTemplate", new ExportViewModel { ContentId = parentId, Ids = model.Ids })); }
public async Task <ActionResult> MultipleSelectForWorkflow( string tabId, int parentId, [FromBody] SelectedItemsViewModel selModel ) { _statusTypeService.InitList(parentId); var model = new StatusTypeSelectableListViewModel(tabId, parentId, selModel.Ids); return(await JsonHtml("MultiSelectIndex", model)); }
public async Task <ActionResult> CompareTemplateObjectFormatVersions( string tabId, int parentId, [FromBody] SelectedItemsViewModel selModel ) { var version = _formatService.GetMergedObjectFormatVersion(selModel.Ids, parentId, false); var model = ObjectFormatVersionCompareViewModel.Create(version, tabId, parentId, false); ViewData[SpecialKeys.IsEntityReadOnly] = true; return(await JsonHtml("CompareObjectFormatVersionProperties", model)); }
public IActionResult Index() { var userId = _userManager.GetUserId(User); SelectedItemsViewModel model = new SelectedItemsViewModel(); var ItemsList = _appDbContext.Items.ToList(); model.Items = ItemsList; return(View(model)); }
public async Task <ActionResult> MultipleSelect(string tabId, int parentId, [FromBody] SelectedItemsViewModel selModel) { var result = ContentService.InitList(parentId); var model = new ContentSelectableListViewModel(result, tabId, parentId, selModel.Ids) { IsMultiple = true }; return(await JsonHtml("MultiSelectIndex", model)); }
public ActionResult MultipleRestoreFromArchive(int parentId, [FromBody] SelectedItemsViewModel selModel, bool?boundToExternal) { var articlesToRestore = ArticleRepository.GetByIds(selModel.Ids); var idsToRemove = articlesToRestore.Select(atr => atr.Id).ToArray(); // ReSharper disable once PossibleInvalidOperationException var guidsToRemove = articlesToRestore.Select(atr => atr.UniqueId.Value).ToArray(); PersistFromIds(idsToRemove, guidsToRemove); return(JsonMessageResult(ArticleService.RestoreFromArchive(parentId, selModel.Ids, boundToExternal, HttpContext.IsXmlDbUpdateReplayAction()))); }
public void Binding_To_List_AvaloniaProperty_Is_Operational() { using (UnitTestApplication.Start(TestServices.MockWindowingPlatform)) { var xaml = @" <Window xmlns='https://github.com/avaloniaui'> <ListBox Items='{Binding Items}' SelectedItems='{Binding SelectedItems}'/> </Window>"; var window = AvaloniaXamlLoader.Parse <Window>(xaml); var listBox = (ListBox)window.Content; var vm = new SelectedItemsViewModel() { Items = new string[] { "foo", "bar", "baz" } }; window.DataContext = vm; Assert.Equal(vm.Items, listBox.Items); Assert.Equal(vm.SelectedItems, listBox.SelectedItems); } }
public virtual async Task <ActionResult> MultipleChangeAsChild(string tabId, int parentId, [FromBody] SelectedItemsViewModel idsModel, int?userId, int?groupId) { var permission = ChildEntityPermission.Create(ChildContentService, parentId, userId, groupId); var model = ChildEntityPermissionViewModel.Create(permission, tabId, parentId, MultipleChangeAction, ControllerName, "SaveMultipleChangeAsChild", ChildContentService, userId, groupId, idsModel.Ids); return(await JsonHtml("ChildEntityPermissionProperties", model)); }
public ActionResult MultipleRemovePageObjectFormatVersion(int parentId, [FromBody] SelectedItemsViewModel selModel) { return(JsonMessageResult(_formatService.MultipleRemoveObjectFormatVersion(selModel.Ids))); }
public ActionResult Setup(int parentId, [FromBody] SelectedItemsViewModel model, bool?boundToExternal) { return(Json(_service.Setup(parentId, 0, model.Ids, boundToExternal))); }
public async Task <ActionResult> MultipleSelect(string tabId, int parentId, [FromBody] SelectedItemsViewModel selModel) { var model = UserSelectableListViewModel.Create(tabId, parentId, selModel.Ids, true); return(await JsonHtml("MultipleSelectIndex", model)); }
public ActionResult MultipleRemoveTemplateObject(int parentId, [FromBody] SelectedItemsViewModel selModel) { return(JsonMessageResult(_objectService.MultipleRemoveTemplateObject(selModel.Ids))); }
public ActionResult MultipleRemove([FromBody] SelectedItemsViewModel selModel) { var result = FieldService.MultipleRemove(selModel.Ids); return(JsonMessageResult(result)); }
public ActionResult MultipleRemovePage(int parentId, [FromBody] SelectedItemsViewModel selModel) { return(JsonMessageResult(_pageService.MultipleRemovePage(selModel.Ids))); }
public virtual ActionResult MultipleRemove(int parentId, [FromBody] SelectedItemsViewModel model) { return(JsonMessageResult(Service.MultipleRemove(parentId, model.Ids))); }
public override async Task <ActionResult> MultipleChangeAsChild(string tabId, int parentId, [FromBody] SelectedItemsViewModel model, int?userId, int?groupId) { return(await base.MultipleChangeAsChild(tabId, parentId, model, userId, groupId)); }
public virtual ActionResult MultipleRemoveAsChild(int parentId, [FromBody] SelectedItemsViewModel model, int?userId, int?groupId) { return(JsonMessageResult(ChildContentService.MultipleRemove(parentId, model.Ids, userId, groupId))); }
public async Task <ActionResult> MultipleSelectForExportExpanded(string tabId, int parentId, [FromBody] SelectedItemsViewModel selModel) { var result = FieldService.InitList(parentId); var model = new FieldSelectableListViewModel(result, tabId, parentId, selModel.Ids, ActionCode.MultipleSelectFieldForExportExpanded) { IsMultiple = true }; return(await JsonHtml("MultiSelectIndex", model)); }
public ActionResult MultipleRemove([FromBody] SelectedItemsViewModel selModel, bool?boundToExternal) { var result = ArticleVersionService.MultipleRemove(selModel.Ids, boundToExternal); return(JsonMessageResult(result)); }
public IActionResult Index(SelectedItemsViewModel model) { if (model.SelecedIds != null) { string[] ItemsIDs = model.SelecedIds.Split(','); int[] myInts = Array.ConvertAll(ItemsIDs, int.Parse); var selected = model.Items.Where(t => myInts.Contains(t.ItemD)).ToList(); if (selected != null && selected.Count > 0) { List <Order_Details> order_DetailsList = new List <Order_Details>(); var userId = _userManager.GetUserId(User); var CheckUserHasOrder = _appDbContext.order_Header.FirstOrDefault(i => i.CustomerID == userId && i.Status == "Pending"); if (CheckUserHasOrder != null) { foreach (var item in selected) { Order_Details order_Details = new Order_Details(); order_Details.ItemName = item.Name; order_Details.ItemID = item.ItemD; order_Details.ItemPrice = item.Price; order_Details.Quantity = item.Quantity; order_Details.TotalPrice = (item.Price - item.Discount) * item.Quantity; order_Details.Uom = item.Uom; order_Details.Discount = item.Discount; order_Details.Order_Header = CheckUserHasOrder; order_DetailsList.Add(order_Details); } _appDbContext.order_Details.AddRange(order_DetailsList); _appDbContext.SaveChanges(); return(RedirectToAction("GetCardItems", "Home", new { @OrderID = CheckUserHasOrder.Order_Header_ID })); } else { Order_Header order_Header = new Order_Header(); order_Header.OrderDate = DateTime.Now; order_Header.CustomerID = userId; order_Header.Status = "Pending"; order_Header.Tax = 14; foreach (var item in selected) { Order_Details order_Details = new Order_Details(); order_Details.ItemName = item.Name; order_Details.ItemID = item.ItemD; order_Details.ItemPrice = item.Price; order_Details.Quantity = item.Quantity; order_Details.TotalPrice = (item.Price - item.Discount) * item.Quantity; order_Details.Uom = item.Uom; order_Details.Discount = item.Discount; order_DetailsList.Add(order_Details); } order_Header.Order_Details = order_DetailsList; _appDbContext.order_Header.Add(order_Header); _appDbContext.SaveChanges(); return(RedirectToAction("GetCardItems", "Home", new { @OrderID = order_Header.Order_Header_ID })); } } } return(View()); }
public ActionResult UnlockArticles([FromBody] SelectedItemsViewModel selModel) { ArticleService.UnlockArticles(selModel.Ids); return(Json(null)); }
public ActionResult MultipleAssemblePage([FromBody] SelectedItemsViewModel selModel) { return(JsonMessageResult(_pageService.MultipleAssemblePage(selModel.Ids))); }
public override ActionResult MultipleRemove(int parentId, [FromBody] SelectedItemsViewModel model) => base.MultipleRemove(parentId, model);
public ActionResult PreSettings(int parentId, [FromBody] SelectedItemsViewModel model) { return(Json(_service.MultistepActionSettings(parentId, 0, model.Ids))); }
public override ActionResult MultipleRemoveAsChild(int parentId, [FromBody] SelectedItemsViewModel model, int?userId, int?groupId) { return(base.MultipleRemoveAsChild(parentId, model, userId, groupId)); }
public ActionResult MultipleAssemblePageObject([FromBody] SelectedItemsViewModel selModel) { return(Json(_objectService.MultipleAssembleObject(selModel.Ids))); }