예제 #1
0
        public IStringMetaField InitializeStringMetaFieldTemplate(IMetaEntity metaMetaField)
        {
            var stringMetaField = ModelFactory.CreateStringMetaField();

            EntityService.SetEntityDefaultValues(stringMetaField, metaMetaField);
            var now  = DateTime.Now;
            var user = MetaModelRepository.GetMdUser(DEFAULT_USER_LOGIN);

            stringMetaField.CreationDate   = now;
            stringMetaField.CreationUser   = user;
            stringMetaField.LastUpdateDate = now;
            stringMetaField.LastUpdateUser = user;
            return(stringMetaField);
        }
예제 #2
0
        public IMetaEntity InitializeMetaEntity(IMetaEntity metaMetaEntity)
        {
            var metaEntity = ModelFactory.CreateMetaEntity();

            EntityService.SetEntityDefaultValues(metaEntity, metaMetaEntity);
            var now  = DateTime.Now;
            var user = MetaModelRepository.GetMdUser(DEFAULT_USER_LOGIN);

            metaEntity.CreationDate   = now;
            metaEntity.CreationUser   = user;
            metaEntity.LastUpdateDate = now;
            metaEntity.LastUpdateUser = user;
            return(metaEntity);
        }
예제 #3
0
        public IEntityMetaField InitializeEntityMetaField(IMetaEntity metaMetaField, IMetaEntity metaEntity)
        {
            var entityMetaField = ModelFactory.CreateEntityMetaField();

            EntityService.SetEntityDefaultValues(entityMetaField, metaMetaField);
            var now  = DateTime.Now;
            var user = MetaModelRepository.GetMdUser(DEFAULT_USER_LOGIN);

            entityMetaField.MetaEntity     = metaEntity;
            entityMetaField.CreationDate   = now;
            entityMetaField.CreationUser   = user;
            entityMetaField.LastUpdateDate = now;
            entityMetaField.LastUpdateUser = user;
            return(entityMetaField);
        }
예제 #4
0
        public IRegularExpression InitializeRegularExpression(IMetaEntity metaRegularExpression)
        {
            var regularExpression = ModelFactory.CreateRegularExpression();

            EntityService.SetEntityDefaultValues(regularExpression, metaRegularExpression);
            var now  = DateTime.Now;
            var user = MetaModelRepository.GetMdUser(DEFAULT_USER_LOGIN);

            regularExpression.CreationDate   = now;
            regularExpression.CreationUser   = user;
            regularExpression.LastUpdateDate = now;
            regularExpression.LastUpdateUser = user;

            return(regularExpression);
        }
예제 #5
0
        public IList <ValueCheckingResult> SaveMetaEntity(IEntityValidator entityValidator, IMetaEntity metaEntity)
        {
            var results = EntityService.CheckEntity(entityValidator, metaEntity);

            if (results.All(r => r.IsValid))
            {
                var user = MetaModelRepository.GetMdUser(DEFAULT_USER_LOGIN);
                var now  = DateTime.Now;
                metaEntity.LastUpdateDate = now;
                metaEntity.LastUpdateUser = user;
                if (EntityService.IsEntityNew(metaEntity))
                {
                    metaEntity.CreationDate = now;
                    metaEntity.CreationUser = user;
                    MetaModelRepository.CreateMetaEntity(metaEntity);
                }
                else
                {
                    MetaModelRepository.UpdateMetaEntity(metaEntity);
                }
            }
            return(results);
        }
예제 #6
0
        public IList <ValueCheckingResult> SaveRegularExpression(IEntityValidator entityValidator,
                                                                 IRegularExpression regularExpression)
        {
            var results = EntityService.CheckEntity(entityValidator, regularExpression);

            if (results.All(r => r.IsValid))
            {
                var user = MetaModelRepository.GetMdUser(DEFAULT_USER_LOGIN);
                var now  = DateTime.Now;
                regularExpression.LastUpdateDate = now;
                regularExpression.LastUpdateUser = user;
                if (EntityService.IsEntityNew(regularExpression))
                {
                    regularExpression.CreationDate = now;
                    regularExpression.CreationUser = user;
                    MetaModelRepository.CreateRegularExpression(regularExpression);
                }
                else
                {
                    MetaModelRepository.UpdateRegularExpression(regularExpression);
                }
            }
            return(results);
        }