Example #1
0
        public UserPostViewModel()
        {
            obj = new user_post();

            // TODO trick?
            //obj.created_at = DateTime.Now;
        }
Example #2
0
        public UserPostViewModel(user_post obj)
        {
            this.obj = obj;

            this.id = obj.id;
            this.user_id = obj.user_id;
            this.parent_post_id = obj.parent_post_id;
            this.title = obj.title;
            this.content = obj.content;
            this.ranking_points = obj.ranking_points;
            this.num_views = obj.num_views;
            this.is_accepted_answer = obj.is_accepted_answer;
            this.created_at = obj.created_at;
        }
Example #3
0
		private void detach_user_posts(user_post entity)
		{
			this.SendPropertyChanging();
			entity.user = null;
		}
Example #4
0
		private void attach_user_posts(user_post entity)
		{
			this.SendPropertyChanging();
			entity.user = this;
		}
Example #5
0
 partial void Deleteuser_post(user_post instance);
Example #6
0
 partial void Updateuser_post(user_post instance);
Example #7
0
 partial void Insertuser_post(user_post instance);
Example #8
0
 public void Delete(user_post user_post)
 {
     db.user_posts.DeleteOnSubmit(user_post);
 }
Example #9
0
 // Insert/Delete
 public void Add(user_post user_post)
 {
     db.user_posts.InsertOnSubmit(user_post);
 }
Example #10
0
 public void ApplyChanges(user_post toEdit)
 {
     // TODO should we set user_id here and this way?
     toEdit.user_id = this.user_id;
     toEdit.parent_post_id = this.parent_post_id;
     toEdit.title = this.title;
     toEdit.content = this.content;
     toEdit.ranking_points = this.ranking_points;
     toEdit.num_views = this.num_views;
     toEdit.is_accepted_answer = this.is_accepted_answer;
 }