Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LanguageManagement"/> class
        /// </summary>
        /// <param name="session">framework that establishes communication between the application and the database</param>
        /// <param name="context">HTTP context</param>
        public LanguageManagement(ISession session, HttpContextBase context)
        {
            this.session = session;
            this.context = context;

            InfoCache <List <Language> > lang = new InfoCache <List <Language> >(context);

            this.colllang = lang.GetCache("languages");

            if (this.colllang == null || this.colllang.Any().Equals(0))
            {
                LanguageRepository langrepo = new LanguageRepository(session);
                this.colllang = langrepo.GetAll();

                lang.SetCache("languages", this.colllang);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FrontEndManagement"/> class
        /// </summary>
        /// <param name="session">framework that establishes communication between the application and the database</param>
        /// <param name="context">HTTP Context</param>
        /// <param name="type">Type of front end object</param>
        /// <param name="language">language of thread</param>
        public FrontEndManagement(ISession session, HttpContextBase context, Type type, Language language)
        {
            this.session  = session;
            this.context  = context;
            this.language = language;
            this.type     = type;

            SectionRepository objsec = new SectionRepository(session);

            this.sections = new List <Section>();
            InfoCache <List <Section> > cache = new InfoCache <List <Section> >(context)
            {
                TimeOut = 120
            };

            this.sections = cache.GetCache("sectionsactive");

            if (this.sections == null)
            {
                objsec.Entity.Active = true;
                this.sections        = objsec.GetAll();
                cache.SetCache("sectionsactive", this.sections);
            }
        }