Example #1
0
        private async Task <string> GetProductGroupName(long?powerofficeProductGroupId)
        {
            if (!powerofficeProductGroupId.HasValue)
            {
                return(string.Empty);
            }

            var powerofficeProductGroup = await PowerofficeClient.GetProductGroup(powerofficeProductGroupId.Value);

            if (powerofficeProductGroup == null)
            {
                return(string.Empty);
            }

            return(powerofficeProductGroup.Name);
        }
Example #2
0
        private async Task <long> GetSalesAccount(Product powerofficeProduct)
        {
            if (powerofficeProduct.SalesAccount.HasValue)
            {
                return(powerofficeProduct.SalesAccount.Value);
            }

            if (powerofficeProduct.ProductGroupId.HasValue)
            {
                var group = await PowerofficeClient.GetProductGroup(powerofficeProduct.ProductGroupId.Value);

                if (group?.SalesAccount != null)
                {
                    return(group.SalesAccount.Value);
                }
            }

            return(Constants.DefaultPowerofficeSalesAccount);
        }