Beispiel #1
0
        public static CompanyInformationModel ToModel(this CompanyInformation entity, int languageId)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("company");
            }
            var model = new CompanyInformationModel()
            {
                CompanyName        = entity.CompanyName,
                CompanyDescription = entity.CompanyDescription,
                AccountNumbers     = entity.AccountNumbers,
                BankAddress        = entity.BankAddress,
                BankName           = entity.BankName,
                LegalAddress       = entity.LegalAddress,
                SWIFT = entity.SWIFT,
                TaxRegistrationNumber = entity.TaxRegistrationNumber,
                TopExecutiveName      = entity.TopExecutiveName,
                SeName = entity.GetSeName(languageId, returnDefaultValue: true),
            };
            var customer = entity.Customers.FirstOrDefault();

            model.CustomerId = customer.Id;
            if (customer.IsSeller())
            {
                model.Seller = true;
            }

            return(model);
        }