private void NewRowManual(ref SLanguageSpecificRow ARow) { // Deal with primary key. LanguageCode is unique and is 10 characters. // We use the first unused language code from our language code list Type DataTableType; // Load Data PLanguageTable allLanguages = new PLanguageTable(); DataTable CacheDT = TDataCache.GetCacheableDataTableFromCache("LanguageCodeList", String.Empty, null, out DataTableType); allLanguages.Merge(CacheDT); // Because of the checking code in NewRecord, we know there is at least one spare language we can use int rowIndex = 1; // first row is invalid 99 code while (FMainDS.SLanguageSpecific.Rows.Find(new object[] { allLanguages.Rows[rowIndex][0].ToString() }) != null) { rowIndex++; } ARow.LanguageCode = allLanguages.Rows[rowIndex][0].ToString(); ARow.MonthName1 = Catalog.GetString("January"); ARow.MonthName2 = Catalog.GetString("February"); ARow.MonthName3 = Catalog.GetString("March"); ARow.MonthName4 = Catalog.GetString("April"); ARow.MonthName5 = Catalog.GetString("May"); ARow.MonthName6 = Catalog.GetString("June"); ARow.MonthName7 = Catalog.GetString("July"); ARow.MonthName8 = Catalog.GetString("August"); ARow.MonthName9 = Catalog.GetString("September"); ARow.MonthName10 = Catalog.GetString("October"); ARow.MonthName11 = Catalog.GetString("November"); ARow.MonthName12 = Catalog.GetString("December"); ARow.MonthNameShort1 = Catalog.GetString("Jan"); ARow.MonthNameShort2 = Catalog.GetString("Feb"); ARow.MonthNameShort3 = Catalog.GetString("Mar"); ARow.MonthNameShort4 = Catalog.GetString("Apr"); ARow.MonthNameShort5 = Catalog.GetString("May"); ARow.MonthNameShort6 = Catalog.GetString("Jun"); ARow.MonthNameShort7 = Catalog.GetString("Jul"); ARow.MonthNameShort8 = Catalog.GetString("Aug"); ARow.MonthNameShort9 = Catalog.GetString("Sep"); ARow.MonthNameShort10 = Catalog.GetString("Oct"); ARow.MonthNameShort11 = Catalog.GetString("Nov"); ARow.MonthNameShort12 = Catalog.GetString("Dec"); }
private void NewRowManual(ref SLanguageSpecificRow ARow) { // Deal with primary key. LanguageCode is unique and is 10 characters. // We use the first unused language code from our language code list Type DataTableType; // Load Data PLanguageTable allLanguages = new PLanguageTable(); DataTable CacheDT = TDataCache.GetCacheableDataTableFromCache("LanguageCodeList", String.Empty, null, out DataTableType); allLanguages.Merge(CacheDT); // Because of the checking code in NewRecord, we know there is at least one spare language we can use int rowIndex = 1; // first row is invalid 99 code while (FMainDS.SLanguageSpecific.Rows.Find(new object[] { allLanguages.Rows[rowIndex][0].ToString() }) != null) { rowIndex++; } ARow.LanguageCode = allLanguages.Rows[rowIndex][0].ToString(); ARow.MonthName1 = Catalog.GetString("January"); ARow.MonthName2 = Catalog.GetString("February"); ARow.MonthName3 = Catalog.GetString("March"); ARow.MonthName4 = Catalog.GetString("April"); ARow.MonthName5 = Catalog.GetString("May"); ARow.MonthName6 = Catalog.GetString("June"); ARow.MonthName7 = Catalog.GetString("July"); ARow.MonthName8 = Catalog.GetString("August"); ARow.MonthName9 = Catalog.GetString("September"); ARow.MonthName10 = Catalog.GetString("October"); ARow.MonthName11 = Catalog.GetString("November"); ARow.MonthName12 = Catalog.GetString("December"); ARow.MonthNameShort1 = Catalog.GetString("Jan"); ARow.MonthNameShort2 = Catalog.GetString("Feb"); ARow.MonthNameShort3 = Catalog.GetString("Mar"); ARow.MonthNameShort4 = Catalog.GetString("Apr"); ARow.MonthNameShort5 = Catalog.GetString("May"); ARow.MonthNameShort6 = Catalog.GetString("Jun"); ARow.MonthNameShort7 = Catalog.GetString("Jul"); ARow.MonthNameShort8 = Catalog.GetString("Aug"); ARow.MonthNameShort9 = Catalog.GetString("Sep"); ARow.MonthNameShort10 = Catalog.GetString("Oct"); ARow.MonthNameShort11 = Catalog.GetString("Nov"); ARow.MonthNameShort12 = Catalog.GetString("Dec"); }