コード例 #1
0
        public static SertificateUec CreateNew(int depth = 0)
        {
            rt.srz.model.srz.SertificateUec entity = new rt.srz.model.srz.SertificateUec();

            // You may need to maually enter this key if there is a constraint violation.
            entity.Id = System.Guid.NewGuid();

            entity.Key         = new System.Byte[] {};
            entity.Version     = default(Int16);
            entity.IsActive    = true;
            entity.InstallDate = System.DateTime.Now;

            using (rt.srz.business.manager.IConceptManager conceptManager = ObjectFactory.GetInstance <IConceptManager>())
            {
                var     all       = conceptManager.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.IOrganisationManager organisationManager = ObjectFactory.GetInstance <IOrganisationManager>())
            {
                entity.Smo = null;
            }

            using (rt.srz.business.manager.IWorkstationManager workstationManager = ObjectFactory.GetInstance <IWorkstationManager>())
            {
                entity.Workstation = null;
            }

            return(entity);
        }
コード例 #2
0
        public static Setting CreateNew(int depth = 0)
        {
            rt.srz.model.srz.Setting entity = new rt.srz.model.srz.Setting();

            // You may need to maually enter this key if there is a constraint violation.
            entity.Id = System.Guid.NewGuid();

            entity.Name        = "Test Test ";
            entity.ValueString = "Test Test ";
            entity.UserId      = new Guid("01000000-0000-0000-0000-000000000000");

            using (rt.srz.business.manager.IOrganisationManager organisationManager = ObjectFactory.GetInstance <IOrganisationManager>())
            {
                entity.Organisation = null;
            }

            using (rt.srz.business.manager.IWorkstationManager workstationManager = ObjectFactory.GetInstance <IWorkstationManager>())
            {
                entity.Workstation = null;
            }

            return(entity);
        }