public Phrase GetPhraseByText(string text)
        {
            PhraseTableAdapter adapter = new PhraseTableAdapter();

            MultiLingualData.PhraseDataTable table = adapter.GetPhraseByText(text);
            if (table.Count == 0)
            {
                return(null);
            }
            return(MultiLingualHelper.ToPhraseDTO(table[0], DefaultLanguageCode));
        }
        public Phrase GetPhraseByReferenceId(int referenceId)
        {
            PhraseTableAdapter adapter = new PhraseTableAdapter();

            MultiLingualData.PhraseDataTable table = adapter.GetPhraseByReferenceId(referenceId);
            if (table.Count == 0)
            {
                return(null);
            }
            return(MultiLingualHelper.ToPhraseDTO(table[0], DefaultLanguageCode));
        }
        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));
        }