public ActionResult DeleteTV(int?id) { TVdb b = db.TVs.Find(id); if (b != null) { db.TVs.Remove(b); db.SaveChanges(); } return(RedirectToAction("Index")); }
public ActionResult OnOffTV(int id) { TVdb b = db.TVs.Find(id); if (b.Status == false) { b.Status = true; } else { b.Status = false; } db.Entry(b).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult ChanelPrevious(int?id) { if (id == null) { return(HttpNotFound()); } TVdb b = db.TVs.Find(id); if (b == null) { return(HttpNotFound()); } if (b is TVdb) { b.PreviousChanel(); db.Entry(b).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } return(RedirectToAction("Index")); }