private void AddDefaultTag(int category, String en, String de, String fr, String es, LanguageWriting enWrite, LanguageWriting deWrite, LanguageWriting frWrite, LanguageWriting esWrite, DbTransaction transaction) { int id = enWrite.DoAddTag(category, en, transaction); deWrite.DoSetTagName(id, de, transaction); frWrite.DoSetTagName(id, fr, transaction); esWrite.DoSetTagName(id, es, transaction); }
private int AddDefaultCategory(String en, String de, String fr, String es, LanguageWriting enWrite, LanguageWriting deWrite, LanguageWriting frWrite, LanguageWriting esWrite, DbTransaction transaction) { int id = enWrite.DoAddCategory(en, transaction); deWrite.DoSetCategoryName(id, de, transaction); frWrite.DoSetCategoryName(id, fr, transaction); esWrite.DoSetCategoryName(id, es, transaction); return(id); }
public ITagsDBWriteByLanguage GetWriteInterfaceByLanguage(int languageId) { if (!m_WritesByLanguage.ContainsKey(languageId)) { LanguageWriting write = new LanguageWriting(languageId, m_Connection); m_Clients.Add(write); m_WritesByLanguage[languageId] = write; return(write); } else { return(m_WritesByLanguage[languageId]); } }
private void InsertDefaultValues(DbTransaction transaction) { // Languages TagsTranslations translations = new TagsTranslations(m_Connection); int enId = translations.DoAddLanguage("en", "English", transaction); int deId = translations.DoAddLanguage("de", "German", enId, transaction); int frId = translations.DoAddLanguage("fr", "French", enId, transaction); int esId = translations.DoAddLanguage("es", "Spanish", enId, transaction); translations.DoSetLanguageName(deId, enId, "Englisch", transaction); translations.DoSetLanguageName(deId, deId, "Deutsch", transaction); translations.DoSetLanguageName(deId, frId, "Französisch", transaction); translations.DoSetLanguageName(deId, esId, "Spanisch", transaction); translations.DoSetLanguageName(frId, enId, "Anglais", transaction); translations.DoSetLanguageName(frId, deId, "Allemand", transaction); translations.DoSetLanguageName(frId, frId, "Français", transaction); translations.DoSetLanguageName(frId, esId, "Espagnol", transaction); translations.DoSetLanguageName(esId, enId, "Inglés", transaction); translations.DoSetLanguageName(esId, deId, "Aléman", transaction); translations.DoSetLanguageName(esId, frId, "Francés", transaction); translations.DoSetLanguageName(esId, esId, "Castellano", transaction); // Categories LanguageWriting en = new LanguageWriting(enId, m_Connection); LanguageWriting de = new LanguageWriting(deId, m_Connection); LanguageWriting fr = new LanguageWriting(frId, m_Connection); LanguageWriting es = new LanguageWriting(esId, m_Connection); int atmId = AddDefaultCategory("Mood", "Stimmung", "Ambiance", "Ambiente", en, de, fr, es, transaction); int sitId = AddDefaultCategory("Situation", "Situation", "Situation", "Situación", en, de, fr, es, transaction); int placeId = AddDefaultCategory("Place", "Ort", "Lieu", "Lugar", en, de, fr, es, transaction); // Tags String[][][] tags = new String[][][] { new String[][] { new String[] { "Suspense", "Spannung", "Suspense", "Suspense" }, new String[] { "Recovery", "Erholung", "Répos", "Recuperación" }, new String[] { "Mourning", "Trauer", "Deuil", "Duelo" } }, new String[][] { new String[] { "Fight", "Kampf", "Combat", "Combate" }, new String[] { "Ritual", "Ritual", "Rituel", "Ritual" }, new String[] { "Travel", "Reise", "Voyage", "Viaje" } }, new String[][] { new String[] { "Orient", "Orient", "Orient", "Oriente" }, new String[] { "Jungle", "Dschungel", "Jungle", "Jungla" }, new String[] { "Sea", "Meer", "Mer", "Mar" } } }; int[] catIds = new int[] { atmId, sitId, placeId }; for (int i = 0; i < catIds.Length; ++i) { String[][] catTags = tags[i]; for (int j = 0; j < catTags.Length; ++j) { String[] names = catTags[j]; AddDefaultTag(catIds[i], names[0], names[1], names[2], names[3], en, de, fr, es, transaction); } } }