예제 #1
0
        public ActionResult DeleteTV(int?id)
        {
            TVdb b = db.TVs.Find(id);

            if (b != null)
            {
                db.TVs.Remove(b);
                db.SaveChanges();
            }
            return(RedirectToAction("Index"));
        }
예제 #2
0
        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"));
        }
예제 #3
0
        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"));
        }