Ejemplo n.º 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();
     }
 }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 3
0
 protected bool Equals(Comment other)
 {
     return Equals(Author, other.Author) && string.Equals(Text, other.Text) && EntityType == other.EntityType;
 }
Ejemplo n.º 4
0
 public void Delete(Comment entity)
 {
     dbContext.Comments.Remove(entity);
     dbContext.SaveChanges();
 }
Ejemplo n.º 5
0
 public void Update(Comment entity)
 {
     dbContext.Entry(entity).State = System.Data.Entity.EntityState.Modified;
     dbContext.SaveChanges();
 }
Ejemplo n.º 6
0
 public void Create(Comment entity)
 {
     dbContext.Comments.Add(entity);
     dbContext.SaveChanges();
 }