/// <summary> /// Model used for editing via the repository class /// /// Not very well thought out when the sql db field is a bigint and here is an int. /// </summary> /// <param name="source"></param> public JapaneseWord(JapaneseWordEntry source) { EntryID = Convert.ToInt32(source.EntryId); Kanji = source.Kanji; Hiragana = source.Hiragana; Romaji = source.Romaji; AdditionalText = source.AdditionalText; MotherTongueTranslation = source.MotherTongueTranslation; MotherTongueTranslationLabel = source.MotherTongueTranslationLabel; }
/// <summary> /// Add 1 entry to the table /// </summary> public void AddEntry(JapaneseWord model) { try { JapaneseWordEntry jpwe = new JapaneseWordEntry { Hiragana = model.Hiragana, Kanji = model.Kanji, Romaji = model.Romaji, AdditionalText = model.AdditionalText, MotherTongueTranslation = model.MotherTongueTranslation, MotherTongueTranslationLabel = model.MotherTongueTranslationLabel }; jpwe.EntryId = null; // since this is an insert, id's are auto incremented on the database side context.JapaneseWordEntries.InsertOnSubmit(jpwe); context.SubmitChanges(); } catch (Exception ex) { appLog.WriteEntry(ex.Message); } }
public void EditModel_SecondConstructor() { JapaneseWord jpw = new JapaneseWord(); JapaneseWordEntry jpwe = new JapaneseWordEntry(); }
partial void DeleteJapaneseWordEntry(JapaneseWordEntry instance);
partial void UpdateJapaneseWordEntry(JapaneseWordEntry instance);
partial void InsertJapaneseWordEntry(JapaneseWordEntry instance);