public void UpdateSubOrganization(SubOrganizationModel subOrganizationModel)
        {
            var organization = GetFoundationOrganizationById(subOrganizationModel.OrganizationId.ToString());

            organization.Name = subOrganizationModel.Name;
            organization.SaveChanges();
            foreach (var location in subOrganizationModel.Locations)
            {
                _addressBookService.UpdateOrganizationAddress(organization, location);
            }
        }
        public void UpdateSubOrganization(SubOrganizationModel subOrganizationModel)
        {
            var organization =
                _organizationDomainService.GetOrganizationEntityById(subOrganizationModel.OrganizationId.ToString());

            organization.Name = subOrganizationModel.Name;
            organization.SaveChanges();
            foreach (var location in subOrganizationModel.Locations)
            {
                _addressService.UpdateOrganizationAddress(organization, location);
            }
        }
        public void CreateSubOrganization(SubOrganizationModel newSubOrganization)
        {
            var currentOrganization = _organizationDomainService.GetCurrentUserOrganizationEntity();

            if (currentOrganization == null)
            {
                return;
            }

            var organization = _organizationDomainService.GetNewOrganization();

            organization.Name = newSubOrganization.Name;
            organization.ParentOrganizationId = currentOrganization.OrganizationId;
            organization.SaveChanges();

            foreach (var location in newSubOrganization.Locations)
            {
                _addressService.UpdateOrganizationAddress(organization, location);
            }
        }
        public void CreateSubOrganization(SubOrganizationModel newSubOrganization)
        {
            var currentOrganization = GetCurrentFoundationOrganization();

            if (currentOrganization == null)
            {
                return;
            }

            var organization = FoundationOrganization.New();

            organization.Name = newSubOrganization.Name;
            organization.ParentOrganizationId = currentOrganization.OrganizationId;
            organization.SaveChanges();

            foreach (var location in newSubOrganization.Locations)
            {
                _addressBookService.UpdateOrganizationAddress(organization, location);
            }
        }