public async Task <IActionResult> CustomerTags() { var customerTag = (await _customerTagService.GetAllCustomerTags()).Select(x => new { Id = x.Id, Name = x.Name }); return(Json(customerTag)); }
public IActionResult CustomerTags() { var customerTag = _customerTagService.GetAllCustomerTags().Select(x => new { Id = x.Id, Name = x.Name }); return(Json(customerTag)); }
public virtual void PrepareReactObjectModel(CustomerActionModel model) { if (model == null) { throw new ArgumentNullException("model"); } var banners = _bannerService.GetAllBanners(); foreach (var item in banners) { model.Banners.Add(new SelectListItem { Text = item.Name, Value = item.Id.ToString() }); } var message = _messageTemplateService.GetAllMessageTemplates(""); foreach (var item in message) { model.MessageTemplates.Add(new SelectListItem { Text = item.Name, Value = item.Id.ToString() }); } var customerRole = _customerService.GetAllCustomerRoles(); foreach (var item in customerRole) { model.CustomerRoles.Add(new SelectListItem { Text = item.Name, Value = item.Id.ToString() }); } var customerTag = _customerTagService.GetAllCustomerTags(); foreach (var item in customerTag) { model.CustomerTags.Add(new SelectListItem { Text = item.Name, Value = item.Id.ToString() }); } foreach (var item in _customerActionService.GetCustomerActionType()) { model.ActionType.Add(new SelectListItem() { Text = item.Name, Value = item.Id.ToString() }); } foreach (var item in _interactiveFormService.GetAllForms()) { model.InteractiveForms.Add(new SelectListItem() { Text = item.Name, Value = item.Id.ToString() }); } }
public virtual async Task PrepareReactObjectModel(CustomerActionModel model) { if (model == null) { throw new ArgumentNullException(nameof(model)); } var banners = await _bannerService.GetAllBanners(); foreach (var item in banners) { model.Banners.Add(new SelectListItem { Text = item.Name, Value = item.Id.ToString() }); } var message = await _messageTemplateService.GetAllMessageTemplates(""); foreach (var item in message) { model.MessageTemplates.Add(new SelectListItem { Text = item.Name, Value = item.Id.ToString() }); } var customerGroup = await _groupService.GetAllCustomerGroups(); foreach (var item in customerGroup) { model.CustomerGroups.Add(new SelectListItem { Text = item.Name, Value = item.Id.ToString() }); } var customerTag = await _customerTagService.GetAllCustomerTags(); foreach (var item in customerTag) { model.CustomerTags.Add(new SelectListItem { Text = item.Name, Value = item.Id.ToString() }); } foreach (var item in await _customerActionService.GetCustomerActionType()) { model.ActionType.Add(new SelectListItem() { Text = item.Name, Value = item.Id.ToString() }); } foreach (var item in await _interactiveFormService.GetAllForms()) { model.InteractiveForms.Add(new SelectListItem() { Text = item.Name, Value = item.Id.ToString() }); } }