コード例 #1
0
 private void addCommentButton_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(newCommentTextBox.Text))
     {
         Comment comment = new Comment() { Author = Program.AuthUser, EntityType = EntityType.Product, Text = newCommentTextBox.Text };
         _presenter.ProductComments.Add(comment);
         newCommentTextBox.Text = string.Empty;
         _presenter.Save();
     }
 }
コード例 #2
0
 private void addCommentButton_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(newCommentTextBox.Text))
     {
         Comment comment = new Comment()
         {
             Author = Program.AuthUser, EntityType = EntityType.Product, Text = newCommentTextBox.Text
         };
         _presenter.ProductComments.Add(comment);
         newCommentTextBox.Text = string.Empty;
         _presenter.Save();
     }
 }
コード例 #3
0
 protected bool Equals(Comment other)
 {
     return Equals(Author, other.Author) && string.Equals(Text, other.Text) && EntityType == other.EntityType;
 }
コード例 #4
0
 public void Delete(Comment entity)
 {
     dbContext.Comments.Remove(entity);
     dbContext.SaveChanges();
 }
コード例 #5
0
 public void Update(Comment entity)
 {
     dbContext.Entry(entity).State = System.Data.Entity.EntityState.Modified;
     dbContext.SaveChanges();
 }
コード例 #6
0
 public void Create(Comment entity)
 {
     dbContext.Comments.Add(entity);
     dbContext.SaveChanges();
 }