Exemple #1
0
        public ActionResult DeleteRef(int?id)
        {
            Refrigeratordb b = db.Refrigerators.Find(id);

            if (b != null)
            {
                db.Refrigerators.Remove(b);
                db.SaveChanges();
            }
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public ActionResult OnOffRef(int id)
        {
            Refrigeratordb b = db.Refrigerators.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"));
        }
Exemple #3
0
        public ActionResult DecreasTempricheRef(int?id)
        {
            if (id == null)
            {
                return(HttpNotFound());
            }
            Refrigeratordb b = db.Refrigerators.Find(id);

            if (b == null)
            {
                return(HttpNotFound());
            }
            if (b is Refrigeratordb)
            {
                b.DecreasTempriche();
                db.Entry(b).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
            }
            return(RedirectToAction("Index"));
        }