Exemplo n.º 1
0
        private LoggedUserDataGUIModel UserLoggedOut()
        {
            LoggedUserDataGUIModel uderModel = new LoggedUserDataGUIModel()
            {
                CanUserAdministration = false,
                CanUserLogout         = false,
                LoggedUserName        = "******",
                UserPrevilages        = "None",
                AmountOfCurrentAlarms = 0,
            };

            LanguageCodeConverter langConverter = new LanguageCodeConverter();

            _runtimeData.SetLanguageEditData(langConverter.GetLanguageCode(0));

            LoggedUserData logoutData = new LoggedUserData()
            {
                Identity           = 0,
                UserName           = "******",
                AccessLevel        = "None",
                AccessLevelEnum    = AccessLevelEnum.None,
                LogoutEnabled      = false,
                LogoutTime         = 0,
                LangEditPrevilages = 0,
            };

            _runtimeData.SetDataOfCurrentUser(logoutData);

            _logger.Info($"Logged user changed to: {uderModel.LoggedUserName}, Previlages: {uderModel.UserPrevilages}.");

            return(uderModel);
        }
Exemplo n.º 2
0
        protected override string GetMainSiteUrlForLanguage(Language language)
        {
            if (language == Language.Unknown)
            {
                throw new ArgumentOutOfRangeException(nameof(language));
            }

            return($"https://voxeurop.eu/{LanguageCodeConverter.GetLanguageCode(language)}");
        }
Exemplo n.º 3
0
        protected override string GetMainSiteUrlForLanguage(Language language)
        {
            switch (language)
            {
            case Language.English:
                return("https://www.euronews.com/");

            case Language.Unknown:
                throw new ArgumentOutOfRangeException(nameof(language));

            default:
                return($"https://{LanguageCodeConverter.GetLanguageCode(language)}.euronews.com/");
            }
        }
Exemplo n.º 4
0
        private LoggedUserDataGUIModel HandleNewLoggedUserData(LoggedUserData data, int amountOfCurrentAlarms)
        {
            LoggedUserDataGUIModel userModel = new LoggedUserDataGUIModel()
            {
                CanUserAdministration = data.AccessLevelEnum == AccessLevelEnum.Administrator,
                CanUserLogout         = true,
                LoggedUserName        = data.UserName,
                UserPrevilages        = data.AccessLevel,
                AmountOfCurrentAlarms = amountOfCurrentAlarms,
            };

            LanguageCodeConverter langConverter = new LanguageCodeConverter();

            _runtimeData.SetLanguageEditData(langConverter.GetLanguageCode(0));

            _logger.Info($"Logged user changed to: {userModel.LoggedUserName}, Previlages: {userModel.UserPrevilages}.");

            return(userModel);
        }
Exemplo n.º 5
0
        //method for assigning language checkBoxes in modifying mode
        private void AssignLanguagePrevillages(int previlagesNumber)
        {
            _logger.Info($"Assigning state of checkboxes with previlages for changing alarm texts. Previlages number: {previlagesNumber}.");

            LanguageCodeConverter   converter = new LanguageCodeConverter();
            List <LanguageEditData> langData  = converter.GetLanguageCode(previlagesNumber);

            LangSelected1  = langData[0].LanguageEnabled;
            LangSelected2  = langData[1].LanguageEnabled;
            LangSelected3  = langData[2].LanguageEnabled;
            LangSelected4  = langData[3].LanguageEnabled;
            LangSelected5  = langData[4].LanguageEnabled;
            LangSelected6  = langData[5].LanguageEnabled;
            LangSelected7  = langData[6].LanguageEnabled;
            LangSelected8  = langData[7].LanguageEnabled;
            LangSelected9  = langData[8].LanguageEnabled;
            LangSelected10 = langData[9].LanguageEnabled;
            LangSelected11 = langData[10].LanguageEnabled;
            LangSelected12 = langData[11].LanguageEnabled;
            LangSelected13 = langData[12].LanguageEnabled;
            LangSelected14 = langData[13].LanguageEnabled;
            LangSelected15 = langData[14].LanguageEnabled;
            LangSelected16 = langData[15].LanguageEnabled;
        }