Beispiel #1
0
        public bool UpdateDefaultTranslation(int referenceId, string text, string updatedBy)
        {
            PhraseTableAdapter adapter = new PhraseTableAdapter();

            MultiLingualData.PhraseDataTable table = adapter.GetPhraseByReferenceId(referenceId);
            if (table.Count == 0)
            {
                return(false);
            }
            MultiLingualData.PhraseRow row = table[0];
            row.defaultPhrase = text;
            row.lastEditedBy  = updatedBy;
            adapter.Update(row);
            UpdateTranslation(row.id, DefaultLanguageCode, text, TranslationStatus.Translated, updatedBy);
            return(true);
        }
Beispiel #2
0
        public Phrase UpdatePhraseText(int phraseId, string text, string updatedBy)
        {
            PhraseTableAdapter adapter = new PhraseTableAdapter();

            MultiLingualData.PhraseDataTable table = adapter.GetPhrase(phraseId);
            if (table.Count == 0)
            {
                return(null);
            }
            MultiLingualData.PhraseRow row = table[0];
            row.defaultPhrase = text;
            row.lastEditedBy  = updatedBy;
            adapter.Update(row);
            UpdateTranslation(row.id, DefaultLanguageCode, text, TranslationStatus.Translated, updatedBy);
            return(MultiLingualHelper.ToPhraseDTO(row, DefaultLanguageCode));
        }
Beispiel #3
0
 public static Phrase ToPhraseDTO(MultiLingualData.PhraseRow row, string defaultLanguageCode)
 {
     return(new Phrase(defaultLanguageCode, row.id, row.defaultPhrase, row.description, row.source, row.createdBy, row.dateCreated, row.lastEditedBy, row.dateLastEdited));
 }