public static EmploymentHistory CreateNew(int depth = 0) { rt.srz.model.srz.EmploymentHistory entity = new rt.srz.model.srz.EmploymentHistory(); // You may need to maually enter this key if there is a constraint violation. entity.Id = System.Guid.NewGuid(); entity.Employment = true; using (rt.srz.business.manager.IConceptManager conceptManager = ObjectFactory.GetInstance <IConceptManager>()) { entity.SourceType = null; } using (rt.srz.business.manager.IInsuredPersonManager insuredPersonManager = ObjectFactory.GetInstance <IInsuredPersonManager>()) { entity.InsuredPerson = null; } using (rt.srz.business.manager.IPeriodManager periodManager = ObjectFactory.GetInstance <IPeriodManager>()) { entity.Period = null; } using (rt.srz.business.manager.IQueryResponseManager queryResponseManager = ObjectFactory.GetInstance <IQueryResponseManager>()) { entity.QueryResponse = null; } return(entity); }
public static Batch CreateNew(int depth = 0) { rt.srz.model.srz.Batch entity = new rt.srz.model.srz.Batch(); // You may need to maually enter this key if there is a constraint violation. entity.Id = System.Guid.NewGuid(); entity.FileName = "Test Test Test Test Test Test Test Test Test Test Test Test Tes"; entity.Number = default(Int16); using (rt.srz.business.manager.IConceptManager concept1Manager = ObjectFactory.GetInstance <IConceptManager>()) { entity.CodeConfirm = null; } using (rt.srz.business.manager.IConceptManager concept2Manager = ObjectFactory.GetInstance <IConceptManager>()) { var all = concept2Manager.GetAll(1); Concept entityRef = null; if (all.Count > 0) { entityRef = all[0]; } if (entityRef == null && depth < 3) { depth++; entityRef = ConceptTests.CreateNew(depth); ObjectFactory.GetInstance <ISessionFactory>().GetCurrentSession().Save(entityRef); } entity.Subject = entityRef; } using (rt.srz.business.manager.IConceptManager concept3Manager = ObjectFactory.GetInstance <IConceptManager>()) { var all = concept3Manager.GetAll(1); Concept entityRef = null; if (all.Count > 0) { entityRef = all[0]; } if (entityRef == null && depth < 3) { depth++; entityRef = ConceptTests.CreateNew(depth); ObjectFactory.GetInstance <ISessionFactory>().GetCurrentSession().Save(entityRef); } entity.Type = entityRef; } using (rt.srz.business.manager.IPeriodManager periodManager = ObjectFactory.GetInstance <IPeriodManager>()) { entity.Period = null; } using (rt.srz.business.manager.IOrganisationManager organisation1Manager = ObjectFactory.GetInstance <IOrganisationManager>()) { entity.Receiver = null; } using (rt.srz.business.manager.IOrganisationManager organisation2Manager = ObjectFactory.GetInstance <IOrganisationManager>()) { entity.Sender = null; } return(entity); }