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