public ActionResult AddSelectionDataItem(string attributeKey) { ViewBag.MenuItem = CurrentMenuItem; SelectionDataItemDetail newSelectionDataItem = new SelectionDataItemDetail(); newSelectionDataItem.AttributeKey = attributeKey; ViewData.Model = newSelectionDataItem; return(View()); }
public async Task AddSelectionDataItemAsync(SelectionDataItemDetail selectionDataItem) { var newSelectionDataItem = new SelectionDataItem() { AttributeKey = selectionDataItem.AttributeKey, Value = selectionDataItem.DataItemValue, SelectionKey = selectionDataItem.SelectionKey }; await _selectionDataItemRepository.SaveAsync(newSelectionDataItem); }
public void AddSelectionDataItem(SelectionDataItemDetail selectionDataItem) { var newSelectionDataItem = new SelectionDataItem() { AttributeKey = selectionDataItem.AttributeKey, Value = selectionDataItem.DataItemValue, SelectionKey = selectionDataItem.SelectionKey }; selectionDataRepository.Save(newSelectionDataItem); }
public async Task <bool> Handle(AddSelectionValueCommand message, CancellationToken cancellationToken) { var detail = new SelectionDataItemDetail() { AttributeKey = message.AttributeKey, DataItemValue = message.DataItemValue, SelectionKey = message.SelectionKey, }; await _customAttributeService.AddSelectionDataItemAsync(detail); _logger.LogInformation($"----- Selection Data Item {message.AttributeKey} created"); return(true); }
public ActionResult AddSelectionDataItem(SelectionDataItemDetail selectionDataItem) { ViewBag.MenuItem = CurrentMenuItem; TryValidateModel(selectionDataItem); if (ModelState.IsValid) { try { customAttributeService.AddSelectionDataItem(selectionDataItem); return(RedirectToAction("ViewSelectionDataItems", new { AttributeName = selectionDataItem.AttributeKey })); } catch (BusinessException bex) { ModelState.AddModelError("Name", bex.Message); } } ViewData.Model = selectionDataItem; return(View()); }