protected override int CreateOrGetOrganizationIdAdditional(int contragentId, Record record) { if (record.OrganizationType != OrgType.ResourceProvider) { return(0); } if (this.publicServiceOrgByContragentIdDict.ContainsKey(contragentId)) { return(this.publicServiceOrgByContragentIdDict[contragentId]); } // create var publicServiceOrg = new PublicServiceOrg { Contragent = new Contragent { Id = contragentId }, OrgStateRole = OrgStateRole.Active, ActivityGroundsTermination = GroundsTermination.NotSet }; PublicServiceOrgRepository.Save(publicServiceOrg); this.publicServiceOrgByContragentIdDict[contragentId] = publicServiceOrg.Id; return(publicServiceOrg.Id); }
protected override int CreateOrGetOrganizationIdAdditional(int contragentId, Record record) { if (record.OrganizationType != OrgType.ResourceProvider) { return 0; } if (this.publicServiceOrgByContragentIdDict.ContainsKey(contragentId)) { return this.publicServiceOrgByContragentIdDict[contragentId]; } // create var publicServiceOrg = new PublicServiceOrg { Contragent = new Contragent { Id = contragentId }, OrgStateRole = OrgStateRole.Active, ActivityGroundsTermination = GroundsTermination.NotSet }; PublicServiceOrgRepository.Save(publicServiceOrg); this.publicServiceOrgByContragentIdDict[contragentId] = publicServiceOrg.Id; return publicServiceOrg.Id; }