public ActionResult CadastrarNoticia() { Noticia noticia = new Noticia() { Data = DateTime.Now }; return View(noticia); }
public ActionResult CadastrarNoticia(Noticia noticia) { ConteudoFacade facade = new ConteudoFacade(); try { noticia.Codigo = 0; facade.SalvarNoticia(noticia); return RedirectToAction("Index"); } catch { return View("Index"); } }
public ActionResult AlterarNoticia(Noticia noticia) { ConteudoFacade facade = new ConteudoFacade(); try { facade.SalvarNoticia(noticia); return Redirect("~/ManterNoticia"); } catch { return View(noticia); } }