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); }
protected override string GetMainSiteUrlForLanguage(Language language) { if (language == Language.Unknown) { throw new ArgumentOutOfRangeException(nameof(language)); } return($"https://voxeurop.eu/{LanguageCodeConverter.GetLanguageCode(language)}"); }
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/"); } }
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); }
//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; }
//method for converting selected language checkbox into single integer value private int CountLanguagePrevilages() { List <LanguageEditData> langList = new List <LanguageEditData>() { new LanguageEditData() { LanguageBitNumber = 0, LanguageEnabled = LangSelected1 }, new LanguageEditData() { LanguageBitNumber = 1, LanguageEnabled = LangSelected2 }, new LanguageEditData() { LanguageBitNumber = 2, LanguageEnabled = LangSelected3 }, new LanguageEditData() { LanguageBitNumber = 3, LanguageEnabled = LangSelected4 }, new LanguageEditData() { LanguageBitNumber = 4, LanguageEnabled = LangSelected5 }, new LanguageEditData() { LanguageBitNumber = 5, LanguageEnabled = LangSelected6 }, new LanguageEditData() { LanguageBitNumber = 6, LanguageEnabled = LangSelected7 }, new LanguageEditData() { LanguageBitNumber = 7, LanguageEnabled = LangSelected8 }, new LanguageEditData() { LanguageBitNumber = 8, LanguageEnabled = LangSelected9 }, new LanguageEditData() { LanguageBitNumber = 9, LanguageEnabled = LangSelected10 }, new LanguageEditData() { LanguageBitNumber = 10, LanguageEnabled = LangSelected11 }, new LanguageEditData() { LanguageBitNumber = 11, LanguageEnabled = LangSelected12 }, new LanguageEditData() { LanguageBitNumber = 12, LanguageEnabled = LangSelected13 }, new LanguageEditData() { LanguageBitNumber = 13, LanguageEnabled = LangSelected14 }, new LanguageEditData() { LanguageBitNumber = 14, LanguageEnabled = LangSelected15 }, new LanguageEditData() { LanguageBitNumber = 15, LanguageEnabled = LangSelected16 }, }; LanguageCodeConverter converter = new LanguageCodeConverter(); return(converter.GetLanguageIntNumber(langList)); }