public ActionResult Create(NoticiasEntity noticiasentity, DateTime data) { if (ModelState.IsValid) { noticiasentity.data = data; noticiasentity.CorpoNoticia = noticiasentity.CorpoNoticia.Replace("*b*", "<b>").Replace("*/b*", "</b>").Replace("*u*", "<u>").Replace("*/u*", "</u>").Replace("*p*", "<p>").Replace("*/p*", "</p>"); db.NoticiasProfiles.Add(noticiasentity); db.SaveChanges(); return(RedirectToAction("ManageNoticias")); } return(RedirectToAction("ManageNoticias")); }
public bool Agregar(Noticia NoticiasAgregar) { try { _ctx.Noticias.Add(NoticiasAgregar); _ctx.SaveChanges(); return(true); } catch (Exception error) { return(false); } }