Example #1
0
        public async Task <IActionResult> Post([FromBody] AddNewCustomerGroupRequest request)
        {
            AddNewCustomerGroupResponse result = await _CustomerGroupAppService.addNewCustomerGroup(request);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(NotFound(result));
        }
Example #2
0
        public Task <AddNewCustomerGroupResponse> addNewCustomerGroup(AddNewCustomerGroupRequest request)
        {
            AddNewCustomerGroupCommand command = new AddNewCustomerGroupCommand(request.Name);
            Task <object> CustomerGroup        = (Task <object>)Bus.SendCommand(command);
            //RabbitMQBus.Publish(command);
            AddNewCustomerGroupResponse response = new AddNewCustomerGroupResponse();

            response = Common <AddNewCustomerGroupResponse> .checkHasNotification(_notifications, response);

            if (response.Success)
            {
                CustomerGroupModel CustomerGroupModel = (CustomerGroupModel)CustomerGroup.Result;
                response.Data = CustomerGroupModel.ID;
            }
            return(Task.FromResult(response));
        }