Ejemplo n.º 1
0
        protected T AddBaseText <T>(
            ISession session,
            string name,
            short format,
            string text,
            string cultureName,
            string dictionaryScope,
            string modificationUser,
            DateTime modificationTime
            ) where T : BaseTextEntity, new()
        {
            var cultureRepository         = new CultureRepository(session);
            var dictionaryScopeRepository = new DictionaryScopeRepository(session);

            var culture = cultureRepository.GetCultureByName(cultureName);
            var scope   = dictionaryScopeRepository.GetScopeByName(dictionaryScope);

            var baseTextEntity = new T
            {
                Culture          = culture,
                DictionaryScope  = scope,
                Name             = name,
                Format           = format,
                Text             = text,
                ModificationTime = modificationTime,
                ModificationUser = modificationUser,
            };

            return(baseTextEntity);
        }
Ejemplo n.º 2
0
        public virtual IList <DictionaryScopeEntity> FindAllScopes()
        {
            using (var session = GetSession())
            {
                var dictionaryScopeRepository = new DictionaryScopeRepository(session);

                var resultList = dictionaryScopeRepository.FindAllScopes();

                return(resultList);
            }
        }
Ejemplo n.º 3
0
        public virtual DictionaryScopeEntity GetScopeByName(string cultureName)
        {
            using (var session = GetSession())
            {
                var dictionaryScopeRepository = new DictionaryScopeRepository(session);

                var resultList = dictionaryScopeRepository.GetScopeByName(cultureName);

                return(resultList);
            }
        }
Ejemplo n.º 4
0
        public virtual DictionaryScopeEntity GetScopeById(int id)
        {
            using (var session = GetSession())
            {
                var dictionaryScopeRepository = new DictionaryScopeRepository(session);

                var resultList = dictionaryScopeRepository.GetScopeById(id);

                return(resultList);
            }
        }
Ejemplo n.º 5
0
        public virtual int AddScope(string name)
        {
            using (var session = GetSession())
            {
                var dictionaryScopeRepository = new DictionaryScopeRepository(session);

                var culture = new DictionaryScopeEntity
                {
                    Name = name
                };

                var result = (int)dictionaryScopeRepository.Create(culture);

                return(result);
            }
        }