Example #1
0
        public void LoadLanguages(string language)
        {
            if (language == null)
            {
                return;
            }

            LabelsAndMessagesCustomerDemographics labelsAndMessagesCustomerDemographics = new LabelsAndMessagesCustomerDemographics();
            WPFLanguage wPFLanguage = LanguageHelper.GetLanguageForForms(language, "CustomerDemographics");
        }
Example #2
0
        public void Setup_SetLanguage(string language)
        {
            if (language == null)
            {
                return;
            }

            LabelsAndMessagesCustomerDemographics labelsAndMessagesCustomerDemographics = new LabelsAndMessagesCustomerDemographics();
            WPFLanguage wPFLanguage = LanguageHelper.GetLanguageForForms(language, "CustomerDemographics");
            LabelsAndMessagesCustomerDemographics labelsAndMessages = new LabelsAndMessagesCustomerDemographics();
            LanguageElement languageElement;

            languageElement = wPFLanguage.LanguageElementsFromDB.Where(x => x.OriginalValue == labelsAndMessages.LabelsFromDBCustomerDemographics.LabelCustomerTypeID).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LabelsFromDBCustomerDemographics.LabelCustomerTypeID = languageElement.TranslatedValue;
            }

            languageElement = wPFLanguage.LanguageElementsFromDB.Where(x => x.OriginalValue == labelsAndMessages.LabelsFromDBCustomerDemographics.LabelCustomerDesc).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LabelsFromDBCustomerDemographics.LabelCustomerDesc = languageElement.TranslatedValue;
            }

            //Labels
            languageElement = wPFLanguage.LanguageElementsDefaultControls.Where(x => x.OriginalValue == labelsAndMessages.LanguageElementsControlsCustomerDemographics.LabelBtnNew).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LanguageElementsControlsCustomerDemographics.LabelBtnNew = languageElement.TranslatedValue;
            }

            languageElement = wPFLanguage.LanguageElementsDefaultControls.Where(x => x.OriginalValue == labelsAndMessages.LanguageElementsControlsCustomerDemographics.LabelBtnDelete).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LanguageElementsControlsCustomerDemographics.LabelBtnDelete = languageElement.TranslatedValue;
            }

            languageElement = wPFLanguage.LanguageElementsDefaultControls.Where(x => x.OriginalValue == labelsAndMessages.LanguageElementsControlsCustomerDemographics.LabelBtnUpdate).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LanguageElementsControlsCustomerDemographics.LabelBtnUpdate = languageElement.TranslatedValue;
            }

            //Messages
            languageElement = wPFLanguage.LanguageElementsDefaultMessages.Where(x => x.OriginalValue == labelsAndMessages.LanguageElementsMessagesCustomerDemographics.MessageBoxDeleteConfirm).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LanguageElementsMessagesCustomerDemographics.MessageBoxDeleteConfirm = languageElement.TranslatedValue;
            }

            languageElement = wPFLanguage.LanguageElementsDefaultMessages.Where(x => x.OriginalValue == labelsAndMessages.LanguageElementsMessagesCustomerDemographics.MessageBoxSaveOK).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LanguageElementsMessagesCustomerDemographics.MessageBoxSaveError = languageElement.TranslatedValue;
            }

            languageElement = wPFLanguage.LanguageElementsDefaultMessages.Where(x => x.OriginalValue == labelsAndMessages.LanguageElementsMessagesCustomerDemographics.MessageBoxSaveOK).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LanguageElementsMessagesCustomerDemographics.MessageBoxSaveOK = languageElement.TranslatedValue;
            }

            CustomerDemographicsDataContext.LabelsAndMessagesCustomerDemographics = labelsAndMessages;
        }