Exemplo n.º 1
0
 public posts AddPost(posts post)
 {
     try
     {
         ping_pakistanEntities db = new ping_pakistanEntities();
         db.posts.Add(post);
         db.SaveChanges();
         return post;
     }
     catch (Exception ex)
     {
         return post;
     }
 }
 public posts NewPost(posts post)
 {
     try
     {
         Posts posts = new Posts();
         post.agree_count = 0;
         post.disagree_count = 0;
         post.date_added = DateTime.Now;
         post.is_approved = true;
         post.is_deleted = true;
         posts.AddPost(post);
         return post;
     }
     catch (Exception ex)
     {
         return null;
     }
 }