public IActionResult List(DataSourceRequest command)
        {
            var forms     = _interactiveFormService.GetAllForms();
            var gridModel = new DataSourceResult
            {
                Data = forms.Select(x =>
                {
                    var model  = x.ToModel();
                    model.Body = "";
                    return(model);
                }),
                Total = forms.Count
            };

            return(Json(gridModel));
        }
Esempio n. 2
0
        public IActionResult List(DataSourceRequest command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageBanners))
            {
                return(AccessDeniedView());
            }

            var forms     = _interactiveFormService.GetAllForms();
            var gridModel = new DataSourceResult
            {
                Data = forms.Select(x =>
                {
                    var model  = x.ToModel();
                    model.Body = "";
                    return(model);
                }),
                Total = forms.Count
            };

            return(Json(gridModel));
        }
        public virtual async Task PrepareReactObjectModel(CustomerActionModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("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 customerRole = await _customerService.GetAllCustomerRoles();

            foreach (var item in customerRole)
            {
                model.CustomerRoles.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()
                });
            }
        }