コード例 #1
0
        public Translation UpdateTranslation(int phraseId, string languageCode, string translationText, TranslationStatus status, string updatedBy)
        {
            TranslationTableAdapter adapter = new TranslationTableAdapter();

            MultiLingualData.TranslationDataTable table = adapter.GetTranslationByPhraseId(phraseId, languageCode);
            if (table.Count == 0)
            {
                return(null);
            }
            MultiLingualData.TranslationRow row = table[0];
            row.translationText = translationText;
            row.status          = (int)status;
            row.lastEditedBy    = updatedBy;
            adapter.Update(row);
            return(MultiLingualHelper.ToTranslationDTO(row));
        }
コード例 #2
0
 public static Translation ToTranslationDTO(MultiLingualData.TranslationRow row)
 {
     return(new Translation(row.id, row.phraseId, row.languageCode, row.translationText, (TranslationStatus)Enum.Parse(typeof(TranslationStatus), row.status.ToString()), row.createdBy, row.dateCreated, row.lastEditedBy, row.dateLastEdited));
 }