Exemplo n.º 1
0
 private void detach_WordComments(WordComments ent)
 {
     NotifyPropertyChanging("WordComments");
     ent.Word = null;
 }
Exemplo n.º 2
0
 private void attach_WordComments(WordComments ent)
 {
     NotifyPropertyChanging("WordComments");
     ent.Word = this;
 }
Exemplo n.º 3
0
 private void attach_WordComments(WordComments ent)
 {
     NotifyPropertyChanging("WordComments");
     ent.Word = this;
 }
Exemplo n.º 4
0
 private void detach_WordComments(WordComments ent)
 {
     NotifyPropertyChanging("WordComments");
     ent.Word = null;
 }
Exemplo n.º 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();
 }