예제 #1
0
 private void detach_WordComments(WordComments ent)
 {
     NotifyPropertyChanging("WordComments");
     ent.Word = null;
 }
예제 #2
0
 private void attach_WordComments(WordComments ent)
 {
     NotifyPropertyChanging("WordComments");
     ent.Word = this;
 }
예제 #3
0
파일: Words.cs 프로젝트: supudo/Neolog-WP
 private void attach_WordComments(WordComments ent)
 {
     NotifyPropertyChanging("WordComments");
     ent.Word = this;
 }
예제 #4
0
파일: Words.cs 프로젝트: supudo/Neolog-WP
 private void detach_WordComments(WordComments ent)
 {
     NotifyPropertyChanging("WordComments");
     ent.Word = null;
 }
예제 #5
0
 public void AddWordComment(WordComments ent)
 {
     var exists = from t in nlDB.WordComments
                  where t.WordCommentId == ent.WordCommentId
                  select t;
     if (exists.Count() == 0)
     {
         ent.Word = nlDB.Words.Where(t => t.WordId == ent.WordId).FirstOrDefault();
         nlDB.WordComments.InsertOnSubmit(ent);
         AllWordComments.Add(ent);
     }
     else
     {
         WordComments t = exists.FirstOrDefault();
         t.Author = ent.Author;
         t.Comment = ent.Comment;
         t.CommentDate = ent.CommentDate;
         t.WordId = ent.WordId;
         ent.Word = nlDB.Words.Where(t2 => t2.WordId == ent.WordId).FirstOrDefault();
         t.RefWordId = t.Word.Id;
     }
     nlDB.SubmitChanges();
 }