Example #1
0
        public void AddPaymentType([FromBody] AddPaymentTypeRequest request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            CommandProcessor.Execute(
                new AddPaymentTypeCommand(request.Name, request.Description, request.Company, request.Color));
        }
Example #2
0
        public void AddPaymentType(AddPaymentTypeRequest request)
        {
            PaymentType model = this._paymentTypeRepository.FindBy(request.Id);

            if (model == null)
            {
                throw new EntityIsInvalidException <string>(request.Id.ToString());
            }
            this._paymentTypeRepository.Add(model);
            this._uow.Commit();
        }