Exemplo n.º 1
0
        public string CreateDistributorTransfer(DistributorTransfer distributorTransfer)
        {
            CheckHelper.ArgumentNotNull(distributorTransfer, "distributorTransfer");
            CheckHelper.WithinCondition(SecurityService.IsLoggedIn, "SecurityService.IsLoggedIn");

            var errors = IoC.Container.Get <IValidateService>().Validate(distributorTransfer);

            if (errors != null)
            {
                return(errors.ToErrorMessage());
            }

            var createdDistributorTransfer = (DistributorTransfer)distributorTransfer.Clone();

            var errorMessage = APIClientHelper <DocumentAPIClient> .Call(c => c.CreateDistributorTransfer(ref createdDistributorTransfer));

            distributorTransfer.Id = createdDistributorTransfer.Id;

            return(errorMessage);
        }