public bool SavePostContent(string newtext,User author){ byte[] data = System.Text.Encoding.UTF8.GetBytes(newtext); data = Util.GZip_Pack(data); const string query = @" INSERT INTO post_content VALUES (now(),@id,@editor,@content,@size)"; int result = DBHelper.ExecuteQuery(query, new Dictionary<string,object> { { "@id",this.id}, { "@editor",author.Id}, { "@content",data}, { "@size",data.Length} }); if(result == 1){ body = newtext; } //TODO:Needs exception return (result == 1); }
public void DeletePost (User culprit,bool removeContent = true) { //TODO: Code for removing posts. }