public async Task <IActionResult> ListTypes()
        {
            var model = (await _customerActionService.GetCustomerActionType())
                        .Select(x => x.ToModel())
                        .ToList();

            return(View(model));
        }
Exemplo n.º 2
0
        public IActionResult ListTypes()
        {
            var model = _customerActionService.GetCustomerActionType()
                        .Select(x => x.ToModel())
                        .ToList();

            return(View(model));
        }
        public ActionResult ListTypes()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageActions))
            {
                return(AccessDeniedView());
            }

            var model = _customerActionService.GetCustomerActionType()
                        .Select(x => x.ToModel())
                        .ToList();

            return(View(model));
        }
 public async Task<IActionResult> List(DataSourceRequest command)
 {
     var customeractions = await _customerActionService.GetCustomerActions();
     var actions = await _customerActionService.GetCustomerActionType();
     var gridModel = new DataSourceResult
     {
         Data = customeractions.Select(x => new { Id = x.Id, Name = x.Name, Active = x.Active, ActionType = actions.FirstOrDefault(y=>y.Id == x.ActionTypeId)?.Name }),
         Total = customeractions.Count()
     };
     return Json(gridModel);
 }
        public async Task GetCustomerActionTypeTest()
        {
            var actionTypes = await _customerActionService.GetCustomerActionType();

            Assert.IsTrue(actionTypes.Count > 0);
        }
        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()
                });
            }
        }
Exemplo n.º 7
0
        public void GetCustomerActionTypeTest()
        {
            var actionTypes = _customerActionService.GetCustomerActionType();

            Assert.IsTrue(actionTypes.Count > 0);
        }