public ActSelectionOfProbeDto AddActSelectionOfProbe(long certificateQualite) { var repositoryLink = RepositoryFactory.Create <RelationshipBetweenDocuments>(); var entity = new ActSelectionOfProbe { Catalog = new Catalog(1210980309) }; var actSelectionOfProbe = AddEntity <ActSelectionOfProbe, ActSelectionOfProbeDto>(entity); var documentLink = new RelationshipBetweenDocuments { InDocument = certificateQualite, OutDocument = actSelectionOfProbe.Rn, InUnitCode = NamesOfSectionSystem.CertificateQuality, OutUnitCode = NamesOfSectionSystem.ActSelectionOfProbe }; repositoryLink.Insert(documentLink); return(actSelectionOfProbe); }
internal static IList <ActSelectionOfProbeDepartment> ActSelectionOfProbeDepartmentGenerator(ISession session, ActSelectionOfProbe actSelectionOfProbe) { var i = 2010; return (Builder <ActSelectionOfProbeDepartment> .CreateListOfSize(10) .All() .Do(x => i++) .With(x => x.Rn, 0) .With( x => x.ActSelectionOfProbeDepartmentRequirements = ActSelectionOfProbeDepartmentRequirementGenerator(session, x)) .With(x => x.ActSelectionOfProbe = actSelectionOfProbe) .With(x => x.Catalog, new Catalog(actSelectionOfProbe.Rn)) .With(x => x.AgentDepartment, SampleEntity.CreateAgnlist()) .With(x => x.Creator, SampleEntity.CreateAgnlist()) .With(x => x.Customer, SampleEntity.CreateAgnlist()) .Build()); }