private static Joke jokeByIDRepackage(DataRow myRow) { Joke joke = new Joke(); joke.id = Convert.ToInt32(myRow["id"]); joke.title = myRow["title"].ToString(); joke.teaser = myRow["teaser"].ToString(); joke.joke_text = myRow["joke_text"].ToString(); joke.created_at = Convert.ToDateTime(myRow["created_at"]); joke.user_id = Convert.ToInt32(myRow["user_id"]); joke.category_id = Convert.ToInt32(myRow["category_id"]); joke.featured = Convert.ToBoolean(myRow["featured"]); return(joke); }
// UPDATE JOKE public static bool UpdateJoke(Joke joke) { bool returned = SQL.JokesSQL.UpdateJoke(joke); return(returned); }
// ADD JOKE public static bool AddJoke(Joke joke) { bool returned = SQL.JokesSQL.CreateJoke(joke); return(returned); }