Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            NoticiasEntity noticiasentity = db.NoticiasProfiles.Find(id);

            db.NoticiasProfiles.Remove(noticiasentity);
            db.SaveChanges();
            return(RedirectToAction("ManageNoticias"));
        }
Beispiel #2
0
 public ActionResult Edit(NoticiasEntity noticiasentity)
 {
     if (ModelState.IsValid)
     {
         db.Entry(noticiasentity).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("ManageNoticias"));
     }
     return(View(noticiasentity));
 }
Beispiel #3
0
        public ActionResult Edit(int id = 1)
        {
            NoticiasEntity noticiasentity = db.NoticiasProfiles.Find(id);

            if (noticiasentity == null)
            {
                return(HttpNotFound());
            }
            return(View(noticiasentity));
        }
Beispiel #4
0
        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"));
        }