コード例 #1
0
        public async Task<IActionResult> Edit(string id)
        {
            var customerAction = await _customerActionService.GetCustomerActionById(id);
            if (customerAction == null)
                return RedirectToAction("List");

            var model = customerAction.ToModel(_dateTimeHelper);
            model.ConditionCount = customerAction.Conditions.Count();
            await _customerActionViewModelService.PrepareReactObjectModel(model);
            return View(model);
        }
コード例 #2
0
        public IActionResult Edit(string id)
        {
            var customerAction = _customerActionService.GetCustomerActionById(id);

            if (customerAction == null)
            {
                return(RedirectToAction("List"));
            }

            var model = customerAction.ToModel();

            model.ConditionCount = customerAction.Conditions.Count();
            _customerActionViewModelService.PrepareReactObjectModel(model);
            return(View(model));
        }
コード例 #3
0
        public void GetCustomerActionByIdTest()
        {
            var action = _customerActionService.GetCustomerActionById(_Id_CustomerAction);

            Assert.IsNotNull(action);
        }
コード例 #4
0
        public virtual async Task <CustomerActionConditionModel> PrepareCustomerActionConditionModel(string customerActionId)
        {
            var customerAction = await _customerActionService.GetCustomerActionById(customerActionId);

            var actionType = await _customerActionService.GetCustomerActionTypeById(customerAction.ActionTypeId);

            var model = new CustomerActionConditionModel();

            model.CustomerActionId = customerActionId;

            foreach (var item in actionType.ConditionType)
            {
                model.CustomerActionConditionType.Add(new SelectListItem()
                {
                    Value = item.ToString(),
                    Text  = ((CustomerActionConditionTypeEnum)item).ToString()
                });
            }
            return(model);
        }