コード例 #1
0
ファイル: JapaneseWord.cs プロジェクト: ozim/WebDemo
 /// <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;
 }
コード例 #2
0
        /// <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);
            }
        }
コード例 #3
0
ファイル: JapaneseWordTest.cs プロジェクト: ozim/WebDemo
 public void EditModel_SecondConstructor()
 {
     JapaneseWord jpw = new JapaneseWord();
     JapaneseWordEntry jpwe = new JapaneseWordEntry();
 }
コード例 #4
0
ファイル: WebDemo.designer.cs プロジェクト: ozim/WebDemo
 partial void DeleteJapaneseWordEntry(JapaneseWordEntry instance);
コード例 #5
0
ファイル: WebDemo.designer.cs プロジェクト: ozim/WebDemo
 partial void UpdateJapaneseWordEntry(JapaneseWordEntry instance);
コード例 #6
0
ファイル: WebDemo.designer.cs プロジェクト: ozim/WebDemo
 partial void InsertJapaneseWordEntry(JapaneseWordEntry instance);