public ActionResult AddJoke(Joke model) { model.Time = DateTime.Now; db.Jokes.Add(model); db.SaveChanges(); return RedirectToAction("JokeManager"); }
public ActionResult JokeEdit(Joke model) { Joke joke = new Joke(); joke = db.Jokes.Find(model.ID); joke.Content = model.Content; db.SaveChanges(); return RedirectToAction("JokeManager"); }