コード例 #1
0
        public Organization Add(
            string title,
            string titleShort,
            Guid?parentOrganizationId,
            Guid organizationTypeId,
            string legalAddress,
            string postAddress,
            string phone,
            string fax,
            string email,
            string inn,
            string kpp,
            string ogrn,
            string okved,
            string okpo,
            string okato,
            string accountNumber,
            string bankTitle,
            string bik,
            string bankCorrespAccount)
        {
            var organization = _organizationFactory.Create(
                title,
                titleShort,
                parentOrganizationId,
                organizationTypeId);

            var organizationRequisites = _organizationRequisiteFactory.Create(
                organization.Id,
                legalAddress,
                postAddress,
                phone,
                fax,
                email,
                inn,
                kpp,
                ogrn,
                okved,
                okpo,
                okato,
                accountNumber,
                bankTitle,
                bik,
                bankCorrespAccount);

            _organizationRepository.Add(organization);

            _organizationRequisitesRepository.Add(organizationRequisites);

            return(organization);
        }
コード例 #2
0
        /// <summary>
        ///     Handles the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <param name="response">The response.</param>
        protected override void Handle(CreateOrganizationRequest request, DtoResponse <OrganizationSummaryDto> response)
        {
            var organization = _organizationFactory.Create(request.Name);

            response.DataTransferObject = Mapper.Map <Organization, OrganizationSummaryDto>(organization);
        }