Beispiel #1
0
        public async Task <IEnumerable <UtentiMenuDmo> > GetMenuDataOfUserAsync(SupportedLanguage language, string uteId, string cliId)
        {
            // Here only those menus are being retreived which
            // prefixes are 'Talent', status are active and having the provided language name, ute id and client id
            var log = await(from t1 in Context.UtentiAbilitazioni
                            join t2 in Context.TalentPagine
                            on t1.UteabProcedura equals t2.TntfilUteabProcedura
                            join t3 in Context.TalentMenu
                            on t2.TntfilPaginaCodice equals t3.TntmenuTntfilPaginaCodice
                            join t4 in Context.TalentMenuDescr
                            on t3.TntmenuId equals t4.TntmenudescrTntmenuId

                            where t2.TntfilUteabProcedura.StartsWith("Talent") &&
                            t1.UteabUteId == uteId &&
                            t1.UteabCliId == cliId &&
                            t1.UteabAbilitato == "S" &&
                            t3.TntmenuAttivo == true &&
                            t4.TntmenudescrLingua == language.ToString() &&
                            t4.TntmenudescrTntmenuCliId == cliId

                            select new UtentiMenuDmo
            {
                TntmenuId             = t3.TntmenuId,
                TntmenuNome           = t4.TntmenudescrDescrizione,
                TntmenuLivello        = t3.TntmenuLivello,
                TntmenuRouterlink     = t2.TntfilPaginaUrl,
                TntmenuParentid       = t3.TntmenuParentid,
                TntmenuLingua         = t4.TntmenudescrLingua,
                TntmenuHasubmenu      = t3.TntmenuHasubmenu,
                TntmenuIsdefault      = t3.TntmenuIsdefault,
                TntmenuAttivo         = t3.TntmenuAttivo,
                TntmenuOrdinamento    = t3.TntmenuOrdinamento,
                TntmenuUteabProcedura = t1.UteabProcedura,
            }).Distinct().ToListAsync();

            ////// Retrieving the parent menu list, which will belongs the others sub-menus.

            var result = await(from x in Context.TalentMenu
                               join y in Context.TalentMenuDescr
                               on new { X1 = x.TntmenuId, X2 = x.TntmenuCliId } equals new { X1 = y.TntmenudescrTntmenuId, X2 = y.TntmenudescrTntmenuCliId }
                               where y.TntmenudescrLingua == language.ToString() &&
                               x.TntmenuParentid == null &&
                               x.TntmenuCliId == cliId

                               select new UtentiMenuDmo
            {
                TntmenuId   = x.TntmenuId,
                TntmenuNome = y.TntmenudescrDescrizione,
            }).ToListAsync();
            //var parentmenulist = Context.TalentMenu.Where(c => c.TntmenuLingua == langName && c.TntmenuParentid == null).ToList();
            ////// Integrating the parent menu list and clild/sub-menu list into single table.
            var data = result.Union(log).ToList();

            return(data);
        }
Beispiel #2
0
        public static int getIdForSuportedLanguage(SupportedLanguage language)
        {
            switch (language)
            {
            case SupportedLanguage.Cpp:
                return(1);

            case SupportedLanguage.Java:
                return(2);

            case SupportedLanguage.DotNet:
                return(3);

            case SupportedLanguage.ASP_VB6:
                return(4);

            case SupportedLanguage.Cobol:
                return(5);

            default:
                DI.log.error("in MySqlRules_OunceV6.getIdForSuportedLanguage, unsupported language: {0}",
                             language.ToString());
                return(-1);
            }
        }
Beispiel #3
0
        public WatchInputBox(string text, string caption) : base()
        {
            InitializeComponent();

            // UI
            text       = StringParser.Parse(text);
            this.Title = StringParser.Parse(caption);
            this.ConsolePanel.Content = console;

            if (ProjectService.CurrentProject == null)
            {
                language = GetLanguageFromActiveViewContent();
            }
            else
            {
                language = GetLanguage(ProjectService.CurrentProject.Language);
            }

            resolver = new NRefactoryResolver(LanguageProperties.GetLanguage(language.ToString()));

            switch (language)
            {
            case SupportedLanguage.CSharp:
                console.SetHighlighting("C#");
                break;

            case SupportedLanguage.VBNet:
                console.SetHighlighting("VBNET");
                break;
            }

            // get process
            this.Process = ((WindowsDebugger)DebuggerService.CurrentDebugger).DebuggedProcess;
        }
        public async Task <IEnumerable <TipiTermineDescr> > GetAllTerminiTypeWithExtraAsync(SupportedLanguage language, string ClientId)
        {
            var types = await Context.TipiTermineDescr
                        .Where(a => a.TipterdescrLingua.Equals(language.ToString()) && a.TipterdescrTipterCliId.Equals(ClientId))
                        .OrderBy(a => a.TipterdescrTipoTermine)
                        .ToListAsync();

            return(types);
        }
Beispiel #5
0
        public async Task <IEnumerable <KeyValuePairDto> > GetAllRuoloNameAsync(SupportedLanguage language, string ClientId)
        {
            var rolesDescr = await _unitOfWork.RuoliUtentiDescr
                             .FindAsync(r => r.RuolodescrLingua.Equals(language.ToString()) && r.RuolodescrCliId.Equals(ClientId));

            var keyValuePairsList = _mapper.Map <List <KeyValuePairDto> >(rolesDescr.ToList());

            return(keyValuePairsList);
        }
Beispiel #6
0
        public async Task <IEnumerable <KeyValuePairDto> > GetAllTerminiStateAsync(SupportedLanguage language)
        {
            var datas = await _unitOfWork.StatiTermineDescr
                        .FindAsync(a => a.SterdescrLingua.Equals(language.ToString()));

            var keyValuePairsList = _mapper.Map <List <KeyValuePairDto> >(datas.ToList());

            return(keyValuePairsList);
        }
Beispiel #7
0
        public async Task <IEnumerable <KeyValuePairDto> > GetAllAzioniTypeDescriptionAsync(SupportedLanguage language)
        {
            var datas = await _unitOfWork.TipiAzioneDescr
                        .FindAsync(a => a.TpazdescrLingua.Equals(language.ToString()));

            var keyValuePairsList = _mapper.Map <List <KeyValuePairDto> >(datas.ToList());

            return(keyValuePairsList);
        }
Beispiel #8
0
        public async Task <InMemoryFileVo> GetXmlById(Guid projectId, SupportedLanguage language, bool fillGaps)
        {
            Localization project = await repository.GetById(projectId);

            string xmlText = GenerateLanguageXml(project, language, fillGaps);

            return(new InMemoryFileVo
            {
                FileName = String.Format("{0}.xml", language.ToString().ToLower()),
                Contents = Encoding.UTF8.GetBytes(xmlText)
            });
        }
Beispiel #9
0
        private string GetLangName(SupportedLanguage language)
        {
            var langs = languageRepository.GetAll();
            var lang  = langs.FirstOrDefault(x => x.Code == language.ToString());

            if (lang == null)
            {
                return("");
            }

            return(lang.Name);
        }
        public async Task <IActionResult> Role(SupportedLanguage language, string clientId)
        {
            var roleCodes = await _differentListManager.GetAllRuoloCodesAsync(clientId);

            var roleNames = await _differentListManager.GetAllRuoloNameAsync(language, clientId);

            var languages = await _differentListManager.GetAllTerminiLanguageAsync();


            var yesText = _utilityManager.GetTranslatedData(language.ToString(), "common_loc_", "$.common.usrmsg_info.L7014_yes");
            var noText  = _utilityManager.GetTranslatedData(language.ToString(), "common_loc_", "$.common.usrmsg_info.L7015_no");

            var enableText   = _utilityManager.GetTranslatedData(language.ToString(), "ruoli_loc_", "$.ruoli.usrmsg_info.L07352_enabled");
            var disabledText = _utilityManager.GetTranslatedData(language.ToString(), "ruoli_loc_", "$.ruoli.usrmsg_info.L07353_disabled");


            var stateList = new List <KeyValuePairDto>
            {
                new KeyValuePairDto("S", enableText),
                new KeyValuePairDto("N", disabledText)
            };

            var systemList = new List <KeyValuePairDto>
            {
                new KeyValuePairDto("S", yesText),
                new KeyValuePairDto("N", noText)
            };

            var dt = new List <List <KeyValuePairDto> >();

            dt.Add(roleCodes.ToList());
            dt.Add(roleNames.ToList());
            dt.Add(languages.ToList());
            dt.Add(stateList);
            dt.Add(systemList);

            return(Ok(dt));
        }
Beispiel #11
0
        private void SetPreferences(ApplicationUser user)
        {
            UserPreferencesViewModel preferences = UserPreferencesAppService.GetByUserId(new Guid(user.Id));

            if (preferences == null || preferences.Id == Guid.Empty)
            {
                RequestCulture    requestLanguage = Request.HttpContext.Features.Get <IRequestCultureFeature>().RequestCulture;
                SupportedLanguage lang            = base.SetLanguageFromCulture(requestLanguage.UICulture.Name);

                SetCookieValue(SessionValues.PostLanguage, lang.ToString(), 7);
            }
            else
            {
                SetCookieValue(SessionValues.PostLanguage, preferences.UiLanguage.ToString(), 7);
                SetSessionValue(SessionValues.JobProfile, preferences.JobProfile.ToString());
            }
        }
 public static int getIdForSuportedLanguage(SupportedLanguage language)
 {
     switch (language)
     {
         case SupportedLanguage.Cpp:
             return 1;
         case SupportedLanguage.Java:
             return 2;
         case SupportedLanguage.DotNet:
             return 3;
         case SupportedLanguage.ASP_VB6:
             return 4;
         case SupportedLanguage.Cobol:
             return 5;
         default:
             DI.log.error("in MySqlRules_OunceV6.getIdForSuportedLanguage, unsupported language: {0}",
                          language.ToString());
             return -1;
     }
 }
        private void ChangeTranslatorLanguage(SupportedLanguage language)
        {
            switch (language.ToString().ToLower())
            {
            case "french":
                GlobalCulture.Instance.Ci = new CultureInfo("fr-FR");
                break;

            case "english":
                GlobalCulture.Instance.Ci = new CultureInfo("en-GB");
                break;

            default:
#if DEBUG
                throw new ArgumentException(
                          String.Format("Language '{0}' is not yet present in the options, if you added the corresponding ressource please add a corresponding case.", LDVELH_WPF.Properties.Settings.Default.Language.ToLower()),
                          "Text");
#else
                GlobalCulture.Instance.Ci = new CultureInfo("en-GB");
                break;
#endif
            }
        }
        public IActionResult Review(Guid id, SupportedLanguage language, int?pointsEarned)
        {
            OperationResultVo result = translationAppService.GetById(CurrentUserId, id);

            if (result.Success)
            {
                OperationResultVo <LocalizationViewModel> castRestult = result as OperationResultVo <LocalizationViewModel>;

                LocalizationViewModel model = castRestult.Value;

                SetLocalization(model);
                SetAuthorDetails(model);

                SetGamificationMessage(pointsEarned);

                ViewData["language"] = language.ToString();

                return(View("ReviewWrapper", model));
            }
            else
            {
                return(null);
            }
        }
 public static string GetText(KeyWord keyword, SupportedLanguage language)
 {
     return(m_Manager.LoadDataFormFile(language.ToString(), keyword.ToString()));
 }